From fe55548b42f4940b4ef306ff9fa8a3e4bc07facc Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 26 Jul 2022 10:57:31 -0400 Subject: [PATCH 01/67] Files copied over --- README.md | 187 +- package.json | 72 +- .../datastore/v1/aggregation_result.proto | 61 + protos/google/datastore/v1/datastore.proto | 91 +- protos/google/datastore/v1/entity.proto | 4 + protos/google/datastore/v1/query.proto | 63 +- .../generated/v1/datastore.allocate_ids.js | 70 + .../v1/datastore.begin_transaction.js | 68 + samples/generated/v1/datastore.commit.js | 87 + samples/generated/v1/datastore.lookup.js | 73 + samples/generated/v1/datastore.reserve_ids.js | 70 + samples/generated/v1/datastore.rollback.js | 70 + .../v1/datastore.run_aggregation_query.js | 83 + samples/generated/v1/datastore.run_query.js | 83 + .../snippet_metadata.google.datastore.v1.json | 435 ++++ src/index.ts | 1916 +-------------- src/v1/datastore_client.ts | 1331 ++++++----- src/v1/datastore_client_config.json | 5 + src/v1/datastore_proto_list.json | 1 + src/v1/gapic_metadata.json | 82 +- src/v1/index.ts | 3 +- system-test/fixtures/sample/src/index.js | 3 +- system-test/fixtures/sample/src/index.ts | 10 +- system-test/install.ts | 24 +- test/gapic_datastore_v1.ts | 2047 +++++++++-------- webpack.config.js | 14 +- 26 files changed, 3269 insertions(+), 3684 deletions(-) create mode 100644 protos/google/datastore/v1/aggregation_result.proto create mode 100644 samples/generated/v1/datastore.allocate_ids.js create mode 100644 samples/generated/v1/datastore.begin_transaction.js create mode 100644 samples/generated/v1/datastore.commit.js create mode 100644 samples/generated/v1/datastore.lookup.js create mode 100644 samples/generated/v1/datastore.reserve_ids.js create mode 100644 samples/generated/v1/datastore.rollback.js create mode 100644 samples/generated/v1/datastore.run_aggregation_query.js create mode 100644 samples/generated/v1/datastore.run_query.js create mode 100644 samples/generated/v1/snippet_metadata.google.datastore.v1.json diff --git a/README.md b/README.md index b4b902f00..85e311e00 100644 --- a/README.md +++ b/README.md @@ -1,186 +1 @@ -[//]: # "This README.md file is auto-generated, all changes to this file will be lost." -[//]: # "To regenerate it, use `python -m synthtool`." -Google Cloud Platform logo - -# [Google Cloud Datastore: Node.js Client](https://github.com/googleapis/nodejs-datastore) - -[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) -[![npm version](https://img.shields.io/npm/v/@google-cloud/datastore.svg)](https://www.npmjs.org/package/@google-cloud/datastore) - - - - -Cloud Datastore Client Library for Node.js - - -A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-datastore/blob/main/CHANGELOG.md). - -* [Google Cloud Datastore Node.js Client API Reference][client-docs] -* [Google Cloud Datastore Documentation][product-docs] -* [github.com/googleapis/nodejs-datastore](https://github.com/googleapis/nodejs-datastore) - -Read more about the client libraries for Cloud APIs, including the older -Google APIs Client Libraries, in [Client Libraries Explained][explained]. - -[explained]: https://cloud.google.com/apis/docs/client-libraries-explained - -**Table of contents:** - - -* [Quickstart](#quickstart) - * [Before you begin](#before-you-begin) - * [Installing the client library](#installing-the-client-library) - * [Using the client library](#using-the-client-library) -* [Samples](#samples) -* [Versioning](#versioning) -* [Contributing](#contributing) -* [License](#license) - -## Quickstart - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable the Google Cloud Datastore API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the - API from your local workstation. - -### Installing the client library - -```bash -npm install @google-cloud/datastore -``` - - -### Using the client library - -```javascript -// Imports the Google Cloud client library -const {Datastore} = require('@google-cloud/datastore'); - -// Creates a client -const datastore = new Datastore(); - -async function quickstart() { - // The kind for the new entity - const kind = 'Task'; - - // The name/ID for the new entity - const name = 'sampletask1'; - - // The Cloud Datastore key for the new entity - const taskKey = datastore.key([kind, name]); - - // Prepares the new entity - const task = { - key: taskKey, - data: { - description: 'Buy milk', - }, - }; - - // Saves the entity - await datastore.save(task); - console.log(`Saved ${task.key.name}: ${task.data.description}`); -} -quickstart(); - -``` -### Troubleshooting -#### Emulator returning `DEADLINE_EXCEEDED`, `java.lang.OutOfMemoryError` -*Reference Issue: [#95](https://github.com/googleapis/nodejs-datastore/issues/95)* - -When using the emulator, you may experience errors such as "DEADLINE_EXCEEDED" within your application, corresponding to an error in the emulator: "java.lang.OutOfMemoryError". These errors are unique to the emulator environment and will not persist in production. - -A workaround is available, provided by [@ohmpatel1997](https://github.com/ohmpatel1997) [here](https://github.com/googleapis/nodejs-datastore/issues/95#issuecomment-554387312). - - -## Samples - -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-datastore/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. - -| Sample | Source Code | Try it | -| --------------------------- | --------------------------------- | ------ | -| Concepts | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/concepts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/concepts.js,samples/README.md) | -| Error | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/error.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/error.js,samples/README.md) | -| Export | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/export.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/export.js,samples/README.md) | -| Import | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/import.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/import.js,samples/README.md) | -| Indexes.get | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/indexes.get.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/indexes.get.js,samples/README.md) | -| Indexes.list | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/indexes.list.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/indexes.list.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/nodejs-datastore/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-datastore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Add Task | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.add.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.add.js,samples/README.md) | -| Delete Task | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.delete.js,samples/README.md) | -| Legacy Samples | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.js,samples/README.md) | -| List Tasks | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.list.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.list.js,samples/README.md) | -| Update Task | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.markdone.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.markdone.js,samples/README.md) | - - - -The [Google Cloud Datastore Node.js Client API Reference][client-docs] documentation -also contains samples. - -## Supported Node.js Versions - -Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). -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/datastore@legacy-8` installs client libraries -for versions compatible with Node.js 8. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - - - -This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways -unless absolutely necessary (e.g. because of critical security issues) or with -an extensive deprecation period. Issues and requests against **stable** libraries -are addressed with the highest priority. - - - - - - -More Information: [Google Cloud Platform Launch Stages][launch_stages] - -[launch_stages]: https://cloud.google.com/terms/launch-stages - -## Contributing - -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-datastore/blob/main/CONTRIBUTING.md). - -Please note that this `README.md`, the `samples/README.md`, -and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) -are generated from a central template. To edit one of these files, make an edit -to its templates in -[directory](https://github.com/googleapis/synthtool). - -## License - -Apache Version 2.0 - -See [LICENSE](https://github.com/googleapis/nodejs-datastore/blob/main/LICENSE) - -[client-docs]: https://cloud.google.com/nodejs/docs/reference/datastore/latest -[product-docs]: https://cloud.google.com/datastore/docs -[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=datastore.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +Datastore: Nodejs Client diff --git a/package.json b/package.json index c30bf2e3e..ee45794f8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,15 @@ { "name": "@google-cloud/datastore", - "version": "7.0.0", - "description": "Cloud Datastore Client Library for Node.js", + "version": "0.1.0", + "description": "Datastore client for Node.js", + "repository": "googleapis/nodejs-datastore", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], "keywords": [ "google apis client", "google api client", @@ -12,71 +20,45 @@ "google cloud", "cloud", "google datastore", + "datastore", "datastore" ], - "repository": "googleapis/nodejs-datastore", - "license": "Apache-2.0", - "author": "Google LLC.", - "main": "build/src/index.js", - "files": [ - "build/protos", - "build/src" - ], "scripts": { "clean": "gts clean", - "compile": "tsc -p . && cp -r proto* build/ && cp -r system-test/data build/system-test", + "compile": "tsc -p . && cp -r protos build/", "compile-protos": "compileProtos src", "docs": "jsdoc -c .jsdoc.js", "predocs-test": "npm run docs", "docs-test": "linkinator docs", "fix": "gts fix", - "prelint": "cd samples; npm link ../; npm install", "lint": "gts check", "prepare": "npm run compile-protos && npm run compile", - "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", - "presystem-test": "npm run compile", - "system-test": "mocha build/system-test --timeout 600000", - "pretest": "npm run compile", - "test": "c8 mocha build/test", - "precompile": "gts clean" + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" }, "dependencies": { - "@google-cloud/promisify": "^3.0.0", - "arrify": "^2.0.1", - "concat-stream": "^2.0.0", - "extend": "^3.0.2", - "google-gax": "^3.0.1", - "is": "^3.3.0", - "split-array-stream": "^2.0.0", - "stream-events": "^1.0.5" + "google-gax": "^3.1.1" }, "devDependencies": { - "@google-cloud/storage": "^6.0.0", - "@types/extend": "^3.0.1", - "@types/is": "0.0.21", - "@types/js-yaml": "^4.0.0", - "@types/mocha": "^9.0.0", + "@types/mocha": "^9.1.0", "@types/node": "^16.0.0", - "@types/proxyquire": "^1.3.28", - "@types/sinon": "^10.0.0", - "c8": "^7.1.0", + "@types/sinon": "^10.0.8", + "c8": "^7.11.0", "gts": "^3.1.0", - "js-yaml": "^4.0.0", - "jsdoc": "^3.6.3", + "jsdoc": "^3.6.7", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^4.0.0", - "mocha": "^9.2.2", - "null-loader": "^4.0.0", - "p-queue": "^6.6.1", + "linkinator": "^3.0.0", + "mocha": "^10.0.0", + "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "proxyquire": "^2.1.3", "sinon": "^14.0.0", - "ts-loader": "^8.0.0", - "typescript": "^4.6.4", - "webpack-cli": "^4.0.0" + "ts-loader": "^9.2.6", + "typescript": "^4.5.5", + "webpack": "^5.67.0", + "webpack-cli": "^4.9.1" }, "engines": { - "node": ">=12.0.0" + "node": ">=v12" } } diff --git a/protos/google/datastore/v1/aggregation_result.proto b/protos/google/datastore/v1/aggregation_result.proto new file mode 100644 index 000000000..e9c1d4940 --- /dev/null +++ b/protos/google/datastore/v1/aggregation_result.proto @@ -0,0 +1,61 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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.datastore.v1; + +import "google/datastore/v1/entity.proto"; +import "google/datastore/v1/query.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Datastore.V1"; +option go_package = "google.golang.org/genproto/googleapis/datastore/v1;datastore"; +option java_multiple_files = true; +option java_outer_classname = "AggregationResultProto"; +option java_package = "com.google.datastore.v1"; +option php_namespace = "Google\\Cloud\\Datastore\\V1"; +option ruby_package = "Google::Cloud::Datastore::V1"; + +// The result of a single bucket from a Datastore aggregation query. +// +// The keys of `aggregate_properties` are the same for all results in an +// aggregation query, unlike entity queries which can have different fields +// present for each result. +message AggregationResult { + // The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. + // + // The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] + // assigned to the aggregation function on input and the size of this map + // equals the number of aggregation functions in the query. + map aggregate_properties = 2; +} + +// A batch of aggregation results produced by an aggregation query. +message AggregationResultBatch { + // The aggregation results for this batch. + repeated AggregationResult aggregation_results = 1; + + // The state of the query after the current batch. + // Only COUNT(*) aggregations are supported in the initial launch. Therefore, + // expected result type is limited to `NO_MORE_RESULTS`. + QueryResultBatch.MoreResultsType more_results = 2; + + // Read timestamp this batch was returned from. + // + // In a single transaction, subsequent query result batches for the same query + // can have a greater timestamp. Each batch's read timestamp + // is valid for all preceding batches. + google.protobuf.Timestamp read_time = 3; +} diff --git a/protos/google/datastore/v1/datastore.proto b/protos/google/datastore/v1/datastore.proto index 22d930ad0..1eb65e536 100644 --- a/protos/google/datastore/v1/datastore.proto +++ b/protos/google/datastore/v1/datastore.proto @@ -19,6 +19,7 @@ package google.datastore.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/datastore/v1/aggregation_result.proto"; import "google/datastore/v1/entity.proto"; import "google/datastore/v1/query.proto"; import "google/protobuf/timestamp.proto"; @@ -61,6 +62,14 @@ service Datastore { }; } + // Runs an aggregation query. + rpc RunAggregationQuery(RunAggregationQueryRequest) returns (RunAggregationQueryResponse) { + option (google.api.http) = { + post: "/v1/projects/{project_id}:runAggregationQuery" + body: "*" + }; + } + // Begins a new transaction. rpc BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse) { option (google.api.http) = { @@ -116,6 +125,12 @@ message LookupRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; + // The ID of the database against which to make the request. + // + // '(default)' is not allowed; please use empty string '' to refer the default + // database. + string database_id = 9; + // The options for this lookup request. ReadOptions read_options = 1; @@ -149,6 +164,12 @@ message RunQueryRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; + // The ID of the database against which to make the request. + // + // '(default)' is not allowed; please use empty string '' to refer the default + // database. + string database_id = 9; + // Entities are partitioned into subsets, identified by a partition ID. // Queries are scoped to a single partition. // This partition ID is normalized with the standard default context @@ -163,7 +184,7 @@ message RunQueryRequest { // The query to run. Query query = 3; - // The GQL query to run. + // The GQL query to run. This query must be a non-aggregation query. GqlQuery gql_query = 7; } } @@ -177,11 +198,56 @@ message RunQueryResponse { Query query = 2; } +// The request for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery]. +message RunAggregationQueryRequest { + // Required. The ID of the project against which to make the request. + string project_id = 8 [(google.api.field_behavior) = REQUIRED]; + + // The ID of the database against which to make the request. + // + // '(default)' is not allowed; please use empty string '' to refer the default + // database. + string database_id = 9; + + // Entities are partitioned into subsets, identified by a partition ID. + // Queries are scoped to a single partition. + // This partition ID is normalized with the standard default context + // partition ID. + PartitionId partition_id = 2; + + // The options for this query. + ReadOptions read_options = 1; + + // The type of query. + oneof query_type { + // The query to run. + AggregationQuery aggregation_query = 3; + + // The GQL query to run. This query must be an aggregation query. + GqlQuery gql_query = 7; + } +} + +// The response for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery]. +message RunAggregationQueryResponse { + // A batch of aggregation results. Always present. + AggregationResultBatch batch = 1; + + // The parsed form of the `GqlQuery` from the request, if it was set. + AggregationQuery query = 2; +} + // The request for [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. message BeginTransactionRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; + // The ID of the database against which to make the request. + // + // '(default)' is not allowed; please use empty string '' to refer the default + // database. + string database_id = 9; + // Options for a new transaction. TransactionOptions transaction_options = 10; } @@ -197,6 +263,12 @@ message RollbackRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; + // The ID of the database against which to make the request. + // + // '(default)' is not allowed; please use empty string '' to refer the default + // database. + string database_id = 9; + // Required. The transaction identifier, returned by a call to // [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. bytes transaction = 1 [(google.api.field_behavior) = REQUIRED]; @@ -227,6 +299,12 @@ message CommitRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; + // The ID of the database against which to make the request. + // + // '(default)' is not allowed; please use empty string '' to refer the default + // database. + string database_id = 9; + // The type of commit to perform. Defaults to `TRANSACTIONAL`. Mode mode = 5; @@ -273,6 +351,12 @@ message AllocateIdsRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; + // The ID of the database against which to make the request. + // + // '(default)' is not allowed; please use empty string '' to refer the default + // database. + string database_id = 9; + // Required. A list of keys with incomplete key paths for which to allocate IDs. // No key may be reserved/read-only. repeated Key keys = 1 [(google.api.field_behavior) = REQUIRED]; @@ -290,7 +374,10 @@ message ReserveIdsRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; - // If not empty, the ID of the database against which to make the request. + // The ID of the database against which to make the request. + // + // '(default)' is not allowed; please use empty string '' to refer the default + // database. string database_id = 9; // Required. A list of keys with complete key paths whose numeric IDs should not be diff --git a/protos/google/datastore/v1/entity.proto b/protos/google/datastore/v1/entity.proto index 55d7b64fe..010f1b3af 100644 --- a/protos/google/datastore/v1/entity.proto +++ b/protos/google/datastore/v1/entity.proto @@ -51,6 +51,10 @@ message PartitionId { // The ID of the project to which the entities belong. string project_id = 2; + // If not empty, the ID of the database to which the entities + // belong. + string database_id = 3; + // If not empty, the ID of the namespace to which the entities belong. string namespace_id = 4; } diff --git a/protos/google/datastore/v1/query.proto b/protos/google/datastore/v1/query.proto index 00c020021..2f4b0bb99 100644 --- a/protos/google/datastore/v1/query.proto +++ b/protos/google/datastore/v1/query.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package google.datastore.v1; +import "google/api/field_behavior.proto"; import "google/datastore/v1/entity.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; @@ -117,6 +118,60 @@ message Query { google.protobuf.Int32Value limit = 12; } +// Datastore query for running an aggregation over a [Query][google.datastore.v1.Query]. +message AggregationQuery { + // Defines a aggregation that produces a single result. + message Aggregation { + // Count of entities that match the query. + // + // The `COUNT(*)` aggregation function operates on the entire entity + // so it does not require a field reference. + message Count { + // Optional. Optional constraint on the maximum number of entities to count. + // + // This provides a way to set an upper bound on the number of entities + // to scan, limiting latency and cost. + // + // High-Level Example: + // + // ``` + // SELECT COUNT_UP_TO(1000) FROM ( SELECT * FROM k ); + // ``` + // + // Requires: + // + // * Must be greater than zero when present. + int32 up_to = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // The type of aggregation to perform, required. + oneof operator { + // Count aggregator. + Count count = 1; + } + + // Optional. The name of the property to store the result of the aggregation into. If + // not provided, a default alias `property_` will be used. + // For example: property_1, property_2 + // + // Requires: + // + // * Must be unique across all aggregation aliases. + // * Conform to existing [entity property name][google.datastore.v1.Entity.properties] + // limitations. + string alias = 7 [(google.api.field_behavior) = OPTIONAL]; + } + + // The base query to aggregate over. + oneof query_type { + // Nested query for aggregation + Query nested_query = 1; + } + + // Optional. Series of aggregations to apply on top of the base query. + repeated Aggregation aggregations = 3 [(google.api.field_behavior) = OPTIONAL]; +} + // A representation of a kind. message KindExpression { // The name of the kind. @@ -178,13 +233,19 @@ message CompositeFilter { // The results are required to satisfy each of the combined filters. AND = 1; + + // Documents are required to satisfy at least one of the combined filters. + OR = 2; } // The operator for combining multiple filters. Operator op = 1; // The list of filters to combine. - // Must contain at least one filter. + // + // Requires: + // + // * At least one filter is present. repeated Filter filters = 2; } diff --git a/samples/generated/v1/datastore.allocate_ids.js b/samples/generated/v1/datastore.allocate_ids.js new file mode 100644 index 000000000..54ab84b95 --- /dev/null +++ b/samples/generated/v1/datastore.allocate_ids.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, keys) { + // [START datastore_v1_generated_Datastore_AllocateIds_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the project against which to make the request. + */ + // const projectId = 'abc123' + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + */ + // const databaseId = 'abc123' + /** + * Required. A list of keys with incomplete key paths for which to allocate IDs. + * No key may be reserved/read-only. + */ + // const keys = 1234 + + // Imports the Datastore library + const {DatastoreClient} = require('@google-cloud/datastore').v1; + + // Instantiates a client + const datastoreClient = new DatastoreClient(); + + async function callAllocateIds() { + // Construct request + const request = { + projectId, + keys, + }; + + // Run request + const response = await datastoreClient.allocateIds(request); + console.log(response); + } + + callAllocateIds(); + // [END datastore_v1_generated_Datastore_AllocateIds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.begin_transaction.js b/samples/generated/v1/datastore.begin_transaction.js new file mode 100644 index 000000000..d2b32bff0 --- /dev/null +++ b/samples/generated/v1/datastore.begin_transaction.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START datastore_v1_generated_Datastore_BeginTransaction_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the project against which to make the request. + */ + // const projectId = 'abc123' + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + */ + // const databaseId = 'abc123' + /** + * Options for a new transaction. + */ + // const transactionOptions = {} + + // Imports the Datastore library + const {DatastoreClient} = require('@google-cloud/datastore').v1; + + // Instantiates a client + const datastoreClient = new DatastoreClient(); + + async function callBeginTransaction() { + // Construct request + const request = { + projectId, + }; + + // Run request + const response = await datastoreClient.beginTransaction(request); + console.log(response); + } + + callBeginTransaction(); + // [END datastore_v1_generated_Datastore_BeginTransaction_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.commit.js b/samples/generated/v1/datastore.commit.js new file mode 100644 index 000000000..f55c04d22 --- /dev/null +++ b/samples/generated/v1/datastore.commit.js @@ -0,0 +1,87 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START datastore_v1_generated_Datastore_Commit_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the project against which to make the request. + */ + // const projectId = 'abc123' + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + */ + // const databaseId = 'abc123' + /** + * The type of commit to perform. Defaults to `TRANSACTIONAL`. + */ + // const mode = {} + /** + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * Datastore.BeginTransaction google.datastore.v1.Datastore.BeginTransaction. + */ + // const transaction = 'Buffer.from('string')' + /** + * The mutations to perform. + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + */ + // const mutations = 1234 + + // Imports the Datastore library + const {DatastoreClient} = require('@google-cloud/datastore').v1; + + // Instantiates a client + const datastoreClient = new DatastoreClient(); + + async function callCommit() { + // Construct request + const request = { + projectId, + }; + + // Run request + const response = await datastoreClient.commit(request); + console.log(response); + } + + callCommit(); + // [END datastore_v1_generated_Datastore_Commit_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.lookup.js b/samples/generated/v1/datastore.lookup.js new file mode 100644 index 000000000..35f26e90a --- /dev/null +++ b/samples/generated/v1/datastore.lookup.js @@ -0,0 +1,73 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, keys) { + // [START datastore_v1_generated_Datastore_Lookup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the project against which to make the request. + */ + // const projectId = 'abc123' + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + */ + // const databaseId = 'abc123' + /** + * The options for this lookup request. + */ + // const readOptions = {} + /** + * Required. Keys of entities to look up. + */ + // const keys = 1234 + + // Imports the Datastore library + const {DatastoreClient} = require('@google-cloud/datastore').v1; + + // Instantiates a client + const datastoreClient = new DatastoreClient(); + + async function callLookup() { + // Construct request + const request = { + projectId, + keys, + }; + + // Run request + const response = await datastoreClient.lookup(request); + console.log(response); + } + + callLookup(); + // [END datastore_v1_generated_Datastore_Lookup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.reserve_ids.js b/samples/generated/v1/datastore.reserve_ids.js new file mode 100644 index 000000000..1f0d22720 --- /dev/null +++ b/samples/generated/v1/datastore.reserve_ids.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, keys) { + // [START datastore_v1_generated_Datastore_ReserveIds_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the project against which to make the request. + */ + // const projectId = 'abc123' + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + */ + // const databaseId = 'abc123' + /** + * Required. A list of keys with complete key paths whose numeric IDs should not be + * auto-allocated. + */ + // const keys = 1234 + + // Imports the Datastore library + const {DatastoreClient} = require('@google-cloud/datastore').v1; + + // Instantiates a client + const datastoreClient = new DatastoreClient(); + + async function callReserveIds() { + // Construct request + const request = { + projectId, + keys, + }; + + // Run request + const response = await datastoreClient.reserveIds(request); + console.log(response); + } + + callReserveIds(); + // [END datastore_v1_generated_Datastore_ReserveIds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.rollback.js b/samples/generated/v1/datastore.rollback.js new file mode 100644 index 000000000..f42c6f482 --- /dev/null +++ b/samples/generated/v1/datastore.rollback.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId, transaction) { + // [START datastore_v1_generated_Datastore_Rollback_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the project against which to make the request. + */ + // const projectId = 'abc123' + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + */ + // const databaseId = 'abc123' + /** + * Required. The transaction identifier, returned by a call to + * Datastore.BeginTransaction google.datastore.v1.Datastore.BeginTransaction. + */ + // const transaction = 'Buffer.from('string')' + + // Imports the Datastore library + const {DatastoreClient} = require('@google-cloud/datastore').v1; + + // Instantiates a client + const datastoreClient = new DatastoreClient(); + + async function callRollback() { + // Construct request + const request = { + projectId, + transaction, + }; + + // Run request + const response = await datastoreClient.rollback(request); + console.log(response); + } + + callRollback(); + // [END datastore_v1_generated_Datastore_Rollback_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.run_aggregation_query.js b/samples/generated/v1/datastore.run_aggregation_query.js new file mode 100644 index 000000000..0911fa7de --- /dev/null +++ b/samples/generated/v1/datastore.run_aggregation_query.js @@ -0,0 +1,83 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START datastore_v1_generated_Datastore_RunAggregationQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the project against which to make the request. + */ + // const projectId = 'abc123' + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + */ + // const databaseId = 'abc123' + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + */ + // const partitionId = {} + /** + * The options for this query. + */ + // const readOptions = {} + /** + * The query to run. + */ + // const aggregationQuery = {} + /** + * The GQL query to run. This query must be an aggregation query. + */ + // const gqlQuery = {} + + // Imports the Datastore library + const {DatastoreClient} = require('@google-cloud/datastore').v1; + + // Instantiates a client + const datastoreClient = new DatastoreClient(); + + async function callRunAggregationQuery() { + // Construct request + const request = { + projectId, + }; + + // Run request + const response = await datastoreClient.runAggregationQuery(request); + console.log(response); + } + + callRunAggregationQuery(); + // [END datastore_v1_generated_Datastore_RunAggregationQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.run_query.js b/samples/generated/v1/datastore.run_query.js new file mode 100644 index 000000000..52649bbe5 --- /dev/null +++ b/samples/generated/v1/datastore.run_query.js @@ -0,0 +1,83 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(projectId) { + // [START datastore_v1_generated_Datastore_RunQuery_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The ID of the project against which to make the request. + */ + // const projectId = 'abc123' + /** + * The ID of the database against which to make the request. + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + */ + // const databaseId = 'abc123' + /** + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + */ + // const partitionId = {} + /** + * The options for this query. + */ + // const readOptions = {} + /** + * The query to run. + */ + // const query = {} + /** + * The GQL query to run. This query must be a non-aggregation query. + */ + // const gqlQuery = {} + + // Imports the Datastore library + const {DatastoreClient} = require('@google-cloud/datastore').v1; + + // Instantiates a client + const datastoreClient = new DatastoreClient(); + + async function callRunQuery() { + // Construct request + const request = { + projectId, + }; + + // Run request + const response = await datastoreClient.runQuery(request); + console.log(response); + } + + callRunQuery(); + // [END datastore_v1_generated_Datastore_RunQuery_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/samples/generated/v1/snippet_metadata.google.datastore.v1.json b/samples/generated/v1/snippet_metadata.google.datastore.v1.json new file mode 100644 index 000000000..d922d59e9 --- /dev/null +++ b/samples/generated/v1/snippet_metadata.google.datastore.v1.json @@ -0,0 +1,435 @@ +{ + "clientLibrary": { + "name": "nodejs-datastore", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.datastore.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "datastore_v1_generated_Datastore_Lookup_async", + "title": "Datastore lookup Sample", + "origin": "API_DEFINITION", + "description": " Looks up entities by key.", + "canonical": true, + "file": "datastore.lookup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Lookup", + "fullName": "google.datastore.v1.Datastore.Lookup", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "read_options", + "type": ".google.datastore.v1.ReadOptions" + }, + { + "name": "keys", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.datastore.v1.LookupResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "Lookup", + "fullName": "google.datastore.v1.Datastore.Lookup", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_RunQuery_async", + "title": "Datastore runQuery Sample", + "origin": "API_DEFINITION", + "description": " Queries for entities.", + "canonical": true, + "file": "datastore.run_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunQuery", + "fullName": "google.datastore.v1.Datastore.RunQuery", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "partition_id", + "type": ".google.datastore.v1.PartitionId" + }, + { + "name": "read_options", + "type": ".google.datastore.v1.ReadOptions" + }, + { + "name": "query", + "type": ".google.datastore.v1.Query" + }, + { + "name": "gql_query", + "type": ".google.datastore.v1.GqlQuery" + } + ], + "resultType": ".google.datastore.v1.RunQueryResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "RunQuery", + "fullName": "google.datastore.v1.Datastore.RunQuery", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_RunAggregationQuery_async", + "title": "Datastore runAggregationQuery Sample", + "origin": "API_DEFINITION", + "description": " Runs an aggregation query.", + "canonical": true, + "file": "datastore.run_aggregation_query.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RunAggregationQuery", + "fullName": "google.datastore.v1.Datastore.RunAggregationQuery", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "partition_id", + "type": ".google.datastore.v1.PartitionId" + }, + { + "name": "read_options", + "type": ".google.datastore.v1.ReadOptions" + }, + { + "name": "aggregation_query", + "type": ".google.datastore.v1.AggregationQuery" + }, + { + "name": "gql_query", + "type": ".google.datastore.v1.GqlQuery" + } + ], + "resultType": ".google.datastore.v1.RunAggregationQueryResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "RunAggregationQuery", + "fullName": "google.datastore.v1.Datastore.RunAggregationQuery", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_BeginTransaction_async", + "title": "Datastore beginTransaction Sample", + "origin": "API_DEFINITION", + "description": " Begins a new transaction.", + "canonical": true, + "file": "datastore.begin_transaction.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BeginTransaction", + "fullName": "google.datastore.v1.Datastore.BeginTransaction", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "transaction_options", + "type": ".google.datastore.v1.TransactionOptions" + } + ], + "resultType": ".google.datastore.v1.BeginTransactionResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "BeginTransaction", + "fullName": "google.datastore.v1.Datastore.BeginTransaction", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_Commit_async", + "title": "Datastore commit Sample", + "origin": "API_DEFINITION", + "description": " Commits a transaction, optionally creating, deleting or modifying some entities.", + "canonical": true, + "file": "datastore.commit.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Commit", + "fullName": "google.datastore.v1.Datastore.Commit", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "mode", + "type": ".google.datastore.v1.CommitRequest.Mode" + }, + { + "name": "transaction", + "type": "TYPE_BYTES" + }, + { + "name": "mutations", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.datastore.v1.CommitResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "Commit", + "fullName": "google.datastore.v1.Datastore.Commit", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_Rollback_async", + "title": "Datastore rollback Sample", + "origin": "API_DEFINITION", + "description": " Rolls back a transaction.", + "canonical": true, + "file": "datastore.rollback.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Rollback", + "fullName": "google.datastore.v1.Datastore.Rollback", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "transaction", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.datastore.v1.RollbackResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "Rollback", + "fullName": "google.datastore.v1.Datastore.Rollback", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_AllocateIds_async", + "title": "Datastore allocateIds Sample", + "origin": "API_DEFINITION", + "description": " Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted.", + "canonical": true, + "file": "datastore.allocate_ids.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AllocateIds", + "fullName": "google.datastore.v1.Datastore.AllocateIds", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "keys", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.datastore.v1.AllocateIdsResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "AllocateIds", + "fullName": "google.datastore.v1.Datastore.AllocateIds", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + }, + { + "regionTag": "datastore_v1_generated_Datastore_ReserveIds_async", + "title": "Datastore reserveIds Sample", + "origin": "API_DEFINITION", + "description": " Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore.", + "canonical": true, + "file": "datastore.reserve_ids.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ReserveIds", + "fullName": "google.datastore.v1.Datastore.ReserveIds", + "async": true, + "parameters": [ + { + "name": "project_id", + "type": "TYPE_STRING" + }, + { + "name": "database_id", + "type": "TYPE_STRING" + }, + { + "name": "keys", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.datastore.v1.ReserveIdsResponse", + "client": { + "shortName": "DatastoreClient", + "fullName": "google.datastore.v1.DatastoreClient" + }, + "method": { + "shortName": "ReserveIds", + "fullName": "google.datastore.v1.Datastore.ReserveIds", + "service": { + "shortName": "Datastore", + "fullName": "google.datastore.v1.Datastore" + } + } + } + } + ] +} diff --git a/src/index.ts b/src/index.ts index 48ec56d95..9dc4ec49b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,1891 +1,25 @@ -/*! - * Copyright 2018 Google LLC. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @namespace google - */ -/** - * @namespace google.datastore.v1 - */ -/** - * @namespace google.protobuf - */ - -import arrify = require('arrify'); -import extend = require('extend'); -import { - GrpcClient, - ClientStub, - ChannelCredentials, - GoogleAuth, - GoogleAuthOptions, - CallOptions, - Operation, - ServiceError, -} from 'google-gax'; -import * as is from 'is'; -import {Transform, pipeline} from 'stream'; - -import {entity, Entities, Entity, EntityProto, ValueProto} from './entity'; -import Key = entity.Key; -export {Entity, Key}; - -import { - GetIndexesCallback, - GetIndexesOptions, - GetIndexesResponse, - IIndex, - Index, -} from './index-class'; -import {Query} from './query'; -import { - DatastoreRequest, - CommitCallback, - CommitResponse, - PrepareEntityObjectResponse, - SaveCallback, - SaveResponse, - Mutation, - RequestOptions, -} from './request'; -import {Transaction} from './transaction'; -import {promisifyAll} from '@google-cloud/promisify'; -import {google} from '../protos/protos'; - -const {grpc} = new GrpcClient(); - -export type PathType = string | number | entity.Int; -export interface BooleanObject { - [key: string]: boolean; -} -export interface EntityProtoReduceAccumulator { - [key: string]: ValueProto; -} -export interface EntityProtoReduceData { - value: ValueProto; - excludeFromIndexes: ValueProto; - name: string | number; -} -export type UpdateCallback = CommitCallback; -export type UpdateResponse = CommitResponse; -export type UpsertCallback = CommitCallback; -export type UpsertResponse = CommitResponse; -export type InsertCallback = CommitCallback; -export type InsertResponse = CommitResponse; - -export interface LongRunningCallback { - ( - err: ServiceError | null, - operation?: Operation, - apiResponse?: google.longrunning.IOperation - ): void; -} -export type LongRunningResponse = [Operation, google.longrunning.IOperation]; - -export interface ExportEntitiesConfig - extends Omit { - bucket?: string | {name: string}; - kinds?: string[]; - namespaces?: string[]; - gaxOptions?: CallOptions; -} - -export interface ImportEntitiesConfig - extends Omit { - file?: string | {bucket: {name: string}; name: string}; - kinds?: string[]; - namespaces?: string[]; - gaxOptions?: CallOptions; -} - -// Import the clients for each version supported by this package. -const gapic = Object.freeze({ - v1: require('./v1'), -}); - -const urlSafeKey = new entity.URLSafeKey(); - -/** - * Idiomatic class for interacting with Cloud Datastore. Uses the lower-level - * {@link DatastoreClient} class under the hood. - * - * In addition to the constructor options shown here, the {@link Datastore} - * class constructor accepts the same options accepted by - * {@link DatastoreClient}. - * - *

The Datastore Emulator

- * - * Make sure you have the - * gcloud SDK installed, then run: - * - *
- *   $ gcloud beta emulators datastore start --no-legacy
- * 
- * - * You will see the following printed: - * - *
- *   [datastore] API endpoint: http://localhost:8005
- *   [datastore] If you are using a library that supports the
- *               DATASTORE_EMULATOR_HOST environment variable, run:
- *   [datastore]
- *   [datastore]   export DATASTORE_EMULATOR_HOST=localhost:8005
- *   [datastore]
- *   [datastore] Dev App Server is now running.
- * 
- * - * Set that environment variable and your localhost Datastore will - * automatically be used. You can also pass this address in manually with - * `apiEndpoint`. - * - * Additionally, `DATASTORE_PROJECT_ID` is recognized. If you have this set, - * you don't need to provide a `projectId`. - * - * - * See {@link https://cloud.google.com/datastore/docs/concepts/overview| Cloud Datastore Concepts Overview} - * - * @param {object} [options] Configuration options. - * @param {string} [options.apiEndpoint] Override the default API endpoint used - * to reach Datastore. This is useful for connecting to your local Datastore - * server (usually "http://localhost:8080"). - * @param {string} [options.namespace] Namespace to isolate transactions to. - * - * @example Import the client library - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * - * ``` - * @example Create a client that uses Application Default Credentials (ADC): - * ``` - * const datastore = new Datastore(); - * - * ``` - * @example Create a client with explicit credentials: - * ``` - * const datastore = new Datastore({ - * projectId: 'your-project-id', - * keyFilename: '/path/to/keyfile.json' - * }); - * - * ``` - * @example Retrieving Records - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * - * // Records, called "entities" in Datastore, are retrieved by using a key. The - * // key is more than a numeric identifier, it is a complex data structure that - * // can be used to model relationships. The simplest key has a string `kind` - * // value, and either a numeric `id` value, or a string `name` value. - * // - * // A single record can be retrieved with {@link Datastore#key} and - * // {@link Datastore#get}. - * //- - * const key = datastore.key(['Company', 'Google']); - * - * datastore.get(key, function(err, entity) { - * // entity = The record. - * // entity[datastore.KEY] = The key for this entity. - * }); - * - * //- - * //

Querying Records

- * // - * // Create a query with {@link Datastore#createQuery}. - * //- - * const query = datastore.createQuery('Company'); - * - * //- - * // Multiple records can be found that match criteria with - * // {@link Query#filter}. - * //- - * query.filter('location', 'CA'); - * - * //- - * // Records can also be ordered with {@link Query#order}. - * //- - * query.order('name'); - * - * //- - * // The number of records returned can be specified with - * // {@link Query#limit}. - * //- - * query.limit(5); - * - * //- - * // Records' key structures can also be queried with - * // {@link Query#hasAncestor}. - * //- - * const ancestorKey = datastore.key(['ParentCompany', 'Alphabet']); - * - * query.hasAncestor(ancestorKey); - * - * //- - * // Run the query with {@link Datastore#runQuery}. - * //- - * datastore.runQuery(query, (err, entities) => { - * // entities = An array of records. - * - * // Access the Key object for an entity. - * const firstEntityKey = entities[0][datastore.KEY]; - * }); - * - * ``` - * @example Paginating Records - * ``` - * // Imagine building a website that allows a user to sift through hundreds of - * // their contacts. You'll likely want to only display a subset of these at - * // once, so you set a limit. - * //- - * const express = require('express'); - * const app = express(); - * - * const NUM_RESULTS_PER_PAGE = 15; - * - * app.get('/contacts', (req, res) => { - * const query = datastore.createQuery('Contacts') - * .limit(NUM_RESULTS_PER_PAGE); - * - * if (req.query.nextPageCursor) { - * query.start(req.query.nextPageCursor); - * } - * - * datastore.runQuery(query, (err, entities, info) => { - * if (err) { - * // Error handling omitted. - * return; - * } - * - * // Respond to the front end with the contacts and the cursoring token - * // from the query we just ran. - * const frontEndResponse = { - * contacts: entities - * }; - * - * // Check if more results may exist. - * if (info.moreResults !== datastore.NO_MORE_RESULTS) { - * frontEndResponse.nextPageCursor = info.endCursor; - * } - * - * res.render('contacts', frontEndResponse); - * }); - * }); - * - * ``` - * @example Creating Records - * ``` - * // New entities can be created and persisted with {@link Datastore#save}. - * // The entitiy must have a key to be saved. If you don't specify an - * // identifier for the key, one is generated for you. - * // - * // We will create a key with a `name` identifier, "Google". - * //- - * const key = datastore.key(['Company', 'Google']); - * - * const data = { - * name: 'Google', - * location: 'CA' - * }; - * - * datastore.save({ - * key: key, - * data: data - * }, (err) => { - * if (!err) { - * // Record saved successfully. - * } - * }); - * - * //- - * // We can verify the data was saved by using {@link Datastore#get}. - * //- - * datastore.get(key, (err, entity) => { - * // entity = { - * // name: 'Google', - * // location: 'CA' - * // } - * }); - * - * //- - * // If we want to update this record, we can modify the data object and re- - * // save it. - * //- - * data.symbol = 'GOOG'; - * - * datastore.save({ - * key: key, // defined above (datastore.key(['Company', 'Google'])) - * data: data - * }, (err, entity) => { - * if (!err) { - * // Record updated successfully. - * } - * }); - * - * ``` - * @example Deleting Records - * ``` - * // Entities can be removed from Datastore by passing the entity's key object - * // to {@link Datastore#delete}. - * //- - * const key = datastore.key(['Company', 'Google']); - * - * datastore.delete(key, (err) => { - * if (!err) { - * // Record deleted successfully. - * } - * }); - * - * ``` - * @example Transactions - * ``` - * // Complex logic can be wrapped in a transaction with - * // {@link Datastore#transaction}. All queries and updates run within - * // the transaction will be applied when the `done` function is called. - * //- - * const transaction = datastore.transaction(); - * - * transaction.run((err) => { - * if (err) { - * // Error handling omitted. - * } - * - * const key = datastore.key(['Company', 'Google']); - * - * transaction.get(key, (err, entity) => { - * if (err) { - * // Error handling omitted. - * } - * - * entity.symbol = 'GOOG'; - * - * transaction.save(entity); - * - * transaction.commit((err) => { - * if (!err) { - * // Transaction committed successfully. - * } - * }); - * }); - * }); - * - * ``` - * @example Queries with Ancestors - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * - * const customerId1 = 2993844; - * const customerId2 = 4993882; - * const customerKey1 = datastore.key(['Customer', customerId1]); - * const customerKey2 = datastore.key(['Customer', customerId2]); - * const cookieKey1 = datastore.key(['Customer', customerId1, 'Cookie', - * 'cookie28839']); // child entity const cookieKey2 = - * datastore.key(['Customer', customerId1, 'Cookie', 'cookie78984']); // child - * entity const cookieKey3 = datastore.key(['Customer', customerId2, 'Cookie', - * 'cookie93911']); // child entity - * - * const entities = []; - * - * entities.push({ - * key: customerKey1, - * data: { - * name: 'Jane Doe', - * address: '4848 Liller' - * } - * }); - * - * entities.push({ - * key: customerKey2, - * data: { - * name: 'John Smith', - * address: '4848 Pine' - * } - * }); - * - * entities.push({ - * key: cookieKey1, - * data: { - * cookieVal: 'dj83kks88rkld' - * } - * }); - * - * entities.push({ - * key: cookieKey2, - * data: { - * cookieVal: 'sj843ka99s' - * } - * }); - * - * entities.push({ - * key: cookieKey3, - * data: { - * cookieVal: 'otk82k2kw' - * } - * }); - * - * datastore.upsert(entities); - * - * const query = datastore.createQuery().hasAncestor(customerKey1); - * - * datastore.runQuery(query, (err, entities) => { - * for (let entity of entities) { - * console.log(entity[datastore.KEY]); - * } - * }); - * - * const query2 = datastore.createQuery().hasAncestor(customerKey2); - * - * datastore.runQuery(query2, (err, entities) => { - * for (let entity of entities) { - * console.log(entity[datastore.KEY]); - * } - * }); - * - * datastore.runQuery(query2, (entities) => { - * console.log(entities); - * }); - * ``` - */ -class Datastore extends DatastoreRequest { - clients_: Map; - namespace?: string; - defaultBaseUrl_: string; - options: DatastoreOptions; - baseUrl_?: string; - port_?: number; - customEndpoint_?: boolean; - auth: GoogleAuth; - constructor(options?: DatastoreOptions) { - super(); - options = options || {}; - this.clients_ = new Map(); - this.datastore = this; - - /** - * @name Datastore#namespace - * @type {string} - */ - this.namespace = options.namespace; - - options.projectId = options.projectId || process.env.DATASTORE_PROJECT_ID; - - this.defaultBaseUrl_ = 'datastore.googleapis.com'; - this.determineBaseUrl_(options.apiEndpoint); - - const scopes: string[] = Array.from( - new Set([ - ...gapic.v1.DatastoreClient.scopes, - ...gapic.v1.DatastoreAdminClient.scopes, - ]) - ); - - this.options = Object.assign( - { - libName: 'gccl', - libVersion: require('../../package.json').version, - scopes, - servicePath: this.baseUrl_, - port: typeof this.port_ === 'number' ? this.port_ : 443, - }, - options - ); - if (this.customEndpoint_) { - this.options.sslCreds = grpc.credentials.createInsecure(); - } - - this.auth = new GoogleAuth(this.options); - } - - /** - * Export entities from this project to a Google Cloud Storage bucket. - * - * @param {ExportEntitiesConfig} config Configuration object. - * @param {string | Bucket} config.bucket The `gs://bucket` path or a - * @google-cloud/storage Bucket object. - * @param {string[]} [config.kinds] The kinds to include in this import. - * @param {string[]} [config.namespaces] The namespace IDs to include in this - * import. - * @param {object} [config.gaxOptions] Request configuration options, outlined - * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. - * @param {function} callback The callback function. - * @param {?error} callback.err An error returned while making this request. - * @param {Operation} callback.operation An operation object that can be used - * to check the status of the request. - */ - export(config: ExportEntitiesConfig): Promise; - export(config: ExportEntitiesConfig, callback: LongRunningCallback): void; - export( - config: ExportEntitiesConfig, - callback?: LongRunningCallback - ): void | Promise { - const reqOpts: ExportEntitiesConfig = { - entityFilter: {}, - ...config, - }; - - if (reqOpts.bucket && reqOpts.outputUrlPrefix) { - throw new Error('Both `bucket` and `outputUrlPrefix` were provided.'); - } - - if (!reqOpts.outputUrlPrefix) { - if (typeof config.bucket === 'string') { - reqOpts.outputUrlPrefix = `gs://${config.bucket.replace('gs://', '')}`; - } else if (typeof config.bucket === 'object') { - reqOpts.outputUrlPrefix = `gs://${config.bucket.name}`; - } else { - throw new Error('A Bucket object or URL must be provided.'); - } - } - - if (reqOpts.kinds) { - if (typeof config.entityFilter === 'object') { - throw new Error('Both `entityFilter` and `kinds` were provided.'); - } - reqOpts.entityFilter!.kinds = reqOpts.kinds; - } - - if (reqOpts.namespaces) { - if (typeof config.entityFilter === 'object') { - throw new Error('Both `entityFilter` and `namespaces` were provided.'); - } - reqOpts.entityFilter!.namespaceIds = reqOpts.namespaces; - } - - delete reqOpts.bucket; - delete reqOpts.gaxOptions; - delete reqOpts.kinds; - delete reqOpts.namespaces; - - this.request_( - { - client: 'DatastoreAdminClient', - method: 'exportEntities', - reqOpts: reqOpts as RequestOptions, - gaxOpts: config.gaxOptions, - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - callback as any - ); - } - - /** - * Get all of the indexes in this project. - * - * @param {GetIndexesOptions | GetIndexesCallback} [optionsOrCallback] - * @param {object} [options.gaxOptions] Request configuration options, - * outlined here: - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. - * @param {GetIndexesResponse} [callback] The callback function. - * @param {?error} callback.error An error returned while making this request. - * @param {Index[]} callback.indexes All matching Index instances. - * @param {object} callback.apiResponse The full API response. - * @return {void | Promise} - */ - getIndexes(options?: GetIndexesOptions): Promise; - getIndexes(options: GetIndexesOptions, callback: GetIndexesCallback): void; - getIndexes(callback: GetIndexesCallback): void; - getIndexes( - optionsOrCallback?: GetIndexesOptions | GetIndexesCallback, - cb?: GetIndexesCallback - ): void | Promise { - let options = - typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; - const callback = - typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; - - options = extend(true, {}, options); - - const gaxOpts = options.gaxOptions || {}; - - const reqOpts = { - pageSize: (gaxOpts as GetIndexesOptions).pageSize, - pageToken: (gaxOpts as GetIndexesOptions).pageToken, - ...options, - }; - - delete (gaxOpts as GetIndexesOptions).pageSize; - delete (gaxOpts as GetIndexesOptions).pageToken; - delete (reqOpts as CallOptions).autoPaginate; - delete (reqOpts as GetIndexesOptions).gaxOptions; - - if ( - typeof options.autoPaginate === 'boolean' && - typeof gaxOpts.autoPaginate === 'undefined' - ) { - gaxOpts.autoPaginate = options.autoPaginate; - } - - this.request_( - { - client: 'DatastoreAdminClient', - method: 'listIndexes', - reqOpts, - gaxOpts, - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (err, ...resp: any[]) => { - let indexes: Index[] = []; - - if (resp[0]) { - indexes = resp[0].map((index: IIndex) => { - const indexInstance = this.index(index.indexId!); - indexInstance.metadata = index; - return indexInstance; - }); - } - - const nextQuery = resp[1]! ? Object.assign(options, resp[1]) : null; - const apiResp: google.datastore.admin.v1.IListIndexesResponse = resp[2]; - - callback(err as ServiceError, indexes, nextQuery, apiResp); - } - ); - } - - /** - * Get all of the indexes in this project as a readable object stream. - * - * @param {GetIndexesOptions} [options] Configuration object. See - * {@link Datastore#getIndexes} for a complete list of options. - * @returns {ReadableStream} - */ - getIndexesStream(options?: GetIndexesOptions): NodeJS.ReadableStream { - const {gaxOptions, ...reqOpts} = options || {}; - return pipeline( - this.requestStream_({ - client: 'DatastoreAdminClient', - method: 'listIndexesStream', - reqOpts, - gaxOpts: gaxOptions, - }), - new Transform({ - objectMode: true, - transform: (index: IIndex, enc: string, next: Function) => { - const indexInstance = this.index(index.indexId!); - indexInstance.metadata = index; - next(null, indexInstance); - }, - }), - () => {} - ); - } - - getProjectId(): Promise { - return this.auth.getProjectId(); - } - - /** - * Import entities into this project from a remote file. - * - * @param {ImportEntitiesConfig} config Configuration object. - * @param {string | File} config.file The `gs://bucket/file` path or a - * @google-cloud/storage File object. - * @param {string[]} [config.kinds] The kinds to include in this import. - * @param {string[]} [config.namespaces] The namespace IDs to include in this - * import. - * @param {object} [config.gaxOptions] Request configuration options, outlined - * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. - * @param {function} callback The callback function. - * @param {?error} callback.err An error returned while making this request. - * @param {Operation} callback.operation An operation object that can be used - * to check the status of the request. - */ - import(config: ImportEntitiesConfig): Promise; - import(config: ImportEntitiesConfig, callback: LongRunningCallback): void; - import( - config: ImportEntitiesConfig, - callback?: LongRunningCallback - ): void | Promise { - const reqOpts: ImportEntitiesConfig = { - entityFilter: {}, - ...config, - }; - - if (config.file && config.inputUrl) { - throw new Error('Both `file` and `inputUrl` were provided.'); - } - - if (!reqOpts.inputUrl) { - if (typeof config.file === 'string') { - reqOpts.inputUrl = `gs://${config.file.replace('gs://', '')}`; - } else if (typeof config.file === 'object') { - reqOpts.inputUrl = `gs://${config.file.bucket.name}/${config.file.name}`; - } else { - throw new Error('An input URL must be provided.'); - } - } - - if (reqOpts.kinds) { - if (typeof config.entityFilter === 'object') { - throw new Error('Both `entityFilter` and `kinds` were provided.'); - } - reqOpts.entityFilter!.kinds = reqOpts.kinds; - } - - if (reqOpts.namespaces) { - if (typeof config.entityFilter === 'object') { - throw new Error('Both `entityFilter` and `namespaces` were provided.'); - } - reqOpts.entityFilter!.namespaceIds = reqOpts.namespaces; - } - - delete reqOpts.file; - delete reqOpts.gaxOptions; - delete reqOpts.kinds; - delete reqOpts.namespaces; - - this.request_( - { - client: 'DatastoreAdminClient', - method: 'importEntities', - reqOpts: reqOpts as RequestOptions, - gaxOpts: config.gaxOptions, - }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - callback as any - ); - } - - /** - * Get a reference to an Index. - * - * @param {string} id The index name or id. - * @returns {Index} - */ - index(id: string): Index { - return new Index(this, id); - } - - /** - * Maps to {@link Datastore#save}, forcing the method to be `insert`. - * - * @param {object|object[]} entities Datastore key object(s). - * @param {Key} entities.key Datastore key object. - * @param {string[]} [entities.excludeFromIndexes] Exclude properties from - * indexing using a simple JSON path notation. See the examples in - * {@link Datastore#save} to see how to target properties at different - * levels of nesting within your entity. - * @param {object} entities.data Data to save with the provided key. - * @param {function} callback The callback function. - * @param {?error} callback.err An error returned while making this request - * @param {object} callback.apiResponse The full API response. - */ - insert(entities: Entities): Promise; - insert(entities: Entities, callback: InsertCallback): void; - insert( - entities: Entities, - callback?: InsertCallback - ): void | Promise { - entities = arrify(entities) - .map(DatastoreRequest.prepareEntityObject_) - .map((x: PrepareEntityObjectResponse) => { - x.method = 'insert'; - return x; - }); - - this.save(entities, callback!); - } - - /** - * Insert or update the specified object(s). If a key is incomplete, its - * associated object is inserted and the original Key object is updated to - * contain the generated ID. - * - * This method will determine the correct Datastore method to execute - * (`upsert`, `insert`, or `update`) by using the key(s) provided. For - * example, if you provide an incomplete key (one without an ID), the request - * will create a new entity and have its ID automatically assigned. If you - * provide a complete key, the entity will be updated with the data specified. - * - * By default, all properties are indexed. To prevent a property from being - * included in *all* indexes, you must supply an `excludeFromIndexes` array. - * - * To prevent large properties from being included in *all* indexes, you must supply - * `excludeLargeProperties: true`. - * See below for an example. - * - * @borrows {@link Transaction#save} as save - * - * @throws {Error} If an unrecognized method is provided. - * - * @param {object|object[]} entities Datastore key object(s). - * @param {Key} entities.key Datastore key object. - * @param {string[]} [entities.excludeFromIndexes] Exclude properties from - * indexing using a simple JSON path notation. See the example below to - * see how to target properties at different levels of nesting within your - * @param {boolean} [entities.excludeLargeProperties] Automatically exclude - * large properties from indexing. It help in storing large values. - * @param {string} [entities.method] Explicit method to use, either 'insert', - * 'update', or 'upsert'. - * @param {object} entities.data Data to save with the provided key. - * entity. - * @param {object} [gaxOptions] Request configuration options, outlined here: - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. - * @param {function} callback The callback function. - * @param {?error} callback.err An error returned while making this request - * @param {object} callback.apiResponse The full API response. - * - * @example - * ``` - * //- - * // Save a single entity. - * // - * // Notice that we are providing an incomplete key. After saving, the - * // original Key object used to save will be updated to contain the path - * // with its generated ID. - * //- - * const key = datastore.key('Company'); - * const entity = { - * key: key, - * data: { - * rating: '10' - * } - * }; - * - * datastore.save(entity, (err) => { - * console.log(key.path); // [ 'Company', 5669468231434240 ] - * console.log(key.namespace); // undefined - * }); - * - * //- - * // Save a single entity using a provided name instead of auto-generated ID. - * // - * // Here we are providing a key with name instead of an ID. After saving, - * // the original Key object used to save will be updated to contain the - * // path with the name instead of a generated ID. - * //- - * const key = datastore.key(['Company', 'donutshack']); - * const entity = { - * key: key, - * data: { - * name: 'DonutShack', - * rating: 8 - * } - * }; - * - * datastore.save(entity, (err) => { - * console.log(key.path); // ['Company', 'donutshack'] - * console.log(key.namespace); // undefined - * }); - * - * //- - * // Save a single entity with a provided namespace. Namespaces allow for - * // multitenancy. To read more about this, see - * // [the Datastore docs on key concepts](https://goo.gl/M1LUAu). - * // - * // Here we are providing a key with namespace. - * //- - * const key = datastore.key({ - * namespace: 'my-namespace', - * path: ['Company', 'donutshack'] - * }); - * - * const entity = { - * key: key, - * data: { - * name: 'DonutShack', - * rating: 8 - * } - * }; - * - * datastore.save(entity, (err) => { - * console.log(key.path); // ['Company', 'donutshack'] - * console.log(key.namespace); // 'my-namespace' - * }); - * - * //- - * // Save different types of data, including ints, doubles, dates, booleans, - * // blobs, and lists. - * // - * // Notice that we are providing an incomplete key. After saving, the - * // original Key object used to save will be updated to contain the path - * // with its generated ID. - * //- - * const key = datastore.key('Company'); - * const entity = { - * key: key, - * data: { - * name: 'DonutShack', - * rating: datastore.int(10), - * worth: datastore.double(123456.78), - * location: datastore.geoPoint({ - * latitude: 40.6894, - * longitude: -74.0447 - * }), - * numDonutsServed: 45, - * founded: new Date('Tue May 12 2015 15:30:00 GMT-0400 (EDT)'), - * isStartup: true, - * donutEmoji: Buffer.from('\uD83C\uDF69'), - * keywords: [ - * 'donut', - * 'coffee', - * 'yum' - * ] - * } - * }; - * - * datastore.save(entity, (err, apiResponse) => {}); - * - * //- - * // Use an array, `excludeFromIndexes`, to exclude properties from indexing. - * // This will allow storing string values larger than 1500 bytes. - * //- - * const entity = { - * key: datastore.key('Company'), - * excludeFromIndexes: [ - * 'description', - * 'embeddedEntity.description', - * 'arrayValue[]', - * 'arrayValue[].description' - * ], - * data: { - * description: 'Long string (...)', - * embeddedEntity: { - * description: 'Long string (...)' - * }, - * arrayValue: [ - * 'Long string (...)', - * { - * description: 'Long string (...)' - * } - * ] - * } - * }; - * - * datastore.save(entity, (err, apiResponse) => {}); - * - * //- - * // Use boolean `excludeLargeProperties`, to auto exclude Large properties from indexing. - * // This will allow storing string values larger than 1500 bytes. - * //- - * const entity = { - * key: datastore.key('Company'), - * data: { - * description: 'Long string (...)', - * embeddedEntity: { - * description: 'Long string (...)' - * }, - * arrayValue: [ - * 'Long string (...)', - * { - * description: 'Long string (...)' - * } - * ] - * }, - * excludeLargeProperties: true - * }; - * - * datastore.save(entity, (err, apiResponse) => {}); - * - * //- - * // Save multiple entities at once. - * //- - * const companyKey = datastore.key(['Company', 123]); - * const productKey = datastore.key(['Product', 'Computer']); - * const entities = [ - * { - * key: companyKey, - * data: { - * HQ: 'Dallas, TX' - * } - * }, - * { - * key: productKey, - * data: { - * vendor: 'Dell' - * } - * } - * ]; - * - * datastore.save(entities, (err, apiResponse) => {}); - * - * //- - * // Explicitly attempt to 'insert' a specific entity. - * //- - * const userKey = datastore.key(['User', 'chilts']); - * const entity = { - * key: userKey, - * method: 'insert', - * data: { - * fullName: 'Andrew Chilton' - * } - * }; - * - * datastore.save(entity, (err, apiResponse) => {}); - * - * //- - * // Returns a Promise if callback is omitted. - * //- - * datastore.save(entity).then((data) => { - * const apiResponse = data[0]; - * }); - * ``` - */ - save(entities: Entities, gaxOptions?: CallOptions): Promise; - save( - entities: Entities, - gaxOptions: CallOptions, - callback: SaveCallback - ): void; - save(entities: Entities, callback: SaveCallback): void; - save( - entities: Entities, - gaxOptionsOrCallback?: CallOptions | SaveCallback, - cb?: SaveCallback - ): void | Promise { - entities = arrify(entities); - const gaxOptions = - typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; - const callback = - typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; - - const insertIndexes: BooleanObject = {}; - const mutations: google.datastore.v1.IMutation[] = []; - const methods: BooleanObject = { - insert: true, - update: true, - upsert: true, - }; - - // Iterate over the entity objects, build a proto from all keys and values, - // then place in the correct mutation array (insert, update, etc). - entities - .map(DatastoreRequest.prepareEntityObject_) - .forEach((entityObject: Entity, index: number) => { - const mutation: Mutation = {}; - let entityProto: EntityProto = {}; - let method = 'upsert'; - - if (entityObject.method) { - if (methods[entityObject.method]) { - method = entityObject.method; - } else { - throw new Error( - 'Method ' + entityObject.method + ' not recognized.' - ); - } - } - - if (entityObject.excludeLargeProperties) { - entityObject.excludeFromIndexes = entity.findLargeProperties_( - entityObject.data, - '', - entityObject.excludeFromIndexes - ); - } - - if (!entity.isKeyComplete(entityObject.key)) { - insertIndexes[index] = true; - } - - // @TODO remove in @google-cloud/datastore@2.0.0 - // This was replaced with a more efficient mechanism in the top-level - // `excludeFromIndexes` option. - if (Array.isArray(entityObject.data)) { - entityProto.properties = entityObject.data.reduce( - ( - acc: EntityProtoReduceAccumulator, - data: EntityProtoReduceData - ) => { - const value = entity.encodeValue( - data.value, - data.name.toString() - ); - - if (typeof data.excludeFromIndexes === 'boolean') { - const excluded = data.excludeFromIndexes; - let values = value.arrayValue && value.arrayValue.values; - - if (values) { - values = values.map((x: ValueProto) => { - x.excludeFromIndexes = excluded; - return x; - }); - } else { - value.excludeFromIndexes = data.excludeFromIndexes; - } - } - - acc[data.name] = value; - - return acc; - }, - {} - ); - } else { - entityProto = entity.entityToEntityProto(entityObject); - } - - entityProto.key = entity.keyToKeyProto(entityObject.key); - - mutation[method] = entityProto; - mutations.push(mutation); - }); - - const reqOpts = { - mutations, - }; - - function onCommit( - err?: Error | null, - resp?: google.datastore.v1.ICommitResponse - ) { - if (err || !resp) { - callback(err, resp); - return; - } - - arrify(resp.mutationResults).forEach((result, index) => { - if (!result.key) { - return; - } - if (insertIndexes[index]) { - const id = entity.keyFromKeyProto(result.key).id; - entities[index].key.id = id; - } - }); - - callback(null, resp); - } - - if (this.id) { - this.requests_.push(reqOpts); - this.requestCallbacks_.push(onCommit); - return; - } - - this.request_( - { - client: 'DatastoreClient', - method: 'commit', - reqOpts, - gaxOpts: gaxOptions, - }, - onCommit - ); - } - - /** - * Maps to {@link Datastore#save}, forcing the method to be `update`. - * - * @param {object|object[]} entities Datastore key object(s). - * @param {Key} entities.key Datastore key object. - * @param {string[]} [entities.excludeFromIndexes] Exclude properties from - * indexing using a simple JSON path notation. See the examples in - * {@link Datastore#save} to see how to target properties at different - * levels of nesting within your entity. - * @param {object} entities.data Data to save with the provided key. - * @param {function} callback The callback function. - * @param {?error} callback.err An error returned while making this request - * @param {object} callback.apiResponse The full API response. - */ - update(entities: Entities): Promise; - update(entities: Entities, callback: UpdateCallback): void; - update( - entities: Entities, - callback?: UpdateCallback - ): void | Promise { - entities = arrify(entities) - .map(DatastoreRequest.prepareEntityObject_) - .map((x: PrepareEntityObjectResponse) => { - x.method = 'update'; - return x; - }); - - this.save(entities, callback!); - } - - /** - * Maps to {@link Datastore#save}, forcing the method to be `upsert`. - * - * @param {object|object[]} entities Datastore key object(s). - * @param {Key} entities.key Datastore key object. - * @param {string[]} [entities.excludeFromIndexes] Exclude properties from - * indexing using a simple JSON path notation. See the examples in - * {@link Datastore#save} to see how to target properties at different - * levels of nesting within your entity. - * @param {object} entities.data Data to save with the provided key. - * @param {function} callback The callback function. - * @param {?error} callback.err An error returned while making this request - * @param {object} callback.apiResponse The full API response. - */ - upsert(entities: Entities): Promise; - upsert(entities: Entities, callback: UpsertCallback): void; - upsert( - entities: Entities, - callback?: UpsertCallback - ): void | Promise { - entities = arrify(entities) - .map(DatastoreRequest.prepareEntityObject_) - .map((x: PrepareEntityObjectResponse) => { - x.method = 'upsert'; - return x; - }); - - this.save(entities, callback!); - } - - /** - * Helper function to get a Datastore Double object. - * - * @param {number} value The double value. - * @returns {object} - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const threeDouble = datastore.double(3.0); - * ``` - */ - static double(value: number) { - return new entity.Double(value); - } - - double(value: number) { - return Datastore.double(value); - } - - /** - * Helper function to check if something is a Datastore Double object. - * - * @param {*} value - * @returns {boolean} - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * datastore.isDouble(0.42); // false - * datastore.isDouble(datastore.double(0.42)); // true - * ``` - */ - static isDouble(value?: {}) { - return entity.isDsDouble(value); - } - - isDouble(value?: {}) { - return Datastore.isDouble(value); - } - - /** - * Helper function to get a Datastore Geo Point object. - * - * @param {object} coordinates Coordinate value. - * @param {number} coordinates.latitude Latitudinal value. - * @param {number} coordinates.longitude Longitudinal value. - * @returns {object} - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const coordinates = { - * latitude: 40.6894, - * longitude: -74.0447 - * }; - * - * const geoPoint = datastore.geoPoint(coordinates); - * - * //- - * // List all companies that are located at 40.123 latitude - * // and -74.0447 longitude. - * //- - * const query = datastore.createQuery('Company'); - * const companyQuery = query - * .filter('geoPoint.latitude', datastore.double(40.123)) - * .filter('geoPoint.longitude', datastore.double(-74.0447)); - * ``` - */ - static geoPoint(coordinates: entity.Coordinates) { - return new entity.GeoPoint(coordinates); - } - - geoPoint(coordinates: entity.Coordinates) { - return Datastore.geoPoint(coordinates); - } - - /** - * Helper function to check if something is a Datastore Geo Point object. - * - * @param {*} value - * @returns {boolean} - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const coordinates = { - * latitude: 0, - * longitude: 0 - * }; - * - * datastore.isGeoPoint(coordinates); // false - * datastore.isGeoPoint(datastore.geoPoint(coordinates)); // true - * ``` - */ - static isGeoPoint(value?: {}) { - return entity.isDsGeoPoint(value); - } - - isGeoPoint(value?: {}) { - return Datastore.isGeoPoint(value); - } - - /** - * Helper function to get a Datastore Integer object. - * - * This is also useful when using an ID outside the bounds of a JavaScript - * Number object. - * - * @param {number} value The integer value. - * @returns {object} - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const sevenInteger = datastore.int(7); - * - * //- - * // Create an Int to support long Key IDs. - * //- - * const key = datastore.key([ - * 'Kind', - * datastore.int('100000000000001234') - * ]); - * ``` - */ - static int(value: number | string) { - return new entity.Int(value); - } - - int(value: number | string) { - return Datastore.int(value); - } - - /** - * Helper function to check if something is a Datastore Integer object. - * - * @param {*} value - * @returns {boolean} - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * datastore.isInt(42); // false - * datastore.isInt(datastore.int(42)); // true - * ``` - */ - static isInt(value?: {}) { - return entity.isDsInt(value); - } - - isInt(value?: {}) { - return Datastore.isInt(value); - } - - /** - * Access the Key from an Entity object. - * - * @name Datastore.KEY - * @type {symbol} - */ - /** - * Access the Key from an Entity object. - * - * @name Datastore#KEY - * @type {symbol} - */ - static KEY: typeof entity.KEY_SYMBOL = entity.KEY_SYMBOL; - KEY: typeof entity.KEY_SYMBOL = Datastore.KEY; - - /** - * This is one of three values which may be returned from - * {@link Datastore#runQuery}, {@link Transaction#runQuery}, and - * {@link Query#run} as `info.moreResults`. - * - * There *may* be more results after the specified end cursor. - * - * @type {string} - */ - static MORE_RESULTS_AFTER_CURSOR = 'MORE_RESULTS_AFTER_CURSOR'; - MORE_RESULTS_AFTER_CURSOR = Datastore.MORE_RESULTS_AFTER_CURSOR; - - /** - * This is one of three values which may be returned from - * {@link Datastore#runQuery}, {@link Transaction#runQuery}, and - * {@link Query#run} as `info.moreResults`. - * - * There *may* be more results after the specified limit. - * - * @type {string} - */ - static MORE_RESULTS_AFTER_LIMIT = 'MORE_RESULTS_AFTER_LIMIT'; - MORE_RESULTS_AFTER_LIMIT = Datastore.MORE_RESULTS_AFTER_LIMIT; - - /** - * This is one of three values which may be returned from - * {@link Datastore#runQuery}, {@link Transaction#runQuery}, and - * {@link Query#run} as `info.moreResults`. - * - * There are no more results left to query for. - * - * @type {string} - */ - static NO_MORE_RESULTS = 'NO_MORE_RESULTS'; - NO_MORE_RESULTS = Datastore.NO_MORE_RESULTS; - - /** - * Create a query for the specified kind. See {@link Query} for all - * of the available methods. - * - * @see {@link https://cloud.google.com/datastore/docs/concepts/queries| Datastore Queries} - * @see {@link Query} - * - * @param {string} [namespace] Namespace. - * @param {string} kind The kind to query. - * @returns {Query} - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const query = datastore.createQuery('Company'); - * ``` - */ - createQuery(kind?: string): Query; - createQuery(kind?: string[]): Query; - createQuery(namespace: string, kind: string): Query; - createQuery(namespace: string, kind: string[]): Query; - createQuery( - namespaceOrKind?: string | string[], - kind?: string | string[] - ): Query { - let namespace = namespaceOrKind as string; - if (!kind) { - kind = namespaceOrKind; - namespace = this.namespace!; - } - return new Query(this, namespace, arrify(kind) as string[]); - } - - /** - * Helper to create a Key object, scoped to the instance's namespace by - * default. - * - * You may also specify a configuration object to define a namespace and path. - * - * @param {object|string|array} [options] Key path. To specify or override a namespace, - * you must use an object here to explicitly state it. - * @param {string|array} [options.path] Key path. - * @param {string} [options.namespace] Optional namespace. - * @returns {Key} A newly created Key from the options given. - * - * @example - * ``` - * Create an incomplete key with a kind value of `Company`. - * Since no Id is supplied, Datastore will generate one on save. - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const key = datastore.key('Company'); - * - * ``` - * @example - * ``` - * Create a complete key with a kind value of `Company` and Id `123`. - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const key = datastore.key(['Company', 123]); - * - * ``` - * @example - * ``` - * If the ID integer is outside the bounds of a JavaScript Number - * object, create an Int. - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const key = datastore.key([ - * 'Company', - * datastore.int('100000000000001234') - * ]); - * - * ``` - * @example - * ``` - * Create a complete key with a kind value of `Company` and name `Google`. - * Because the supplied Id is a string, Datastore will prefix it with "name=". - * Had the supplied Id been numeric, Datastore would prefix it with the standard, "id=". - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const key = datastore.key(['Company', 'Google']); - * - * ``` - * @example - * ``` - * Create a complete key from a provided namespace and path. - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const key = datastore.key({ - * namespace: 'My-NS', - * path: ['Company', 123] - * }); - * - * ``` - * @example - * ``` - * Create a complete key that specifies an ancestor. This will create a Team entity - * with a name of "Datastore", which belongs to the Company with the "name=Google" key. - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const key = datastore.key(['Company', 'Google', 'Team', 'Datastore']); - * - * ``` - * @example - * ``` - * Create a incomplete key that specifies an ancestor. This will create an Employee entity - * with an auto-generated Id, which belongs to the Company with the "name=Google" key. - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const key = datastore.key(['Company', 'Google', 'Employee']); - * ``` - */ - key(options: entity.KeyOptions): entity.Key; - key(path: PathType[]): entity.Key; - key(path: string): entity.Key; - key(options: string | entity.KeyOptions | PathType[]): entity.Key { - const keyOptions = is.object(options) - ? (options as entity.KeyOptions) - : { - namespace: this.namespace, - path: arrify(options) as PathType[], - }; - return new entity.Key(keyOptions); - } - - /** - * Helper function to check if something is a Datastore Key object. - * - * @param {*} value - * @returns {boolean} - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * datastore.isKey({path: ['Company', 123]}); // false - * datastore.isKey(datastore.key(['Company', 123])); // true - * ``` - */ - static isKey(value?: {}) { - return entity.isDsKey(value); - } - isKey(value?: {}) { - return Datastore.isKey(value); - } - - /** - * Helper to create a URL safe key. - * - * This is intended to work with the "legacy" representation of a - * datastore "Key" used within Google App Engine (a so-called "Reference"). - * The returned string can be used as the "urlsafe" - * The base64 encoded values will have padding removed. - * - * - * @param {entity.Key} key Entity key object. - * @param {string} locationPrefix Optional . - * The location prefix of an App Engine project ID. - * Often this value is 's~', but may also be 'e~', or other location prefixes - * currently unknown. - * @param {function} callback The callback function. - * @param {?error} callback.err An error returned while making this request - * @param {string} callback.urlSafeKey A Base64-encoded URL-safe key. - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const key = datastore.key(['Company', 'Google']); - * - * datastore.keyToLegacyUrlSafe(key, (err, urlSafeKey) => { - * if (err) { - * // Error handling omitted. - * } - * console.log(urlSafeKey); - * }); - * - * //- - * // Create a complete URL-safe key using a location prefix. - * //- - * const locationPrefix = 's~'; - * - * datastore.keyToLegacyUrlSafe(key, locationPrefix, (err, urlSafeKey) => { - * if (err) { - * // Error handling omitted. - * } - * console.log(urlSafeKey); - * }); - * - * //- - * // If the callback is omitted, we'll return a Promise. - * //- - * datastore.keyToLegacyUrlSafe(key).then((data) => { - * const urlSafeKey = data[0]; - * console.log(urlSafeKey); - * }); - * ``` - */ - keyToLegacyUrlSafe(key: entity.Key, locationPrefix?: string): Promise; - keyToLegacyUrlSafe( - key: entity.Key, - callback: KeyToLegacyUrlSafeCallback - ): void; - keyToLegacyUrlSafe( - key: entity.Key, - locationPrefix: string, - callback: KeyToLegacyUrlSafeCallback - ): void; - keyToLegacyUrlSafe( - key: entity.Key, - locationPrefixOrCallback?: string | KeyToLegacyUrlSafeCallback, - callback?: KeyToLegacyUrlSafeCallback - ): Promise | void { - const locationPrefix = - typeof locationPrefixOrCallback === 'string' - ? locationPrefixOrCallback - : ''; - callback = - typeof locationPrefixOrCallback === 'function' - ? locationPrefixOrCallback - : callback; - this.auth.getProjectId((err, projectId) => { - if (err) { - callback!(err); - return; - } - callback!(null, urlSafeKey.legacyEncode(projectId!, key, locationPrefix)); - }); - } - - /** - * Helper to convert URL safe key string to entity key object - * - * This is intended to work with the "legacy" representation of a - * datastore "Key" used within Google App Engine (a so-called "Reference"). - * - * @param {entity.Key} key Entity key object. - * @param {string} locationPrefix Optional . - * The location prefix of an App Engine project ID. - * Often this value is 's~', but may also be 'e~', or other location prefixes - * currently unknown. - * @returns {string} Created urlsafe key. - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const urlSafeKey = 'ag9ncmFzcy1jbHVtcC00NzlyEwsSB0NvbXBhbnkiBkdvb2dsZQw'; - * - * datastore.keyFromLegacyUrlsafe(key); - * - * ``` - */ - keyFromLegacyUrlsafe(key: string): entity.Key { - return urlSafeKey.legacyDecode(key); - } - - /** - * Create a new Transaction object. - * - * @param {object} [options] Configuration object. - * @param {string} [options.id] The ID of a previously run transaction. - * @param {boolean} [options.readOnly=false] A read-only transaction cannot - * modify entities. - * @returns {Transaction} - * - * @example - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * const datastore = new Datastore(); - * const transaction = datastore.transaction(); - * ``` - */ - transaction(options?: TransactionOptions) { - return new Transaction(this, options); - } - - /** - * Determine the appropriate endpoint to use for API requests. If not - * explicitly defined, check for the "DATASTORE_EMULATOR_HOST" environment - * variable, used to connect to a local Datastore server. - * - * @private - * - * @param {string} customApiEndpoint Custom API endpoint. - */ - determineBaseUrl_(customApiEndpoint?: string) { - let baseUrl = this.defaultBaseUrl_; - const leadingProtocol = new RegExp('^https*://'); - const trailingSlashes = new RegExp('/*$'); - const port = new RegExp(':(\\d+)'); - - if (customApiEndpoint) { - baseUrl = customApiEndpoint; - this.customEndpoint_ = true; - } else if (process.env.DATASTORE_EMULATOR_HOST) { - baseUrl = process.env.DATASTORE_EMULATOR_HOST; - this.customEndpoint_ = true; - } - - if (port.test(baseUrl)) { - this.port_ = Number(baseUrl.match(port)![1]); - } - - this.baseUrl_ = baseUrl - .replace(leadingProtocol, '') - .replace(port, '') - .replace(trailingSlashes, ''); - } - - /** - * {@link DatastoreRequest} class. - * - * @name Datastore.DatastoreRequest - * @see DatastoreRequest - * @type {constructor} - */ - DatastoreRequest = DatastoreRequest; - - /** - * {@link Query} class. - * - * @name Datastore.Query - * @see Query - * @type {constructor} - */ - Query = Query; - - /** - * {@link Transaction} class. - * - * @name Datastore.Transaction - * @see Transaction - * @type {constructor} - */ - Transaction = Transaction; -} - -/*! Developer Documentation - * - * All async methods (except for streams) will return a Promise in the event - * that a callback is omitted. - */ -promisifyAll(Datastore, { - exclude: [ - 'double', - 'isDouble', - 'geoPoint', - 'getProjectId', - 'isGeoPoint', - 'index', - 'int', - 'isInt', - 'createQuery', - 'key', - 'isKey', - 'keyFromLegacyUrlsafe', - 'transaction', - ], -}); - -export {Datastore}; - -/** - * The default export of the `@google-cloud/datastore` package is the - * {@link Datastore} class. - * - * See the {@link Datastore} class for client methods and configuration options. - * - * @module {Datastore} @google-cloud/datastore - * @alias nodejs-datastore - * - * @example Install the client library with npm: - * ``` - * npm install --save - * ``` - * @google-cloud/datastore - * - * @example Import the client library - * ``` - * const {Datastore} = require('@google-cloud/datastore'); - * - * ``` - * @example Create a client that uses Application Default Credentials (ADC): - * ``` - * const datastore = new Datastore(); - * - * ``` - * @example Create a client with explicit credentials: - * ``` - * const datastore = new Datastore({ projectId: - * 'your-project-id', keyFilename: '/path/to/keyfile.json' - * }); - * - * ``` - * @example include:samples/quickstart.js - * region_tag:datastore_quickstart - * Full quickstart example: - */ - -/** - * @name Datastore.v1 - * @see v1.DatastoreClient - * @type {object} - * @property {constructor} DatastoreClient - * Reference to {@link v1.DatastoreClient}. - */ - -/** - * @name module:@google-cloud/datastore.v1 - * @see v1.DatastoreClient - * @type {object} - * @property {constructor} DatastoreClient - * Reference to {@link v1.DatastoreClient}. - */ -module.exports.v1 = gapic.v1; - -export interface TransactionOptions { - id?: string; - readOnly?: boolean; -} - -export {Index, DatastoreRequest, Query, Transaction}; - -export interface DatastoreOptions extends GoogleAuthOptions { - namespace?: string; - apiEndpoint?: string; - sslCreds?: ChannelCredentials; -} - -export interface KeyToLegacyUrlSafeCallback { - (err?: Error | null, urlSafeKey?: string): void; -} -const v1 = gapic.v1; -export {v1}; - -export {DatastoreClient, DatastoreAdminClient} from './v1'; +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const DatastoreClient = v1.DatastoreClient; +type DatastoreClient = v1.DatastoreClient; +export {v1, DatastoreClient}; +export default {v1, DatastoreClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/src/v1/datastore_client.ts b/src/v1/datastore_client.ts index d75cf5a15..aca273848 100644 --- a/src/v1/datastore_client.ts +++ b/src/v1/datastore_client.ts @@ -18,7 +18,7 @@ /* global window */ import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -28,7 +28,7 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './datastore_client_config.json'; - +import { operationsProtos } from 'google-gax'; const version = require('../../../package.json').version; /** @@ -59,6 +59,7 @@ export class DatastoreClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + operationsClient: gax.OperationsClient; datastoreStub?: Promise<{[name: string]: Function}>; /** @@ -97,16 +98,11 @@ export class DatastoreClient { constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof DatastoreClient; - const servicePath = - opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!( - opts?.servicePath || opts?.apiEndpoint - ); + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = - opts?.fallback ?? - (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + 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. @@ -124,7 +120,7 @@ export class DatastoreClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -138,7 +134,10 @@ export class DatastoreClient { } // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -146,7 +145,7 @@ export class DatastoreClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest') { + } else if (opts.fallback === 'rest' ) { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -155,13 +154,27 @@ export class DatastoreClient { // Load the applicable protos. this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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 === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + + this.descriptors.longrunning = { + }; + // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.datastore.v1.Datastore', - gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, - {'x-goog-api-client': clientHeader.join(' ')} - ); + 'google.datastore.v1.Datastore', 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 @@ -192,43 +205,31 @@ export class DatastoreClient { // Put together the "service stub" for // google.datastore.v1.Datastore. this.datastoreStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.datastore.v1.Datastore' - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.datastore.v1.Datastore') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.datastore.v1.Datastore, - this._opts, - this._providedCustomServicePath - ) as Promise<{[method: string]: Function}>; + 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 datastoreStubMethods = [ - 'lookup', - 'runQuery', - 'beginTransaction', - 'commit', - 'rollback', - 'allocateIds', - 'reserveIds', - ]; + const datastoreStubMethods = + ['lookup', 'runQuery', 'runAggregationQuery', 'beginTransaction', 'commit', 'rollback', 'allocateIds', 'reserveIds']; for (const methodName of datastoreStubMethods) { const callPromise = this.datastoreStub.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) => () => { + 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 = undefined; + const descriptor = + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -274,7 +275,7 @@ export class DatastoreClient { static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/datastore', + 'https://www.googleapis.com/auth/datastore' ]; } @@ -284,9 +285,8 @@ export class DatastoreClient { * 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 { + getProjectId(callback?: Callback): + Promise|void { if (callback) { this.auth.getProjectId(callback); return; @@ -297,641 +297,853 @@ export class DatastoreClient { // ------------------- // -- Service calls -- // ------------------- - /** - * Looks up entities by key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {google.datastore.v1.ReadOptions} request.readOptions - * The options for this lookup request. - * @param {number[]} request.keys - * Required. Keys of entities to look up. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [LookupResponse]{@link google.datastore.v1.LookupResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.lookup.js - * region_tag:datastore_v1_generated_Datastore_Lookup_async - */ +/** + * Looks up entities by key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {string} request.databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @param {google.datastore.v1.ReadOptions} request.readOptions + * The options for this lookup request. + * @param {number[]} request.keys + * Required. Keys of entities to look up. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [LookupResponse]{@link google.datastore.v1.LookupResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.lookup.js + * region_tag:datastore_v1_generated_Datastore_Lookup_async + */ lookup( - request?: protos.google.datastore.v1.ILookupRequest, - options?: CallOptions - ): Promise< - [ - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest | undefined, - {} | undefined - ] - >; + request?: protos.google.datastore.v1.ILookupRequest, + options?: CallOptions): + Promise<[ + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest|undefined, {}|undefined + ]>; lookup( - request: protos.google.datastore.v1.ILookupRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.ILookupRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest|null|undefined, + {}|null|undefined>): void; lookup( - request: protos.google.datastore.v1.ILookupRequest, - callback: Callback< - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.ILookupRequest, + callback: Callback< + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest|null|undefined, + {}|null|undefined>): void; lookup( - request?: protos.google.datastore.v1.ILookupRequest, - optionsOrCallback?: - | CallOptions - | Callback< + request?: protos.google.datastore.v1.ILookupRequest, + optionsOrCallback?: CallOptions|Callback< protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest | undefined, - {} | undefined - ] - > | void { + protos.google.datastore.v1.ILookupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - project_id: request.projectId || '', - }); + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); this.initialize(); return this.innerApiCalls.lookup(request, options, callback); } - /** - * Queries for entities. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {google.datastore.v1.PartitionId} request.partitionId - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * @param {google.datastore.v1.ReadOptions} request.readOptions - * The options for this query. - * @param {google.datastore.v1.Query} request.query - * The query to run. - * @param {google.datastore.v1.GqlQuery} request.gqlQuery - * The GQL query to run. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RunQueryResponse]{@link google.datastore.v1.RunQueryResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.run_query.js - * region_tag:datastore_v1_generated_Datastore_RunQuery_async - */ +/** + * Queries for entities. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {string} request.databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @param {google.datastore.v1.PartitionId} request.partitionId + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * @param {google.datastore.v1.ReadOptions} request.readOptions + * The options for this query. + * @param {google.datastore.v1.Query} request.query + * The query to run. + * @param {google.datastore.v1.GqlQuery} request.gqlQuery + * The GQL query to run. This query must be a non-aggregation query. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RunQueryResponse]{@link google.datastore.v1.RunQueryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.run_query.js + * region_tag:datastore_v1_generated_Datastore_RunQuery_async + */ runQuery( - request?: protos.google.datastore.v1.IRunQueryRequest, - options?: CallOptions - ): Promise< - [ - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest | undefined, - {} | undefined - ] - >; + request?: protos.google.datastore.v1.IRunQueryRequest, + options?: CallOptions): + Promise<[ + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest|undefined, {}|undefined + ]>; runQuery( - request: protos.google.datastore.v1.IRunQueryRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IRunQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest|null|undefined, + {}|null|undefined>): void; runQuery( - request: protos.google.datastore.v1.IRunQueryRequest, - callback: Callback< - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IRunQueryRequest, + callback: Callback< + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest|null|undefined, + {}|null|undefined>): void; runQuery( - request?: protos.google.datastore.v1.IRunQueryRequest, - optionsOrCallback?: - | CallOptions - | Callback< + request?: protos.google.datastore.v1.IRunQueryRequest, + optionsOrCallback?: CallOptions|Callback< protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest | undefined, - {} | undefined - ] - > | void { + protos.google.datastore.v1.IRunQueryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - project_id: request.projectId || '', - }); + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); this.initialize(); return this.innerApiCalls.runQuery(request, options, callback); } - /** - * Begins a new transaction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {google.datastore.v1.TransactionOptions} request.transactionOptions - * Options for a new transaction. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [BeginTransactionResponse]{@link google.datastore.v1.BeginTransactionResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.begin_transaction.js - * region_tag:datastore_v1_generated_Datastore_BeginTransaction_async - */ +/** + * Runs an aggregation query. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {string} request.databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @param {google.datastore.v1.PartitionId} request.partitionId + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * @param {google.datastore.v1.ReadOptions} request.readOptions + * The options for this query. + * @param {google.datastore.v1.AggregationQuery} request.aggregationQuery + * The query to run. + * @param {google.datastore.v1.GqlQuery} request.gqlQuery + * The GQL query to run. This query must be an aggregation query. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RunAggregationQueryResponse]{@link google.datastore.v1.RunAggregationQueryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.run_aggregation_query.js + * region_tag:datastore_v1_generated_Datastore_RunAggregationQuery_async + */ + runAggregationQuery( + request?: protos.google.datastore.v1.IRunAggregationQueryRequest, + options?: CallOptions): + Promise<[ + protos.google.datastore.v1.IRunAggregationQueryResponse, + protos.google.datastore.v1.IRunAggregationQueryRequest|undefined, {}|undefined + ]>; + runAggregationQuery( + request: protos.google.datastore.v1.IRunAggregationQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IRunAggregationQueryResponse, + protos.google.datastore.v1.IRunAggregationQueryRequest|null|undefined, + {}|null|undefined>): void; + runAggregationQuery( + request: protos.google.datastore.v1.IRunAggregationQueryRequest, + callback: Callback< + protos.google.datastore.v1.IRunAggregationQueryResponse, + protos.google.datastore.v1.IRunAggregationQueryRequest|null|undefined, + {}|null|undefined>): void; + runAggregationQuery( + request?: protos.google.datastore.v1.IRunAggregationQueryRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.datastore.v1.IRunAggregationQueryResponse, + protos.google.datastore.v1.IRunAggregationQueryRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.datastore.v1.IRunAggregationQueryResponse, + protos.google.datastore.v1.IRunAggregationQueryRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.datastore.v1.IRunAggregationQueryResponse, + protos.google.datastore.v1.IRunAggregationQueryRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); + this.initialize(); + return this.innerApiCalls.runAggregationQuery(request, options, callback); + } +/** + * Begins a new transaction. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {string} request.databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @param {google.datastore.v1.TransactionOptions} request.transactionOptions + * Options for a new transaction. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [BeginTransactionResponse]{@link google.datastore.v1.BeginTransactionResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.begin_transaction.js + * region_tag:datastore_v1_generated_Datastore_BeginTransaction_async + */ beginTransaction( - request?: protos.google.datastore.v1.IBeginTransactionRequest, - options?: CallOptions - ): Promise< - [ - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest | undefined, - {} | undefined - ] - >; + request?: protos.google.datastore.v1.IBeginTransactionRequest, + options?: CallOptions): + Promise<[ + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest|undefined, {}|undefined + ]>; beginTransaction( - request: protos.google.datastore.v1.IBeginTransactionRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IBeginTransactionRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest|null|undefined, + {}|null|undefined>): void; beginTransaction( - request: protos.google.datastore.v1.IBeginTransactionRequest, - callback: Callback< - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IBeginTransactionRequest, + callback: Callback< + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest|null|undefined, + {}|null|undefined>): void; beginTransaction( - request?: protos.google.datastore.v1.IBeginTransactionRequest, - optionsOrCallback?: - | CallOptions - | Callback< + request?: protos.google.datastore.v1.IBeginTransactionRequest, + optionsOrCallback?: CallOptions|Callback< protos.google.datastore.v1.IBeginTransactionResponse, - | protos.google.datastore.v1.IBeginTransactionRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest | undefined, - {} | undefined - ] - > | void { + protos.google.datastore.v1.IBeginTransactionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - project_id: request.projectId || '', - }); + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); this.initialize(); return this.innerApiCalls.beginTransaction(request, options, callback); } - /** - * Commits a transaction, optionally creating, deleting or modifying some - * entities. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {google.datastore.v1.CommitRequest.Mode} request.mode - * The type of commit to perform. Defaults to `TRANSACTIONAL`. - * @param {Buffer} request.transaction - * The identifier of the transaction associated with the commit. A - * transaction identifier is returned by a call to - * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. - * @param {number[]} request.mutations - * The mutations to perform. - * - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [CommitResponse]{@link google.datastore.v1.CommitResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.commit.js - * region_tag:datastore_v1_generated_Datastore_Commit_async - */ +/** + * Commits a transaction, optionally creating, deleting or modifying some + * entities. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {string} request.databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @param {google.datastore.v1.CommitRequest.Mode} request.mode + * The type of commit to perform. Defaults to `TRANSACTIONAL`. + * @param {Buffer} request.transaction + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. + * @param {number[]} request.mutations + * The mutations to perform. + * + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [CommitResponse]{@link google.datastore.v1.CommitResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.commit.js + * region_tag:datastore_v1_generated_Datastore_Commit_async + */ commit( - request?: protos.google.datastore.v1.ICommitRequest, - options?: CallOptions - ): Promise< - [ - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest | undefined, - {} | undefined - ] - >; + request?: protos.google.datastore.v1.ICommitRequest, + options?: CallOptions): + Promise<[ + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest|undefined, {}|undefined + ]>; commit( - request: protos.google.datastore.v1.ICommitRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.ICommitRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest|null|undefined, + {}|null|undefined>): void; commit( - request: protos.google.datastore.v1.ICommitRequest, - callback: Callback< - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.ICommitRequest, + callback: Callback< + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest|null|undefined, + {}|null|undefined>): void; commit( - request?: protos.google.datastore.v1.ICommitRequest, - optionsOrCallback?: - | CallOptions - | Callback< + request?: protos.google.datastore.v1.ICommitRequest, + optionsOrCallback?: CallOptions|Callback< protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest | undefined, - {} | undefined - ] - > | void { + protos.google.datastore.v1.ICommitRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - project_id: request.projectId || '', - }); + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); this.initialize(); return this.innerApiCalls.commit(request, options, callback); } - /** - * Rolls back a transaction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {Buffer} request.transaction - * Required. The transaction identifier, returned by a call to - * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RollbackResponse]{@link google.datastore.v1.RollbackResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.rollback.js - * region_tag:datastore_v1_generated_Datastore_Rollback_async - */ +/** + * Rolls back a transaction. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {string} request.databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @param {Buffer} request.transaction + * Required. The transaction identifier, returned by a call to + * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RollbackResponse]{@link google.datastore.v1.RollbackResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.rollback.js + * region_tag:datastore_v1_generated_Datastore_Rollback_async + */ rollback( - request?: protos.google.datastore.v1.IRollbackRequest, - options?: CallOptions - ): Promise< - [ - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest | undefined, - {} | undefined - ] - >; + request?: protos.google.datastore.v1.IRollbackRequest, + options?: CallOptions): + Promise<[ + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest|undefined, {}|undefined + ]>; rollback( - request: protos.google.datastore.v1.IRollbackRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IRollbackRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest|null|undefined, + {}|null|undefined>): void; rollback( - request: protos.google.datastore.v1.IRollbackRequest, - callback: Callback< - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IRollbackRequest, + callback: Callback< + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest|null|undefined, + {}|null|undefined>): void; rollback( - request?: protos.google.datastore.v1.IRollbackRequest, - optionsOrCallback?: - | CallOptions - | Callback< + request?: protos.google.datastore.v1.IRollbackRequest, + optionsOrCallback?: CallOptions|Callback< protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest | undefined, - {} | undefined - ] - > | void { + protos.google.datastore.v1.IRollbackRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - project_id: request.projectId || '', - }); + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); this.initialize(); return this.innerApiCalls.rollback(request, options, callback); } - /** - * Allocates IDs for the given keys, which is useful for referencing an entity - * before it is inserted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {number[]} request.keys - * Required. A list of keys with incomplete key paths for which to allocate IDs. - * No key may be reserved/read-only. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AllocateIdsResponse]{@link google.datastore.v1.AllocateIdsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.allocate_ids.js - * region_tag:datastore_v1_generated_Datastore_AllocateIds_async - */ +/** + * Allocates IDs for the given keys, which is useful for referencing an entity + * before it is inserted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {string} request.databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @param {number[]} request.keys + * Required. A list of keys with incomplete key paths for which to allocate IDs. + * No key may be reserved/read-only. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AllocateIdsResponse]{@link google.datastore.v1.AllocateIdsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.allocate_ids.js + * region_tag:datastore_v1_generated_Datastore_AllocateIds_async + */ allocateIds( - request?: protos.google.datastore.v1.IAllocateIdsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest | undefined, - {} | undefined - ] - >; + request?: protos.google.datastore.v1.IAllocateIdsRequest, + options?: CallOptions): + Promise<[ + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest|undefined, {}|undefined + ]>; allocateIds( - request: protos.google.datastore.v1.IAllocateIdsRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IAllocateIdsRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest|null|undefined, + {}|null|undefined>): void; allocateIds( - request: protos.google.datastore.v1.IAllocateIdsRequest, - callback: Callback< - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IAllocateIdsRequest, + callback: Callback< + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest|null|undefined, + {}|null|undefined>): void; allocateIds( - request?: protos.google.datastore.v1.IAllocateIdsRequest, - optionsOrCallback?: - | CallOptions - | Callback< + request?: protos.google.datastore.v1.IAllocateIdsRequest, + optionsOrCallback?: CallOptions|Callback< protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest | undefined, - {} | undefined - ] - > | void { + protos.google.datastore.v1.IAllocateIdsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - project_id: request.projectId || '', - }); + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); this.initialize(); return this.innerApiCalls.allocateIds(request, options, callback); } - /** - * Prevents the supplied keys' IDs from being auto-allocated by Cloud - * Datastore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {string} request.databaseId - * If not empty, the ID of the database against which to make the request. - * @param {number[]} request.keys - * Required. A list of keys with complete key paths whose numeric IDs should not be - * auto-allocated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ReserveIdsResponse]{@link google.datastore.v1.ReserveIdsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.reserve_ids.js - * region_tag:datastore_v1_generated_Datastore_ReserveIds_async - */ +/** + * Prevents the supplied keys' IDs from being auto-allocated by Cloud + * Datastore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {string} request.databaseId + * The ID of the database against which to make the request. + * + * '(default)' is not allowed; please use empty string '' to refer the default + * database. + * @param {number[]} request.keys + * Required. A list of keys with complete key paths whose numeric IDs should not be + * auto-allocated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ReserveIdsResponse]{@link google.datastore.v1.ReserveIdsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.reserve_ids.js + * region_tag:datastore_v1_generated_Datastore_ReserveIds_async + */ reserveIds( - request?: protos.google.datastore.v1.IReserveIdsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest | undefined, - {} | undefined - ] - >; + request?: protos.google.datastore.v1.IReserveIdsRequest, + options?: CallOptions): + Promise<[ + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest|undefined, {}|undefined + ]>; reserveIds( - request: protos.google.datastore.v1.IReserveIdsRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IReserveIdsRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest|null|undefined, + {}|null|undefined>): void; reserveIds( - request: protos.google.datastore.v1.IReserveIdsRequest, - callback: Callback< - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest | null | undefined, - {} | null | undefined - > - ): void; + request: protos.google.datastore.v1.IReserveIdsRequest, + callback: Callback< + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest|null|undefined, + {}|null|undefined>): void; reserveIds( - request?: protos.google.datastore.v1.IReserveIdsRequest, - optionsOrCallback?: - | CallOptions - | Callback< + request?: protos.google.datastore.v1.IReserveIdsRequest, + optionsOrCallback?: CallOptions|Callback< protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest | undefined, - {} | undefined - ] - > | void { + protos.google.datastore.v1.IReserveIdsRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest|undefined, {}|undefined + ]>|void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } else { + } + else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ - project_id: request.projectId || '', - }); + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'project_id': request.projectId || '', + }); this.initialize(); return this.innerApiCalls.reserveIds(request, options, callback); } +/** + * 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 [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#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 + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"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, + options?: + | 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]> { + 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 [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#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. + * + * @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 { + 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 [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#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, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + 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 [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#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, + options?: + | 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 { + return this.operationsClient.deleteOperation(request, options, callback); + } + + /** * Terminate the gRPC channel and close the client. * @@ -943,6 +1155,7 @@ export class DatastoreClient { return this.datastoreStub.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/src/v1/datastore_client_config.json b/src/v1/datastore_client_config.json index 37bd1c737..00d94ed6e 100644 --- a/src/v1/datastore_client_config.json +++ b/src/v1/datastore_client_config.json @@ -30,6 +30,11 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, + "RunAggregationQuery": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, "BeginTransaction": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/src/v1/datastore_proto_list.json b/src/v1/datastore_proto_list.json index 0636f1215..87f7c47cc 100644 --- a/src/v1/datastore_proto_list.json +++ b/src/v1/datastore_proto_list.json @@ -1,4 +1,5 @@ [ + "../../protos/google/datastore/v1/aggregation_result.proto", "../../protos/google/datastore/v1/datastore.proto", "../../protos/google/datastore/v1/entity.proto", "../../protos/google/datastore/v1/query.proto" diff --git a/src/v1/gapic_metadata.json b/src/v1/gapic_metadata.json index 2b53e796b..89f84dcae 100644 --- a/src/v1/gapic_metadata.json +++ b/src/v1/gapic_metadata.json @@ -2,81 +2,97 @@ "schema": "1.0", "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", - "protoPackage": "google.datastore.admin.v1", - "libraryPackage": "@google-cloud/datastore-admin", + "protoPackage": "google.datastore.v1", + "libraryPackage": "@google-cloud/datastore", "services": { - "DatastoreAdmin": { + "Datastore": { "clients": { "grpc": { - "libraryClient": "DatastoreAdminClient", + "libraryClient": "DatastoreClient", "rpcs": { - "GetIndex": { + "Lookup": { "methods": [ - "getIndex" + "lookup" ] }, - "ExportEntities": { + "RunQuery": { "methods": [ - "exportEntities" + "runQuery" ] }, - "ImportEntities": { + "RunAggregationQuery": { "methods": [ - "importEntities" + "runAggregationQuery" ] }, - "CreateIndex": { + "BeginTransaction": { "methods": [ - "createIndex" + "beginTransaction" ] }, - "DeleteIndex": { + "Commit": { "methods": [ - "deleteIndex" + "commit" ] }, - "ListIndexes": { + "Rollback": { "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" + "rollback" + ] + }, + "AllocateIds": { + "methods": [ + "allocateIds" + ] + }, + "ReserveIds": { + "methods": [ + "reserveIds" ] } } }, "grpc-fallback": { - "libraryClient": "DatastoreAdminClient", + "libraryClient": "DatastoreClient", "rpcs": { - "GetIndex": { + "Lookup": { + "methods": [ + "lookup" + ] + }, + "RunQuery": { + "methods": [ + "runQuery" + ] + }, + "RunAggregationQuery": { "methods": [ - "getIndex" + "runAggregationQuery" ] }, - "ExportEntities": { + "BeginTransaction": { "methods": [ - "exportEntities" + "beginTransaction" ] }, - "ImportEntities": { + "Commit": { "methods": [ - "importEntities" + "commit" ] }, - "CreateIndex": { + "Rollback": { "methods": [ - "createIndex" + "rollback" ] }, - "DeleteIndex": { + "AllocateIds": { "methods": [ - "deleteIndex" + "allocateIds" ] }, - "ListIndexes": { + "ReserveIds": { "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" + "reserveIds" ] } } diff --git a/src/v1/index.ts b/src/v1/index.ts index 5821a1910..63381b364 100644 --- a/src/v1/index.ts +++ b/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,5 +16,4 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export {DatastoreAdminClient} from './datastore_admin_client'; export {DatastoreClient} from './datastore_client'; diff --git a/system-test/fixtures/sample/src/index.js b/system-test/fixtures/sample/src/index.js index 44c29691c..5dbaf7a7b 100644 --- a/system-test/fixtures/sample/src/index.js +++ b/system-test/fixtures/sample/src/index.js @@ -16,11 +16,12 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** + /* eslint-disable node/no-missing-require, no-unused-vars */ const datastore = require('@google-cloud/datastore'); function main() { - const datastoreClient = new datastore.Datastore(); + const datastoreClient = new datastore.DatastoreClient(); } main(); diff --git a/system-test/fixtures/sample/src/index.ts b/system-test/fixtures/sample/src/index.ts index 97fdbf6f7..28b7ce4d6 100644 --- a/system-test/fixtures/sample/src/index.ts +++ b/system-test/fixtures/sample/src/index.ts @@ -16,17 +16,17 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {Datastore} from '@google-cloud/datastore'; +import {DatastoreClient} from '@google-cloud/datastore'; // check that the client class type name can be used -function doStuffWithDatastore(client: Datastore) { - // client.close(); +function doStuffWithDatastoreClient(client: DatastoreClient) { + client.close(); } function main() { // check that the client instance can be created - const datastoreClient = new Datastore(); - doStuffWithDatastore(datastoreClient); + const datastoreClient = new DatastoreClient(); + doStuffWithDatastoreClient(datastoreClient); } main(); diff --git a/system-test/install.ts b/system-test/install.ts index 6dd1eaada..8ec452229 100644 --- a/system-test/install.ts +++ b/system-test/install.ts @@ -16,36 +16,34 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; describe('📦 pack-n-play test', () => { - it('TypeScript code', async function () { + + it('TypeScript code', async function() { this.timeout(300000); const options = { packageDir: process.cwd(), sample: { description: 'TypeScript user can use the type definitions', - ts: readFileSync( - './system-test/fixtures/sample/src/index.ts' - ).toString(), - }, + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } }; await packNTest(options); }); - it('JavaScript code', async function () { + it('JavaScript code', async function() { this.timeout(300000); const options = { packageDir: process.cwd(), sample: { description: 'JavaScript user can use the library', - ts: readFileSync( - './system-test/fixtures/sample/src/index.js' - ).toString(), - }, + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } }; await packNTest(options); }); + }); diff --git a/test/gapic_datastore_v1.ts b/test/gapic_datastore_v1.ts index 722a27d04..89e282eda 100644 --- a/test/gapic_datastore_v1.ts +++ b/test/gapic_datastore_v1.ts @@ -20,998 +20,1167 @@ 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 { describe, it } from 'mocha'; import * as datastoreModule from '../src'; -import {protobuf} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = ( - instance.constructor as typeof protobuf.Message - ).toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject - ) as T; + 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]); + 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 stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +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.DatastoreClient', () => { - it('has servicePath', () => { - const servicePath = datastoreModule.v1.DatastoreClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = datastoreModule.v1.DatastoreClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = datastoreModule.v1.DatastoreClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new datastoreModule.v1.DatastoreClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new datastoreModule.v1.DatastoreClient({ - fallback: true, + it('has servicePath', () => { + const servicePath = datastoreModule.v1.DatastoreClient.servicePath; + assert(servicePath); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.datastoreStub, undefined); - await client.initialize(); - assert(client.datastoreStub); - }); - - it('has close method for the initialized client', done => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has apiEndpoint', () => { + const apiEndpoint = datastoreModule.v1.DatastoreClient.apiEndpoint; + assert(apiEndpoint); }); - client.initialize(); - assert(client.datastoreStub); - client.close().then(() => { - done(); - }); - }); - it('has close method for the non-initialized client', done => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.datastoreStub, undefined); - client.close().then(() => { - done(); + it('has port', () => { + const port = datastoreModule.v1.DatastoreClient.port; + assert(port); + assert(typeof port === 'number'); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datastoreModule.v1.DatastoreClient({ - 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 datastoreModule.v1.DatastoreClient({ - 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('lookup', () => { - it('invokes lookup without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.LookupRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.LookupResponse() - ); - client.innerApiCalls.lookup = stubSimpleCall(expectedResponse); - const [response] = await client.lookup(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.lookup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('should create a client with no option', () => { + const client = new datastoreModule.v1.DatastoreClient(); + assert(client); }); - it('invokes lookup without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.LookupRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.LookupResponse() - ); - client.innerApiCalls.lookup = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lookup( - request, - ( - err?: Error | null, - result?: protos.google.datastore.v1.ILookupResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.lookup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('should create a client with gRPC fallback', () => { + const client = new datastoreModule.v1.DatastoreClient({ + fallback: true, + }); + assert(client); }); - it('invokes lookup with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.LookupRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.lookup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookup(request), expectedError); - assert( - (client.innerApiCalls.lookup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has initialize method and supports deferred initialization', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.datastoreStub, undefined); + await client.initialize(); + assert(client.datastoreStub); }); - it('invokes lookup with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.LookupRequest() - ); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lookup(request), expectedError); - }); - }); - - describe('runQuery', () => { - it('invokes runQuery without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunQueryRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.RunQueryResponse() - ); - client.innerApiCalls.runQuery = stubSimpleCall(expectedResponse); - const [response] = await client.runQuery(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.runQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has close method for the initialized client', done => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.datastoreStub); + client.close().then(() => { + done(); + }); }); - it('invokes runQuery without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunQueryRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.RunQueryResponse() - ); - client.innerApiCalls.runQuery = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runQuery( - request, - ( - err?: Error | null, - result?: protos.google.datastore.v1.IRunQueryResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.runQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('has close method for the non-initialized client', done => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.datastoreStub, undefined); + client.close().then(() => { + done(); + }); }); - it('invokes runQuery with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunQueryRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runQuery = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runQuery(request), expectedError); - assert( - (client.innerApiCalls.runQuery as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datastoreModule.v1.DatastoreClient({ + 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('invokes runQuery with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunQueryRequest() - ); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runQuery(request), expectedError); - }); - }); - - describe('beginTransaction', () => { - it('invokes beginTransaction without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionResponse() - ); - client.innerApiCalls.beginTransaction = stubSimpleCall(expectedResponse); - const [response] = await client.beginTransaction(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datastoreModule.v1.DatastoreClient({ + 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); }); - it('invokes beginTransaction without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionResponse() - ); - client.innerApiCalls.beginTransaction = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.beginTransaction( - request, - ( - err?: Error | null, - result?: protos.google.datastore.v1.IBeginTransactionResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); + describe('lookup', () => { + it('invokes lookup without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.LookupRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.LookupResponse()); + client.innerApiCalls.lookup = stubSimpleCall(expectedResponse); + const [response] = await client.lookup(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.lookup as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes beginTransaction with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.beginTransaction = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.beginTransaction(request), expectedError); - assert( - (client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes lookup without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.LookupRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.LookupResponse()); + client.innerApiCalls.lookup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookup( + request, + (err?: Error|null, result?: protos.google.datastore.v1.ILookupResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.lookup as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes beginTransaction with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionRequest() - ); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.beginTransaction(request), expectedError); - }); - }); - - describe('commit', () => { - it('invokes commit without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.CommitRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.CommitResponse() - ); - client.innerApiCalls.commit = stubSimpleCall(expectedResponse); - const [response] = await client.commit(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.commit as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes lookup with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.LookupRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.lookup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookup(request), expectedError); + assert((client.innerApiCalls.lookup as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes commit without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.CommitRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.CommitResponse() - ); - client.innerApiCalls.commit = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.commit( - request, - ( - err?: Error | null, - result?: protos.google.datastore.v1.ICommitResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.commit as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes lookup with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.LookupRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookup(request), expectedError); + }); }); - it('invokes commit with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.CommitRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.commit = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.commit(request), expectedError); - assert( - (client.innerApiCalls.commit as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + describe('runQuery', () => { + it('invokes runQuery without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RunQueryRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RunQueryResponse()); + client.innerApiCalls.runQuery = stubSimpleCall(expectedResponse); + const [response] = await client.runQuery(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runQuery as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); - it('invokes commit with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.CommitRequest() - ); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.commit(request), expectedError); - }); - }); - - describe('rollback', () => { - it('invokes rollback without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RollbackRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.RollbackResponse() - ); - client.innerApiCalls.rollback = stubSimpleCall(expectedResponse); - const [response] = await client.rollback(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.rollback as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); + it('invokes runQuery without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RunQueryRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RunQueryResponse()); + client.innerApiCalls.runQuery = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runQuery( + request, + (err?: Error|null, result?: protos.google.datastore.v1.IRunQueryResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runQuery as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); - it('invokes rollback without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RollbackRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.RollbackResponse() - ); - client.innerApiCalls.rollback = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollback( - request, - ( - err?: Error | null, - result?: protos.google.datastore.v1.IRollbackResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.rollback as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + it('invokes runQuery with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RunQueryRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runQuery = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runQuery(request), expectedError); + assert((client.innerApiCalls.runQuery as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runQuery with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RunQueryRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runQuery(request), expectedError); + }); }); - it('invokes rollback with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RollbackRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.rollback = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollback(request), expectedError); - assert( - (client.innerApiCalls.rollback as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + describe('runAggregationQuery', () => { + it('invokes runAggregationQuery without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryResponse()); + client.innerApiCalls.runAggregationQuery = stubSimpleCall(expectedResponse); + const [response] = await client.runAggregationQuery(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runAggregationQuery as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runAggregationQuery without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryResponse()); + client.innerApiCalls.runAggregationQuery = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runAggregationQuery( + request, + (err?: Error|null, result?: protos.google.datastore.v1.IRunAggregationQueryResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.runAggregationQuery as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes runAggregationQuery with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runAggregationQuery = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runAggregationQuery(request), expectedError); + assert((client.innerApiCalls.runAggregationQuery as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes runAggregationQuery with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runAggregationQuery(request), expectedError); + }); }); - it('invokes rollback with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RollbackRequest() - ); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rollback(request), expectedError); + describe('beginTransaction', () => { + it('invokes beginTransaction without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionResponse()); + client.innerApiCalls.beginTransaction = stubSimpleCall(expectedResponse); + const [response] = await client.beginTransaction(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes beginTransaction without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionResponse()); + client.innerApiCalls.beginTransaction = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.beginTransaction( + request, + (err?: Error|null, result?: protos.google.datastore.v1.IBeginTransactionResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes beginTransaction with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.beginTransaction = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.beginTransaction(request), expectedError); + assert((client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes beginTransaction with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.beginTransaction(request), expectedError); + }); }); - }); - - describe('allocateIds', () => { - it('invokes allocateIds without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsResponse() - ); - client.innerApiCalls.allocateIds = stubSimpleCall(expectedResponse); - const [response] = await client.allocateIds(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.allocateIds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + + describe('commit', () => { + it('invokes commit without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.CommitRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.CommitResponse()); + client.innerApiCalls.commit = stubSimpleCall(expectedResponse); + const [response] = await client.commit(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.commit as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes commit without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.CommitRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.CommitResponse()); + client.innerApiCalls.commit = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.commit( + request, + (err?: Error|null, result?: protos.google.datastore.v1.ICommitResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.commit as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes commit with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.CommitRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.commit = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.commit(request), expectedError); + assert((client.innerApiCalls.commit as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes commit with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.CommitRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.commit(request), expectedError); + }); }); - it('invokes allocateIds without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsResponse() - ); - client.innerApiCalls.allocateIds = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.allocateIds( - request, - ( - err?: Error | null, - result?: protos.google.datastore.v1.IAllocateIdsResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.allocateIds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + describe('rollback', () => { + it('invokes rollback without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RollbackRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RollbackResponse()); + client.innerApiCalls.rollback = stubSimpleCall(expectedResponse); + const [response] = await client.rollback(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.rollback as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes rollback without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RollbackRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RollbackResponse()); + client.innerApiCalls.rollback = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollback( + request, + (err?: Error|null, result?: protos.google.datastore.v1.IRollbackResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.rollback as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes rollback with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RollbackRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.rollback = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rollback(request), expectedError); + assert((client.innerApiCalls.rollback as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes rollback with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.RollbackRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rollback(request), expectedError); + }); }); - it('invokes allocateIds with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.allocateIds = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.allocateIds(request), expectedError); - assert( - (client.innerApiCalls.allocateIds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + describe('allocateIds', () => { + it('invokes allocateIds without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsResponse()); + client.innerApiCalls.allocateIds = stubSimpleCall(expectedResponse); + const [response] = await client.allocateIds(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.allocateIds as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes allocateIds without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsResponse()); + client.innerApiCalls.allocateIds = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.allocateIds( + request, + (err?: Error|null, result?: protos.google.datastore.v1.IAllocateIdsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.allocateIds as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes allocateIds with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.allocateIds = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.allocateIds(request), expectedError); + assert((client.innerApiCalls.allocateIds as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes allocateIds with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.allocateIds(request), expectedError); + }); }); - it('invokes allocateIds with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsRequest() - ); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.allocateIds(request), expectedError); + describe('reserveIds', () => { + it('invokes reserveIds without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsResponse()); + client.innerApiCalls.reserveIds = stubSimpleCall(expectedResponse); + const [response] = await client.reserveIds(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.reserveIds as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes reserveIds without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsResponse()); + client.innerApiCalls.reserveIds = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.reserveIds( + request, + (err?: Error|null, result?: protos.google.datastore.v1.IReserveIdsResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.reserveIds as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes reserveIds with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsRequest()); + request.projectId = ''; + const expectedHeaderRequestParams = "project_id="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.reserveIds = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.reserveIds(request), expectedError); + assert((client.innerApiCalls.reserveIds as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes reserveIds with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsRequest()); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.reserveIds(request), expectedError); + }); }); - }); - - describe('reserveIds', () => { - it('invokes reserveIds without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsResponse() - ); - client.innerApiCalls.reserveIds = stubSimpleCall(expectedResponse); - const [response] = await client.reserveIds(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.reserveIds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 datastoreModule.v1.DatastoreClient({ + 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); + } + }); + }); + 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 datastoreModule.v1.DatastoreClient({ + 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)); + }); }); - - it('invokes reserveIds without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsResponse() - ); - client.innerApiCalls.reserveIds = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.reserveIds( - request, - ( - err?: Error | null, - result?: protos.google.datastore.v1.IReserveIdsResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.reserveIds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 datastoreModule.v1.DatastoreClient({ + 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); + } + }); + }); + 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 datastoreModule.v1.DatastoreClient({ + 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)); + }); }); - - it('invokes reserveIds with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsRequest() - ); - request.projectId = ''; - const expectedHeaderRequestParams = 'project_id='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.reserveIds = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.reserveIds(request), expectedError); - assert( - (client.innerApiCalls.reserveIds as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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 datastoreModule.v1.DatastoreClient({ + 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); + } + }); + }); + 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 datastoreModule.v1.DatastoreClient({ + 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)); + }); }); - - it('invokes reserveIds with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsRequest() - ); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.reserveIds(request), expectedError); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + 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.ListOperationsResponse[] = []; + 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 datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + 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.ListOperationsResponse[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + }); }); - }); }); diff --git a/webpack.config.js b/webpack.config.js index f37985e35..ffb6e6cb7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,7 +17,7 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'datastore', + library: 'Datastore', filename: './datastore.js', }, node: { @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/, + exclude: /node_modules/ }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]grpc/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader', + use: 'null-loader' }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader', + use: 'null-loader' }, ], }, From f84ebddbff497846bbfa8906b724487f1a70d15b Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 26 Jul 2022 16:14:14 -0400 Subject: [PATCH 02/67] implementation of aggregate queries. --- src/query.ts | 13 ++++++ src/request.ts | 88 ++++++++++++++++++++++++++++++---------- system-test/datastore.ts | 14 +++++++ 3 files changed, 94 insertions(+), 21 deletions(-) diff --git a/src/query.ts b/src/query.ts index d4891f58f..df550beff 100644 --- a/src/query.ts +++ b/src/query.ts @@ -71,6 +71,7 @@ export interface Filter { * ``` */ class Query { + aggregations: Array; scope?: Datastore | Transaction; namespace?: string | null; kinds: string[]; @@ -159,6 +160,18 @@ class Query { * @type {number} */ this.offsetVal = -1; + /** + * @name Query#aggregations + * @type {array} + */ + this.aggregations = []; + } + + count(maximum: number, alias: string) { + const count = Object.assign({}, maximum ? {up_to: maximum} : null); + const aggregation = Object.assign({count}, alias ? {} : null) + this.aggregations.push(aggregation); + return this; } /** diff --git a/src/request.ts b/src/request.ts index e93dd1154..0a50ffa40 100644 --- a/src/request.ts +++ b/src/request.ts @@ -728,13 +728,14 @@ class DatastoreRequest { * ``` */ runQueryStream(query: Query, options: RunQueryStreamOptions = {}): Transform { - query = extend(true, new Query(), query); + query = extend(true, new Query(), query); const makeRequest = (query: Query) => { - const reqOpts = {} as RequestOptions; + const sharedQueryOpts = {} as SharedQueryOptions; + let queryProto: QueryProto; try { - reqOpts.query = entity.queryToQueryProto(query); + queryProto = entity.queryToQueryProto(query); } catch (e) { // using setImmediate here to make sure this doesn't throw a // synchronous error @@ -744,26 +745,58 @@ class DatastoreRequest { if (options.consistency) { const code = CONSISTENCY_PROTO_CODE[options.consistency.toLowerCase()]; - reqOpts.readOptions = { + sharedQueryOpts.readOptions = { readConsistency: code, }; } if (query.namespace) { - reqOpts.partitionId = { + sharedQueryOpts.partitionId = { namespaceId: query.namespace, }; } - this.request_( - { - client: 'DatastoreClient', - method: 'runQuery', - reqOpts, - gaxOpts: options.gaxOptions, - }, - onResultSet - ); + if (query.aggregations.length === 0) { + const reqOpts: RequestOptions = sharedQueryOpts; + reqOpts.query = queryProto; + console.log('Non aggregate'); + console.log(reqOpts); + this.request_( + { + client: 'DatastoreClient', + method: 'runQuery', + reqOpts, + gaxOpts: options.gaxOptions, + }, + onResultSet + ); + } else { + const aggregationQueryOptions: AggregationQueryOptions = { + query_type: { + nested_query: queryProto, + }, + aggregations: query.aggregations + }; + const reqOpts: RunAggregationQueryRequest = Object.assign( + sharedQueryOpts, + {query_type: + { + aggregation_query: aggregationQueryOptions + } + } + ); + console.log('Aggregate'); + console.log(reqOpts); + this.request_( + { + client: 'DatastoreClient', + method: 'runAggregationQuery', + reqOpts, + gaxOpts: options.gaxOptions, + }, + onResultSet + ); + } }; function onResultSet(err?: Error | null, resp?: Entity) { @@ -857,7 +890,7 @@ class DatastoreRequest { callback?: SaveCallback ): void | Promise { const transaction = this.datastore.transaction(); - transaction.run(async err => { + transaction.run(async (err: any) => { if (err) { try { await transaction.rollback(); @@ -932,7 +965,7 @@ class DatastoreRequest { }; } - datastore.auth.getProjectId((err, projectId) => { + datastore.auth.getProjectId((err: any, projectId: string) => { if (err) { callback!(err); return; @@ -1066,27 +1099,40 @@ export interface RequestConfig { prepared?: boolean; reqOpts?: RequestOptions; } -export interface RequestOptions { - mutations?: google.datastore.v1.IMutation[]; - keys?: Entity; +export interface SharedQueryOptions { + projectId?: string; + partitionId?: google.datastore.v1.IPartitionId | null; readOptions?: { readConsistency?: number; transaction?: string; readTime?: ITimestamp; }; - partitionId?: google.datastore.v1.IPartitionId | null; +} +export interface RequestOptions extends SharedQueryOptions{ + mutations?: google.datastore.v1.IMutation[]; + keys?: Entity; transactionOptions?: { readOnly?: {}; readWrite?: {previousTransaction?: string}; } | null; transaction?: string | null; mode?: string; - projectId?: string; query?: QueryProto; filter?: string; indexId?: string; entityFilter?: google.datastore.admin.v1.IEntityFilter; } +export interface RunAggregationQueryRequest extends SharedQueryOptions{ + query_type: { + aggregation_query: AggregationQueryOptions + } +} +export interface AggregationQueryOptions { + query_type: { + nested_query: QueryProto, + } + aggregations: Array +} export type RunQueryStreamOptions = RunQueryOptions; export interface CommitCallback { (err?: Error | null, resp?: google.datastore.v1.ICommitResponse): void; diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 1a778c02d..b622613cc 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -797,6 +797,20 @@ describe('Datastore', () => { const [entities] = await datastore.runQuery(q); assert.strictEqual(entities!.length, 6); }); + it('should do a count aggregate filter', async () => { + // TODO: count with alias & up_to and also multiple count filters + console.log('running stream'); + const q = datastore + .createQuery('Character') + .hasAncestor(ancestor) + .filter('family', 'Stark') + .filter('appearances', '>=', 20) + .count(); + const result = await datastore.runQuery(q); + console.log('result'); + console.log(result); + assert.strictEqual(result, 6); + }); it('should filter by ancestor', async () => { const q = datastore.createQuery('Character').hasAncestor(ancestor); From 259141cd6c18efe13960330330c2bffba4aef61f Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 26 Jul 2022 16:58:22 -0400 Subject: [PATCH 03/67] Checkout index.ts previous version --- src/index.ts | 1916 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1891 insertions(+), 25 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9dc4ec49b..48ec56d95 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,25 +1,1891 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const DatastoreClient = v1.DatastoreClient; -type DatastoreClient = v1.DatastoreClient; -export {v1, DatastoreClient}; -export default {v1, DatastoreClient}; -import * as protos from '../protos/protos'; -export {protos} +/*! + * Copyright 2018 Google LLC. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @namespace google + */ +/** + * @namespace google.datastore.v1 + */ +/** + * @namespace google.protobuf + */ + +import arrify = require('arrify'); +import extend = require('extend'); +import { + GrpcClient, + ClientStub, + ChannelCredentials, + GoogleAuth, + GoogleAuthOptions, + CallOptions, + Operation, + ServiceError, +} from 'google-gax'; +import * as is from 'is'; +import {Transform, pipeline} from 'stream'; + +import {entity, Entities, Entity, EntityProto, ValueProto} from './entity'; +import Key = entity.Key; +export {Entity, Key}; + +import { + GetIndexesCallback, + GetIndexesOptions, + GetIndexesResponse, + IIndex, + Index, +} from './index-class'; +import {Query} from './query'; +import { + DatastoreRequest, + CommitCallback, + CommitResponse, + PrepareEntityObjectResponse, + SaveCallback, + SaveResponse, + Mutation, + RequestOptions, +} from './request'; +import {Transaction} from './transaction'; +import {promisifyAll} from '@google-cloud/promisify'; +import {google} from '../protos/protos'; + +const {grpc} = new GrpcClient(); + +export type PathType = string | number | entity.Int; +export interface BooleanObject { + [key: string]: boolean; +} +export interface EntityProtoReduceAccumulator { + [key: string]: ValueProto; +} +export interface EntityProtoReduceData { + value: ValueProto; + excludeFromIndexes: ValueProto; + name: string | number; +} +export type UpdateCallback = CommitCallback; +export type UpdateResponse = CommitResponse; +export type UpsertCallback = CommitCallback; +export type UpsertResponse = CommitResponse; +export type InsertCallback = CommitCallback; +export type InsertResponse = CommitResponse; + +export interface LongRunningCallback { + ( + err: ServiceError | null, + operation?: Operation, + apiResponse?: google.longrunning.IOperation + ): void; +} +export type LongRunningResponse = [Operation, google.longrunning.IOperation]; + +export interface ExportEntitiesConfig + extends Omit { + bucket?: string | {name: string}; + kinds?: string[]; + namespaces?: string[]; + gaxOptions?: CallOptions; +} + +export interface ImportEntitiesConfig + extends Omit { + file?: string | {bucket: {name: string}; name: string}; + kinds?: string[]; + namespaces?: string[]; + gaxOptions?: CallOptions; +} + +// Import the clients for each version supported by this package. +const gapic = Object.freeze({ + v1: require('./v1'), +}); + +const urlSafeKey = new entity.URLSafeKey(); + +/** + * Idiomatic class for interacting with Cloud Datastore. Uses the lower-level + * {@link DatastoreClient} class under the hood. + * + * In addition to the constructor options shown here, the {@link Datastore} + * class constructor accepts the same options accepted by + * {@link DatastoreClient}. + * + *

The Datastore Emulator

+ * + * Make sure you have the + * gcloud SDK installed, then run: + * + *
+ *   $ gcloud beta emulators datastore start --no-legacy
+ * 
+ * + * You will see the following printed: + * + *
+ *   [datastore] API endpoint: http://localhost:8005
+ *   [datastore] If you are using a library that supports the
+ *               DATASTORE_EMULATOR_HOST environment variable, run:
+ *   [datastore]
+ *   [datastore]   export DATASTORE_EMULATOR_HOST=localhost:8005
+ *   [datastore]
+ *   [datastore] Dev App Server is now running.
+ * 
+ * + * Set that environment variable and your localhost Datastore will + * automatically be used. You can also pass this address in manually with + * `apiEndpoint`. + * + * Additionally, `DATASTORE_PROJECT_ID` is recognized. If you have this set, + * you don't need to provide a `projectId`. + * + * + * See {@link https://cloud.google.com/datastore/docs/concepts/overview| Cloud Datastore Concepts Overview} + * + * @param {object} [options] Configuration options. + * @param {string} [options.apiEndpoint] Override the default API endpoint used + * to reach Datastore. This is useful for connecting to your local Datastore + * server (usually "http://localhost:8080"). + * @param {string} [options.namespace] Namespace to isolate transactions to. + * + * @example Import the client library + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * + * ``` + * @example Create a client that uses Application Default Credentials (ADC): + * ``` + * const datastore = new Datastore(); + * + * ``` + * @example Create a client with explicit credentials: + * ``` + * const datastore = new Datastore({ + * projectId: 'your-project-id', + * keyFilename: '/path/to/keyfile.json' + * }); + * + * ``` + * @example Retrieving Records + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * + * // Records, called "entities" in Datastore, are retrieved by using a key. The + * // key is more than a numeric identifier, it is a complex data structure that + * // can be used to model relationships. The simplest key has a string `kind` + * // value, and either a numeric `id` value, or a string `name` value. + * // + * // A single record can be retrieved with {@link Datastore#key} and + * // {@link Datastore#get}. + * //- + * const key = datastore.key(['Company', 'Google']); + * + * datastore.get(key, function(err, entity) { + * // entity = The record. + * // entity[datastore.KEY] = The key for this entity. + * }); + * + * //- + * //

Querying Records

+ * // + * // Create a query with {@link Datastore#createQuery}. + * //- + * const query = datastore.createQuery('Company'); + * + * //- + * // Multiple records can be found that match criteria with + * // {@link Query#filter}. + * //- + * query.filter('location', 'CA'); + * + * //- + * // Records can also be ordered with {@link Query#order}. + * //- + * query.order('name'); + * + * //- + * // The number of records returned can be specified with + * // {@link Query#limit}. + * //- + * query.limit(5); + * + * //- + * // Records' key structures can also be queried with + * // {@link Query#hasAncestor}. + * //- + * const ancestorKey = datastore.key(['ParentCompany', 'Alphabet']); + * + * query.hasAncestor(ancestorKey); + * + * //- + * // Run the query with {@link Datastore#runQuery}. + * //- + * datastore.runQuery(query, (err, entities) => { + * // entities = An array of records. + * + * // Access the Key object for an entity. + * const firstEntityKey = entities[0][datastore.KEY]; + * }); + * + * ``` + * @example Paginating Records + * ``` + * // Imagine building a website that allows a user to sift through hundreds of + * // their contacts. You'll likely want to only display a subset of these at + * // once, so you set a limit. + * //- + * const express = require('express'); + * const app = express(); + * + * const NUM_RESULTS_PER_PAGE = 15; + * + * app.get('/contacts', (req, res) => { + * const query = datastore.createQuery('Contacts') + * .limit(NUM_RESULTS_PER_PAGE); + * + * if (req.query.nextPageCursor) { + * query.start(req.query.nextPageCursor); + * } + * + * datastore.runQuery(query, (err, entities, info) => { + * if (err) { + * // Error handling omitted. + * return; + * } + * + * // Respond to the front end with the contacts and the cursoring token + * // from the query we just ran. + * const frontEndResponse = { + * contacts: entities + * }; + * + * // Check if more results may exist. + * if (info.moreResults !== datastore.NO_MORE_RESULTS) { + * frontEndResponse.nextPageCursor = info.endCursor; + * } + * + * res.render('contacts', frontEndResponse); + * }); + * }); + * + * ``` + * @example Creating Records + * ``` + * // New entities can be created and persisted with {@link Datastore#save}. + * // The entitiy must have a key to be saved. If you don't specify an + * // identifier for the key, one is generated for you. + * // + * // We will create a key with a `name` identifier, "Google". + * //- + * const key = datastore.key(['Company', 'Google']); + * + * const data = { + * name: 'Google', + * location: 'CA' + * }; + * + * datastore.save({ + * key: key, + * data: data + * }, (err) => { + * if (!err) { + * // Record saved successfully. + * } + * }); + * + * //- + * // We can verify the data was saved by using {@link Datastore#get}. + * //- + * datastore.get(key, (err, entity) => { + * // entity = { + * // name: 'Google', + * // location: 'CA' + * // } + * }); + * + * //- + * // If we want to update this record, we can modify the data object and re- + * // save it. + * //- + * data.symbol = 'GOOG'; + * + * datastore.save({ + * key: key, // defined above (datastore.key(['Company', 'Google'])) + * data: data + * }, (err, entity) => { + * if (!err) { + * // Record updated successfully. + * } + * }); + * + * ``` + * @example Deleting Records + * ``` + * // Entities can be removed from Datastore by passing the entity's key object + * // to {@link Datastore#delete}. + * //- + * const key = datastore.key(['Company', 'Google']); + * + * datastore.delete(key, (err) => { + * if (!err) { + * // Record deleted successfully. + * } + * }); + * + * ``` + * @example Transactions + * ``` + * // Complex logic can be wrapped in a transaction with + * // {@link Datastore#transaction}. All queries and updates run within + * // the transaction will be applied when the `done` function is called. + * //- + * const transaction = datastore.transaction(); + * + * transaction.run((err) => { + * if (err) { + * // Error handling omitted. + * } + * + * const key = datastore.key(['Company', 'Google']); + * + * transaction.get(key, (err, entity) => { + * if (err) { + * // Error handling omitted. + * } + * + * entity.symbol = 'GOOG'; + * + * transaction.save(entity); + * + * transaction.commit((err) => { + * if (!err) { + * // Transaction committed successfully. + * } + * }); + * }); + * }); + * + * ``` + * @example Queries with Ancestors + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * + * const customerId1 = 2993844; + * const customerId2 = 4993882; + * const customerKey1 = datastore.key(['Customer', customerId1]); + * const customerKey2 = datastore.key(['Customer', customerId2]); + * const cookieKey1 = datastore.key(['Customer', customerId1, 'Cookie', + * 'cookie28839']); // child entity const cookieKey2 = + * datastore.key(['Customer', customerId1, 'Cookie', 'cookie78984']); // child + * entity const cookieKey3 = datastore.key(['Customer', customerId2, 'Cookie', + * 'cookie93911']); // child entity + * + * const entities = []; + * + * entities.push({ + * key: customerKey1, + * data: { + * name: 'Jane Doe', + * address: '4848 Liller' + * } + * }); + * + * entities.push({ + * key: customerKey2, + * data: { + * name: 'John Smith', + * address: '4848 Pine' + * } + * }); + * + * entities.push({ + * key: cookieKey1, + * data: { + * cookieVal: 'dj83kks88rkld' + * } + * }); + * + * entities.push({ + * key: cookieKey2, + * data: { + * cookieVal: 'sj843ka99s' + * } + * }); + * + * entities.push({ + * key: cookieKey3, + * data: { + * cookieVal: 'otk82k2kw' + * } + * }); + * + * datastore.upsert(entities); + * + * const query = datastore.createQuery().hasAncestor(customerKey1); + * + * datastore.runQuery(query, (err, entities) => { + * for (let entity of entities) { + * console.log(entity[datastore.KEY]); + * } + * }); + * + * const query2 = datastore.createQuery().hasAncestor(customerKey2); + * + * datastore.runQuery(query2, (err, entities) => { + * for (let entity of entities) { + * console.log(entity[datastore.KEY]); + * } + * }); + * + * datastore.runQuery(query2, (entities) => { + * console.log(entities); + * }); + * ``` + */ +class Datastore extends DatastoreRequest { + clients_: Map; + namespace?: string; + defaultBaseUrl_: string; + options: DatastoreOptions; + baseUrl_?: string; + port_?: number; + customEndpoint_?: boolean; + auth: GoogleAuth; + constructor(options?: DatastoreOptions) { + super(); + options = options || {}; + this.clients_ = new Map(); + this.datastore = this; + + /** + * @name Datastore#namespace + * @type {string} + */ + this.namespace = options.namespace; + + options.projectId = options.projectId || process.env.DATASTORE_PROJECT_ID; + + this.defaultBaseUrl_ = 'datastore.googleapis.com'; + this.determineBaseUrl_(options.apiEndpoint); + + const scopes: string[] = Array.from( + new Set([ + ...gapic.v1.DatastoreClient.scopes, + ...gapic.v1.DatastoreAdminClient.scopes, + ]) + ); + + this.options = Object.assign( + { + libName: 'gccl', + libVersion: require('../../package.json').version, + scopes, + servicePath: this.baseUrl_, + port: typeof this.port_ === 'number' ? this.port_ : 443, + }, + options + ); + if (this.customEndpoint_) { + this.options.sslCreds = grpc.credentials.createInsecure(); + } + + this.auth = new GoogleAuth(this.options); + } + + /** + * Export entities from this project to a Google Cloud Storage bucket. + * + * @param {ExportEntitiesConfig} config Configuration object. + * @param {string | Bucket} config.bucket The `gs://bucket` path or a + * @google-cloud/storage Bucket object. + * @param {string[]} [config.kinds] The kinds to include in this import. + * @param {string[]} [config.namespaces] The namespace IDs to include in this + * import. + * @param {object} [config.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + */ + export(config: ExportEntitiesConfig): Promise; + export(config: ExportEntitiesConfig, callback: LongRunningCallback): void; + export( + config: ExportEntitiesConfig, + callback?: LongRunningCallback + ): void | Promise { + const reqOpts: ExportEntitiesConfig = { + entityFilter: {}, + ...config, + }; + + if (reqOpts.bucket && reqOpts.outputUrlPrefix) { + throw new Error('Both `bucket` and `outputUrlPrefix` were provided.'); + } + + if (!reqOpts.outputUrlPrefix) { + if (typeof config.bucket === 'string') { + reqOpts.outputUrlPrefix = `gs://${config.bucket.replace('gs://', '')}`; + } else if (typeof config.bucket === 'object') { + reqOpts.outputUrlPrefix = `gs://${config.bucket.name}`; + } else { + throw new Error('A Bucket object or URL must be provided.'); + } + } + + if (reqOpts.kinds) { + if (typeof config.entityFilter === 'object') { + throw new Error('Both `entityFilter` and `kinds` were provided.'); + } + reqOpts.entityFilter!.kinds = reqOpts.kinds; + } + + if (reqOpts.namespaces) { + if (typeof config.entityFilter === 'object') { + throw new Error('Both `entityFilter` and `namespaces` were provided.'); + } + reqOpts.entityFilter!.namespaceIds = reqOpts.namespaces; + } + + delete reqOpts.bucket; + delete reqOpts.gaxOptions; + delete reqOpts.kinds; + delete reqOpts.namespaces; + + this.request_( + { + client: 'DatastoreAdminClient', + method: 'exportEntities', + reqOpts: reqOpts as RequestOptions, + gaxOpts: config.gaxOptions, + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback as any + ); + } + + /** + * Get all of the indexes in this project. + * + * @param {GetIndexesOptions | GetIndexesCallback} [optionsOrCallback] + * @param {object} [options.gaxOptions] Request configuration options, + * outlined here: + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {GetIndexesResponse} [callback] The callback function. + * @param {?error} callback.error An error returned while making this request. + * @param {Index[]} callback.indexes All matching Index instances. + * @param {object} callback.apiResponse The full API response. + * @return {void | Promise} + */ + getIndexes(options?: GetIndexesOptions): Promise; + getIndexes(options: GetIndexesOptions, callback: GetIndexesCallback): void; + getIndexes(callback: GetIndexesCallback): void; + getIndexes( + optionsOrCallback?: GetIndexesOptions | GetIndexesCallback, + cb?: GetIndexesCallback + ): void | Promise { + let options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + options = extend(true, {}, options); + + const gaxOpts = options.gaxOptions || {}; + + const reqOpts = { + pageSize: (gaxOpts as GetIndexesOptions).pageSize, + pageToken: (gaxOpts as GetIndexesOptions).pageToken, + ...options, + }; + + delete (gaxOpts as GetIndexesOptions).pageSize; + delete (gaxOpts as GetIndexesOptions).pageToken; + delete (reqOpts as CallOptions).autoPaginate; + delete (reqOpts as GetIndexesOptions).gaxOptions; + + if ( + typeof options.autoPaginate === 'boolean' && + typeof gaxOpts.autoPaginate === 'undefined' + ) { + gaxOpts.autoPaginate = options.autoPaginate; + } + + this.request_( + { + client: 'DatastoreAdminClient', + method: 'listIndexes', + reqOpts, + gaxOpts, + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (err, ...resp: any[]) => { + let indexes: Index[] = []; + + if (resp[0]) { + indexes = resp[0].map((index: IIndex) => { + const indexInstance = this.index(index.indexId!); + indexInstance.metadata = index; + return indexInstance; + }); + } + + const nextQuery = resp[1]! ? Object.assign(options, resp[1]) : null; + const apiResp: google.datastore.admin.v1.IListIndexesResponse = resp[2]; + + callback(err as ServiceError, indexes, nextQuery, apiResp); + } + ); + } + + /** + * Get all of the indexes in this project as a readable object stream. + * + * @param {GetIndexesOptions} [options] Configuration object. See + * {@link Datastore#getIndexes} for a complete list of options. + * @returns {ReadableStream} + */ + getIndexesStream(options?: GetIndexesOptions): NodeJS.ReadableStream { + const {gaxOptions, ...reqOpts} = options || {}; + return pipeline( + this.requestStream_({ + client: 'DatastoreAdminClient', + method: 'listIndexesStream', + reqOpts, + gaxOpts: gaxOptions, + }), + new Transform({ + objectMode: true, + transform: (index: IIndex, enc: string, next: Function) => { + const indexInstance = this.index(index.indexId!); + indexInstance.metadata = index; + next(null, indexInstance); + }, + }), + () => {} + ); + } + + getProjectId(): Promise { + return this.auth.getProjectId(); + } + + /** + * Import entities into this project from a remote file. + * + * @param {ImportEntitiesConfig} config Configuration object. + * @param {string | File} config.file The `gs://bucket/file` path or a + * @google-cloud/storage File object. + * @param {string[]} [config.kinds] The kinds to include in this import. + * @param {string[]} [config.namespaces] The namespace IDs to include in this + * import. + * @param {object} [config.gaxOptions] Request configuration options, outlined + * here: https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request. + * @param {Operation} callback.operation An operation object that can be used + * to check the status of the request. + */ + import(config: ImportEntitiesConfig): Promise; + import(config: ImportEntitiesConfig, callback: LongRunningCallback): void; + import( + config: ImportEntitiesConfig, + callback?: LongRunningCallback + ): void | Promise { + const reqOpts: ImportEntitiesConfig = { + entityFilter: {}, + ...config, + }; + + if (config.file && config.inputUrl) { + throw new Error('Both `file` and `inputUrl` were provided.'); + } + + if (!reqOpts.inputUrl) { + if (typeof config.file === 'string') { + reqOpts.inputUrl = `gs://${config.file.replace('gs://', '')}`; + } else if (typeof config.file === 'object') { + reqOpts.inputUrl = `gs://${config.file.bucket.name}/${config.file.name}`; + } else { + throw new Error('An input URL must be provided.'); + } + } + + if (reqOpts.kinds) { + if (typeof config.entityFilter === 'object') { + throw new Error('Both `entityFilter` and `kinds` were provided.'); + } + reqOpts.entityFilter!.kinds = reqOpts.kinds; + } + + if (reqOpts.namespaces) { + if (typeof config.entityFilter === 'object') { + throw new Error('Both `entityFilter` and `namespaces` were provided.'); + } + reqOpts.entityFilter!.namespaceIds = reqOpts.namespaces; + } + + delete reqOpts.file; + delete reqOpts.gaxOptions; + delete reqOpts.kinds; + delete reqOpts.namespaces; + + this.request_( + { + client: 'DatastoreAdminClient', + method: 'importEntities', + reqOpts: reqOpts as RequestOptions, + gaxOpts: config.gaxOptions, + }, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + callback as any + ); + } + + /** + * Get a reference to an Index. + * + * @param {string} id The index name or id. + * @returns {Index} + */ + index(id: string): Index { + return new Index(this, id); + } + + /** + * Maps to {@link Datastore#save}, forcing the method to be `insert`. + * + * @param {object|object[]} entities Datastore key object(s). + * @param {Key} entities.key Datastore key object. + * @param {string[]} [entities.excludeFromIndexes] Exclude properties from + * indexing using a simple JSON path notation. See the examples in + * {@link Datastore#save} to see how to target properties at different + * levels of nesting within your entity. + * @param {object} entities.data Data to save with the provided key. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request + * @param {object} callback.apiResponse The full API response. + */ + insert(entities: Entities): Promise; + insert(entities: Entities, callback: InsertCallback): void; + insert( + entities: Entities, + callback?: InsertCallback + ): void | Promise { + entities = arrify(entities) + .map(DatastoreRequest.prepareEntityObject_) + .map((x: PrepareEntityObjectResponse) => { + x.method = 'insert'; + return x; + }); + + this.save(entities, callback!); + } + + /** + * Insert or update the specified object(s). If a key is incomplete, its + * associated object is inserted and the original Key object is updated to + * contain the generated ID. + * + * This method will determine the correct Datastore method to execute + * (`upsert`, `insert`, or `update`) by using the key(s) provided. For + * example, if you provide an incomplete key (one without an ID), the request + * will create a new entity and have its ID automatically assigned. If you + * provide a complete key, the entity will be updated with the data specified. + * + * By default, all properties are indexed. To prevent a property from being + * included in *all* indexes, you must supply an `excludeFromIndexes` array. + * + * To prevent large properties from being included in *all* indexes, you must supply + * `excludeLargeProperties: true`. + * See below for an example. + * + * @borrows {@link Transaction#save} as save + * + * @throws {Error} If an unrecognized method is provided. + * + * @param {object|object[]} entities Datastore key object(s). + * @param {Key} entities.key Datastore key object. + * @param {string[]} [entities.excludeFromIndexes] Exclude properties from + * indexing using a simple JSON path notation. See the example below to + * see how to target properties at different levels of nesting within your + * @param {boolean} [entities.excludeLargeProperties] Automatically exclude + * large properties from indexing. It help in storing large values. + * @param {string} [entities.method] Explicit method to use, either 'insert', + * 'update', or 'upsert'. + * @param {object} entities.data Data to save with the provided key. + * entity. + * @param {object} [gaxOptions] Request configuration options, outlined here: + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request + * @param {object} callback.apiResponse The full API response. + * + * @example + * ``` + * //- + * // Save a single entity. + * // + * // Notice that we are providing an incomplete key. After saving, the + * // original Key object used to save will be updated to contain the path + * // with its generated ID. + * //- + * const key = datastore.key('Company'); + * const entity = { + * key: key, + * data: { + * rating: '10' + * } + * }; + * + * datastore.save(entity, (err) => { + * console.log(key.path); // [ 'Company', 5669468231434240 ] + * console.log(key.namespace); // undefined + * }); + * + * //- + * // Save a single entity using a provided name instead of auto-generated ID. + * // + * // Here we are providing a key with name instead of an ID. After saving, + * // the original Key object used to save will be updated to contain the + * // path with the name instead of a generated ID. + * //- + * const key = datastore.key(['Company', 'donutshack']); + * const entity = { + * key: key, + * data: { + * name: 'DonutShack', + * rating: 8 + * } + * }; + * + * datastore.save(entity, (err) => { + * console.log(key.path); // ['Company', 'donutshack'] + * console.log(key.namespace); // undefined + * }); + * + * //- + * // Save a single entity with a provided namespace. Namespaces allow for + * // multitenancy. To read more about this, see + * // [the Datastore docs on key concepts](https://goo.gl/M1LUAu). + * // + * // Here we are providing a key with namespace. + * //- + * const key = datastore.key({ + * namespace: 'my-namespace', + * path: ['Company', 'donutshack'] + * }); + * + * const entity = { + * key: key, + * data: { + * name: 'DonutShack', + * rating: 8 + * } + * }; + * + * datastore.save(entity, (err) => { + * console.log(key.path); // ['Company', 'donutshack'] + * console.log(key.namespace); // 'my-namespace' + * }); + * + * //- + * // Save different types of data, including ints, doubles, dates, booleans, + * // blobs, and lists. + * // + * // Notice that we are providing an incomplete key. After saving, the + * // original Key object used to save will be updated to contain the path + * // with its generated ID. + * //- + * const key = datastore.key('Company'); + * const entity = { + * key: key, + * data: { + * name: 'DonutShack', + * rating: datastore.int(10), + * worth: datastore.double(123456.78), + * location: datastore.geoPoint({ + * latitude: 40.6894, + * longitude: -74.0447 + * }), + * numDonutsServed: 45, + * founded: new Date('Tue May 12 2015 15:30:00 GMT-0400 (EDT)'), + * isStartup: true, + * donutEmoji: Buffer.from('\uD83C\uDF69'), + * keywords: [ + * 'donut', + * 'coffee', + * 'yum' + * ] + * } + * }; + * + * datastore.save(entity, (err, apiResponse) => {}); + * + * //- + * // Use an array, `excludeFromIndexes`, to exclude properties from indexing. + * // This will allow storing string values larger than 1500 bytes. + * //- + * const entity = { + * key: datastore.key('Company'), + * excludeFromIndexes: [ + * 'description', + * 'embeddedEntity.description', + * 'arrayValue[]', + * 'arrayValue[].description' + * ], + * data: { + * description: 'Long string (...)', + * embeddedEntity: { + * description: 'Long string (...)' + * }, + * arrayValue: [ + * 'Long string (...)', + * { + * description: 'Long string (...)' + * } + * ] + * } + * }; + * + * datastore.save(entity, (err, apiResponse) => {}); + * + * //- + * // Use boolean `excludeLargeProperties`, to auto exclude Large properties from indexing. + * // This will allow storing string values larger than 1500 bytes. + * //- + * const entity = { + * key: datastore.key('Company'), + * data: { + * description: 'Long string (...)', + * embeddedEntity: { + * description: 'Long string (...)' + * }, + * arrayValue: [ + * 'Long string (...)', + * { + * description: 'Long string (...)' + * } + * ] + * }, + * excludeLargeProperties: true + * }; + * + * datastore.save(entity, (err, apiResponse) => {}); + * + * //- + * // Save multiple entities at once. + * //- + * const companyKey = datastore.key(['Company', 123]); + * const productKey = datastore.key(['Product', 'Computer']); + * const entities = [ + * { + * key: companyKey, + * data: { + * HQ: 'Dallas, TX' + * } + * }, + * { + * key: productKey, + * data: { + * vendor: 'Dell' + * } + * } + * ]; + * + * datastore.save(entities, (err, apiResponse) => {}); + * + * //- + * // Explicitly attempt to 'insert' a specific entity. + * //- + * const userKey = datastore.key(['User', 'chilts']); + * const entity = { + * key: userKey, + * method: 'insert', + * data: { + * fullName: 'Andrew Chilton' + * } + * }; + * + * datastore.save(entity, (err, apiResponse) => {}); + * + * //- + * // Returns a Promise if callback is omitted. + * //- + * datastore.save(entity).then((data) => { + * const apiResponse = data[0]; + * }); + * ``` + */ + save(entities: Entities, gaxOptions?: CallOptions): Promise; + save( + entities: Entities, + gaxOptions: CallOptions, + callback: SaveCallback + ): void; + save(entities: Entities, callback: SaveCallback): void; + save( + entities: Entities, + gaxOptionsOrCallback?: CallOptions | SaveCallback, + cb?: SaveCallback + ): void | Promise { + entities = arrify(entities); + const gaxOptions = + typeof gaxOptionsOrCallback === 'object' ? gaxOptionsOrCallback : {}; + const callback = + typeof gaxOptionsOrCallback === 'function' ? gaxOptionsOrCallback : cb!; + + const insertIndexes: BooleanObject = {}; + const mutations: google.datastore.v1.IMutation[] = []; + const methods: BooleanObject = { + insert: true, + update: true, + upsert: true, + }; + + // Iterate over the entity objects, build a proto from all keys and values, + // then place in the correct mutation array (insert, update, etc). + entities + .map(DatastoreRequest.prepareEntityObject_) + .forEach((entityObject: Entity, index: number) => { + const mutation: Mutation = {}; + let entityProto: EntityProto = {}; + let method = 'upsert'; + + if (entityObject.method) { + if (methods[entityObject.method]) { + method = entityObject.method; + } else { + throw new Error( + 'Method ' + entityObject.method + ' not recognized.' + ); + } + } + + if (entityObject.excludeLargeProperties) { + entityObject.excludeFromIndexes = entity.findLargeProperties_( + entityObject.data, + '', + entityObject.excludeFromIndexes + ); + } + + if (!entity.isKeyComplete(entityObject.key)) { + insertIndexes[index] = true; + } + + // @TODO remove in @google-cloud/datastore@2.0.0 + // This was replaced with a more efficient mechanism in the top-level + // `excludeFromIndexes` option. + if (Array.isArray(entityObject.data)) { + entityProto.properties = entityObject.data.reduce( + ( + acc: EntityProtoReduceAccumulator, + data: EntityProtoReduceData + ) => { + const value = entity.encodeValue( + data.value, + data.name.toString() + ); + + if (typeof data.excludeFromIndexes === 'boolean') { + const excluded = data.excludeFromIndexes; + let values = value.arrayValue && value.arrayValue.values; + + if (values) { + values = values.map((x: ValueProto) => { + x.excludeFromIndexes = excluded; + return x; + }); + } else { + value.excludeFromIndexes = data.excludeFromIndexes; + } + } + + acc[data.name] = value; + + return acc; + }, + {} + ); + } else { + entityProto = entity.entityToEntityProto(entityObject); + } + + entityProto.key = entity.keyToKeyProto(entityObject.key); + + mutation[method] = entityProto; + mutations.push(mutation); + }); + + const reqOpts = { + mutations, + }; + + function onCommit( + err?: Error | null, + resp?: google.datastore.v1.ICommitResponse + ) { + if (err || !resp) { + callback(err, resp); + return; + } + + arrify(resp.mutationResults).forEach((result, index) => { + if (!result.key) { + return; + } + if (insertIndexes[index]) { + const id = entity.keyFromKeyProto(result.key).id; + entities[index].key.id = id; + } + }); + + callback(null, resp); + } + + if (this.id) { + this.requests_.push(reqOpts); + this.requestCallbacks_.push(onCommit); + return; + } + + this.request_( + { + client: 'DatastoreClient', + method: 'commit', + reqOpts, + gaxOpts: gaxOptions, + }, + onCommit + ); + } + + /** + * Maps to {@link Datastore#save}, forcing the method to be `update`. + * + * @param {object|object[]} entities Datastore key object(s). + * @param {Key} entities.key Datastore key object. + * @param {string[]} [entities.excludeFromIndexes] Exclude properties from + * indexing using a simple JSON path notation. See the examples in + * {@link Datastore#save} to see how to target properties at different + * levels of nesting within your entity. + * @param {object} entities.data Data to save with the provided key. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request + * @param {object} callback.apiResponse The full API response. + */ + update(entities: Entities): Promise; + update(entities: Entities, callback: UpdateCallback): void; + update( + entities: Entities, + callback?: UpdateCallback + ): void | Promise { + entities = arrify(entities) + .map(DatastoreRequest.prepareEntityObject_) + .map((x: PrepareEntityObjectResponse) => { + x.method = 'update'; + return x; + }); + + this.save(entities, callback!); + } + + /** + * Maps to {@link Datastore#save}, forcing the method to be `upsert`. + * + * @param {object|object[]} entities Datastore key object(s). + * @param {Key} entities.key Datastore key object. + * @param {string[]} [entities.excludeFromIndexes] Exclude properties from + * indexing using a simple JSON path notation. See the examples in + * {@link Datastore#save} to see how to target properties at different + * levels of nesting within your entity. + * @param {object} entities.data Data to save with the provided key. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request + * @param {object} callback.apiResponse The full API response. + */ + upsert(entities: Entities): Promise; + upsert(entities: Entities, callback: UpsertCallback): void; + upsert( + entities: Entities, + callback?: UpsertCallback + ): void | Promise { + entities = arrify(entities) + .map(DatastoreRequest.prepareEntityObject_) + .map((x: PrepareEntityObjectResponse) => { + x.method = 'upsert'; + return x; + }); + + this.save(entities, callback!); + } + + /** + * Helper function to get a Datastore Double object. + * + * @param {number} value The double value. + * @returns {object} + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const threeDouble = datastore.double(3.0); + * ``` + */ + static double(value: number) { + return new entity.Double(value); + } + + double(value: number) { + return Datastore.double(value); + } + + /** + * Helper function to check if something is a Datastore Double object. + * + * @param {*} value + * @returns {boolean} + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * datastore.isDouble(0.42); // false + * datastore.isDouble(datastore.double(0.42)); // true + * ``` + */ + static isDouble(value?: {}) { + return entity.isDsDouble(value); + } + + isDouble(value?: {}) { + return Datastore.isDouble(value); + } + + /** + * Helper function to get a Datastore Geo Point object. + * + * @param {object} coordinates Coordinate value. + * @param {number} coordinates.latitude Latitudinal value. + * @param {number} coordinates.longitude Longitudinal value. + * @returns {object} + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const coordinates = { + * latitude: 40.6894, + * longitude: -74.0447 + * }; + * + * const geoPoint = datastore.geoPoint(coordinates); + * + * //- + * // List all companies that are located at 40.123 latitude + * // and -74.0447 longitude. + * //- + * const query = datastore.createQuery('Company'); + * const companyQuery = query + * .filter('geoPoint.latitude', datastore.double(40.123)) + * .filter('geoPoint.longitude', datastore.double(-74.0447)); + * ``` + */ + static geoPoint(coordinates: entity.Coordinates) { + return new entity.GeoPoint(coordinates); + } + + geoPoint(coordinates: entity.Coordinates) { + return Datastore.geoPoint(coordinates); + } + + /** + * Helper function to check if something is a Datastore Geo Point object. + * + * @param {*} value + * @returns {boolean} + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const coordinates = { + * latitude: 0, + * longitude: 0 + * }; + * + * datastore.isGeoPoint(coordinates); // false + * datastore.isGeoPoint(datastore.geoPoint(coordinates)); // true + * ``` + */ + static isGeoPoint(value?: {}) { + return entity.isDsGeoPoint(value); + } + + isGeoPoint(value?: {}) { + return Datastore.isGeoPoint(value); + } + + /** + * Helper function to get a Datastore Integer object. + * + * This is also useful when using an ID outside the bounds of a JavaScript + * Number object. + * + * @param {number} value The integer value. + * @returns {object} + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const sevenInteger = datastore.int(7); + * + * //- + * // Create an Int to support long Key IDs. + * //- + * const key = datastore.key([ + * 'Kind', + * datastore.int('100000000000001234') + * ]); + * ``` + */ + static int(value: number | string) { + return new entity.Int(value); + } + + int(value: number | string) { + return Datastore.int(value); + } + + /** + * Helper function to check if something is a Datastore Integer object. + * + * @param {*} value + * @returns {boolean} + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * datastore.isInt(42); // false + * datastore.isInt(datastore.int(42)); // true + * ``` + */ + static isInt(value?: {}) { + return entity.isDsInt(value); + } + + isInt(value?: {}) { + return Datastore.isInt(value); + } + + /** + * Access the Key from an Entity object. + * + * @name Datastore.KEY + * @type {symbol} + */ + /** + * Access the Key from an Entity object. + * + * @name Datastore#KEY + * @type {symbol} + */ + static KEY: typeof entity.KEY_SYMBOL = entity.KEY_SYMBOL; + KEY: typeof entity.KEY_SYMBOL = Datastore.KEY; + + /** + * This is one of three values which may be returned from + * {@link Datastore#runQuery}, {@link Transaction#runQuery}, and + * {@link Query#run} as `info.moreResults`. + * + * There *may* be more results after the specified end cursor. + * + * @type {string} + */ + static MORE_RESULTS_AFTER_CURSOR = 'MORE_RESULTS_AFTER_CURSOR'; + MORE_RESULTS_AFTER_CURSOR = Datastore.MORE_RESULTS_AFTER_CURSOR; + + /** + * This is one of three values which may be returned from + * {@link Datastore#runQuery}, {@link Transaction#runQuery}, and + * {@link Query#run} as `info.moreResults`. + * + * There *may* be more results after the specified limit. + * + * @type {string} + */ + static MORE_RESULTS_AFTER_LIMIT = 'MORE_RESULTS_AFTER_LIMIT'; + MORE_RESULTS_AFTER_LIMIT = Datastore.MORE_RESULTS_AFTER_LIMIT; + + /** + * This is one of three values which may be returned from + * {@link Datastore#runQuery}, {@link Transaction#runQuery}, and + * {@link Query#run} as `info.moreResults`. + * + * There are no more results left to query for. + * + * @type {string} + */ + static NO_MORE_RESULTS = 'NO_MORE_RESULTS'; + NO_MORE_RESULTS = Datastore.NO_MORE_RESULTS; + + /** + * Create a query for the specified kind. See {@link Query} for all + * of the available methods. + * + * @see {@link https://cloud.google.com/datastore/docs/concepts/queries| Datastore Queries} + * @see {@link Query} + * + * @param {string} [namespace] Namespace. + * @param {string} kind The kind to query. + * @returns {Query} + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const query = datastore.createQuery('Company'); + * ``` + */ + createQuery(kind?: string): Query; + createQuery(kind?: string[]): Query; + createQuery(namespace: string, kind: string): Query; + createQuery(namespace: string, kind: string[]): Query; + createQuery( + namespaceOrKind?: string | string[], + kind?: string | string[] + ): Query { + let namespace = namespaceOrKind as string; + if (!kind) { + kind = namespaceOrKind; + namespace = this.namespace!; + } + return new Query(this, namespace, arrify(kind) as string[]); + } + + /** + * Helper to create a Key object, scoped to the instance's namespace by + * default. + * + * You may also specify a configuration object to define a namespace and path. + * + * @param {object|string|array} [options] Key path. To specify or override a namespace, + * you must use an object here to explicitly state it. + * @param {string|array} [options.path] Key path. + * @param {string} [options.namespace] Optional namespace. + * @returns {Key} A newly created Key from the options given. + * + * @example + * ``` + * Create an incomplete key with a kind value of `Company`. + * Since no Id is supplied, Datastore will generate one on save. + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const key = datastore.key('Company'); + * + * ``` + * @example + * ``` + * Create a complete key with a kind value of `Company` and Id `123`. + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const key = datastore.key(['Company', 123]); + * + * ``` + * @example + * ``` + * If the ID integer is outside the bounds of a JavaScript Number + * object, create an Int. + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const key = datastore.key([ + * 'Company', + * datastore.int('100000000000001234') + * ]); + * + * ``` + * @example + * ``` + * Create a complete key with a kind value of `Company` and name `Google`. + * Because the supplied Id is a string, Datastore will prefix it with "name=". + * Had the supplied Id been numeric, Datastore would prefix it with the standard, "id=". + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const key = datastore.key(['Company', 'Google']); + * + * ``` + * @example + * ``` + * Create a complete key from a provided namespace and path. + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const key = datastore.key({ + * namespace: 'My-NS', + * path: ['Company', 123] + * }); + * + * ``` + * @example + * ``` + * Create a complete key that specifies an ancestor. This will create a Team entity + * with a name of "Datastore", which belongs to the Company with the "name=Google" key. + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const key = datastore.key(['Company', 'Google', 'Team', 'Datastore']); + * + * ``` + * @example + * ``` + * Create a incomplete key that specifies an ancestor. This will create an Employee entity + * with an auto-generated Id, which belongs to the Company with the "name=Google" key. + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const key = datastore.key(['Company', 'Google', 'Employee']); + * ``` + */ + key(options: entity.KeyOptions): entity.Key; + key(path: PathType[]): entity.Key; + key(path: string): entity.Key; + key(options: string | entity.KeyOptions | PathType[]): entity.Key { + const keyOptions = is.object(options) + ? (options as entity.KeyOptions) + : { + namespace: this.namespace, + path: arrify(options) as PathType[], + }; + return new entity.Key(keyOptions); + } + + /** + * Helper function to check if something is a Datastore Key object. + * + * @param {*} value + * @returns {boolean} + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * datastore.isKey({path: ['Company', 123]}); // false + * datastore.isKey(datastore.key(['Company', 123])); // true + * ``` + */ + static isKey(value?: {}) { + return entity.isDsKey(value); + } + isKey(value?: {}) { + return Datastore.isKey(value); + } + + /** + * Helper to create a URL safe key. + * + * This is intended to work with the "legacy" representation of a + * datastore "Key" used within Google App Engine (a so-called "Reference"). + * The returned string can be used as the "urlsafe" + * The base64 encoded values will have padding removed. + * + * + * @param {entity.Key} key Entity key object. + * @param {string} locationPrefix Optional . + * The location prefix of an App Engine project ID. + * Often this value is 's~', but may also be 'e~', or other location prefixes + * currently unknown. + * @param {function} callback The callback function. + * @param {?error} callback.err An error returned while making this request + * @param {string} callback.urlSafeKey A Base64-encoded URL-safe key. + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const key = datastore.key(['Company', 'Google']); + * + * datastore.keyToLegacyUrlSafe(key, (err, urlSafeKey) => { + * if (err) { + * // Error handling omitted. + * } + * console.log(urlSafeKey); + * }); + * + * //- + * // Create a complete URL-safe key using a location prefix. + * //- + * const locationPrefix = 's~'; + * + * datastore.keyToLegacyUrlSafe(key, locationPrefix, (err, urlSafeKey) => { + * if (err) { + * // Error handling omitted. + * } + * console.log(urlSafeKey); + * }); + * + * //- + * // If the callback is omitted, we'll return a Promise. + * //- + * datastore.keyToLegacyUrlSafe(key).then((data) => { + * const urlSafeKey = data[0]; + * console.log(urlSafeKey); + * }); + * ``` + */ + keyToLegacyUrlSafe(key: entity.Key, locationPrefix?: string): Promise; + keyToLegacyUrlSafe( + key: entity.Key, + callback: KeyToLegacyUrlSafeCallback + ): void; + keyToLegacyUrlSafe( + key: entity.Key, + locationPrefix: string, + callback: KeyToLegacyUrlSafeCallback + ): void; + keyToLegacyUrlSafe( + key: entity.Key, + locationPrefixOrCallback?: string | KeyToLegacyUrlSafeCallback, + callback?: KeyToLegacyUrlSafeCallback + ): Promise | void { + const locationPrefix = + typeof locationPrefixOrCallback === 'string' + ? locationPrefixOrCallback + : ''; + callback = + typeof locationPrefixOrCallback === 'function' + ? locationPrefixOrCallback + : callback; + this.auth.getProjectId((err, projectId) => { + if (err) { + callback!(err); + return; + } + callback!(null, urlSafeKey.legacyEncode(projectId!, key, locationPrefix)); + }); + } + + /** + * Helper to convert URL safe key string to entity key object + * + * This is intended to work with the "legacy" representation of a + * datastore "Key" used within Google App Engine (a so-called "Reference"). + * + * @param {entity.Key} key Entity key object. + * @param {string} locationPrefix Optional . + * The location prefix of an App Engine project ID. + * Often this value is 's~', but may also be 'e~', or other location prefixes + * currently unknown. + * @returns {string} Created urlsafe key. + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const urlSafeKey = 'ag9ncmFzcy1jbHVtcC00NzlyEwsSB0NvbXBhbnkiBkdvb2dsZQw'; + * + * datastore.keyFromLegacyUrlsafe(key); + * + * ``` + */ + keyFromLegacyUrlsafe(key: string): entity.Key { + return urlSafeKey.legacyDecode(key); + } + + /** + * Create a new Transaction object. + * + * @param {object} [options] Configuration object. + * @param {string} [options.id] The ID of a previously run transaction. + * @param {boolean} [options.readOnly=false] A read-only transaction cannot + * modify entities. + * @returns {Transaction} + * + * @example + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * const datastore = new Datastore(); + * const transaction = datastore.transaction(); + * ``` + */ + transaction(options?: TransactionOptions) { + return new Transaction(this, options); + } + + /** + * Determine the appropriate endpoint to use for API requests. If not + * explicitly defined, check for the "DATASTORE_EMULATOR_HOST" environment + * variable, used to connect to a local Datastore server. + * + * @private + * + * @param {string} customApiEndpoint Custom API endpoint. + */ + determineBaseUrl_(customApiEndpoint?: string) { + let baseUrl = this.defaultBaseUrl_; + const leadingProtocol = new RegExp('^https*://'); + const trailingSlashes = new RegExp('/*$'); + const port = new RegExp(':(\\d+)'); + + if (customApiEndpoint) { + baseUrl = customApiEndpoint; + this.customEndpoint_ = true; + } else if (process.env.DATASTORE_EMULATOR_HOST) { + baseUrl = process.env.DATASTORE_EMULATOR_HOST; + this.customEndpoint_ = true; + } + + if (port.test(baseUrl)) { + this.port_ = Number(baseUrl.match(port)![1]); + } + + this.baseUrl_ = baseUrl + .replace(leadingProtocol, '') + .replace(port, '') + .replace(trailingSlashes, ''); + } + + /** + * {@link DatastoreRequest} class. + * + * @name Datastore.DatastoreRequest + * @see DatastoreRequest + * @type {constructor} + */ + DatastoreRequest = DatastoreRequest; + + /** + * {@link Query} class. + * + * @name Datastore.Query + * @see Query + * @type {constructor} + */ + Query = Query; + + /** + * {@link Transaction} class. + * + * @name Datastore.Transaction + * @see Transaction + * @type {constructor} + */ + Transaction = Transaction; +} + +/*! Developer Documentation + * + * All async methods (except for streams) will return a Promise in the event + * that a callback is omitted. + */ +promisifyAll(Datastore, { + exclude: [ + 'double', + 'isDouble', + 'geoPoint', + 'getProjectId', + 'isGeoPoint', + 'index', + 'int', + 'isInt', + 'createQuery', + 'key', + 'isKey', + 'keyFromLegacyUrlsafe', + 'transaction', + ], +}); + +export {Datastore}; + +/** + * The default export of the `@google-cloud/datastore` package is the + * {@link Datastore} class. + * + * See the {@link Datastore} class for client methods and configuration options. + * + * @module {Datastore} @google-cloud/datastore + * @alias nodejs-datastore + * + * @example Install the client library with npm: + * ``` + * npm install --save + * ``` + * @google-cloud/datastore + * + * @example Import the client library + * ``` + * const {Datastore} = require('@google-cloud/datastore'); + * + * ``` + * @example Create a client that uses Application Default Credentials (ADC): + * ``` + * const datastore = new Datastore(); + * + * ``` + * @example Create a client with explicit credentials: + * ``` + * const datastore = new Datastore({ projectId: + * 'your-project-id', keyFilename: '/path/to/keyfile.json' + * }); + * + * ``` + * @example include:samples/quickstart.js + * region_tag:datastore_quickstart + * Full quickstart example: + */ + +/** + * @name Datastore.v1 + * @see v1.DatastoreClient + * @type {object} + * @property {constructor} DatastoreClient + * Reference to {@link v1.DatastoreClient}. + */ + +/** + * @name module:@google-cloud/datastore.v1 + * @see v1.DatastoreClient + * @type {object} + * @property {constructor} DatastoreClient + * Reference to {@link v1.DatastoreClient}. + */ +module.exports.v1 = gapic.v1; + +export interface TransactionOptions { + id?: string; + readOnly?: boolean; +} + +export {Index, DatastoreRequest, Query, Transaction}; + +export interface DatastoreOptions extends GoogleAuthOptions { + namespace?: string; + apiEndpoint?: string; + sslCreds?: ChannelCredentials; +} + +export interface KeyToLegacyUrlSafeCallback { + (err?: Error | null, urlSafeKey?: string): void; +} +const v1 = gapic.v1; +export {v1}; + +export {DatastoreClient, DatastoreAdminClient} from './v1'; From 8d8a01f19e031a14ac60e1d8a28bb060ae8b419f Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 26 Jul 2022 17:01:59 -0400 Subject: [PATCH 04/67] src seems to be error free --- src/request.ts | 2 +- src/v1/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/request.ts b/src/request.ts index 0a50ffa40..f65b11782 100644 --- a/src/request.ts +++ b/src/request.ts @@ -965,7 +965,7 @@ class DatastoreRequest { }; } - datastore.auth.getProjectId((err: any, projectId: string) => { + datastore.auth.getProjectId((err, projectId) => { if (err) { callback!(err); return; diff --git a/src/v1/index.ts b/src/v1/index.ts index 63381b364..cb6cd3a7a 100644 --- a/src/v1/index.ts +++ b/src/v1/index.ts @@ -17,3 +17,4 @@ // ** All changes to this file may be overwritten. ** export {DatastoreClient} from './datastore_client'; +export {DatastoreAdminClient} from './datastore_admin_client'; From c88009e9fb9324a6024918a9d75dfb518869dbf3 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 26 Jul 2022 17:06:55 -0400 Subject: [PATCH 05/67] optional parameters --- src/query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query.ts b/src/query.ts index df550beff..3dbae91d1 100644 --- a/src/query.ts +++ b/src/query.ts @@ -167,7 +167,7 @@ class Query { this.aggregations = []; } - count(maximum: number, alias: string) { + count(maximum?: number, alias?: string) { const count = Object.assign({}, maximum ? {up_to: maximum} : null); const aggregation = Object.assign({count}, alias ? {} : null) this.aggregations.push(aggregation); From f5422357143cd3eaaf77ec8735608363e8eb7a29 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 27 Jul 2022 12:49:16 -0400 Subject: [PATCH 06/67] replace with recognized type --- src/query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/query.ts b/src/query.ts index 3dbae91d1..cae4e5921 100644 --- a/src/query.ts +++ b/src/query.ts @@ -71,7 +71,7 @@ export interface Filter { * ``` */ class Query { - aggregations: Array; + aggregations: Array; // TODO: Replace type with aggregation scope?: Datastore | Transaction; namespace?: string | null; kinds: string[]; From 1b21ec26e3e0ff5c3b1ff4679525fde92760c703 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Thu, 28 Jul 2022 13:26:46 -0400 Subject: [PATCH 07/67] protos generated --- protos/protos.d.ts | 17784 ++++++++-------- protos/protos.js | 49351 +++++++++++++++++++++++-------------------- protos/protos.json | 1555 +- 3 files changed, 36805 insertions(+), 31885 deletions(-) diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 97c79d5ba..2b49f5f1a 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -1,11497 +1,12604 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import * as Long from "long"; -import {protobuf as $protobuf} from "google-gax"; +import * as $protobuf from "protobufjs"; /** Namespace google. */ export namespace google { - /** Namespace datastore. */ - namespace datastore { - - /** Namespace admin. */ - namespace admin { + /** Namespace protobuf. */ + namespace protobuf { - /** Namespace v1. */ - namespace v1 { + /** Properties of a Struct. */ + interface IStruct { - /** Represents a DatastoreAdmin */ - class DatastoreAdmin extends $protobuf.rpc.Service { + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } - /** - * Constructs a new DatastoreAdmin 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); + /** Represents a Struct. */ + class Struct implements IStruct { - /** - * Creates new DatastoreAdmin 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): DatastoreAdmin; + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); - /** - * Calls ExportEntities. - * @param request ExportEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportEntities(request: google.datastore.admin.v1.IExportEntitiesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ExportEntitiesCallback): void; + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; - /** - * Calls ExportEntities. - * @param request ExportEntitiesRequest message or plain object - * @returns Promise - */ - public exportEntities(request: google.datastore.admin.v1.IExportEntitiesRequest): Promise; + /** + * 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; - /** - * Calls ImportEntities. - * @param request ImportEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importEntities(request: google.datastore.admin.v1.IImportEntitiesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ImportEntitiesCallback): void; + /** + * 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; - /** - * Calls ImportEntities. - * @param request ImportEntitiesRequest message or plain object - * @returns Promise - */ - public importEntities(request: google.datastore.admin.v1.IImportEntitiesRequest): Promise; + /** + * 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; - /** - * Calls CreateIndex. - * @param request CreateIndexRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createIndex(request: google.datastore.admin.v1.ICreateIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.CreateIndexCallback): void; + /** + * 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; - /** - * Calls CreateIndex. - * @param request CreateIndexRequest message or plain object - * @returns Promise - */ - public createIndex(request: google.datastore.admin.v1.ICreateIndexRequest): Promise; + /** + * 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; - /** - * Calls DeleteIndex. - * @param request DeleteIndexRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteIndex(request: google.datastore.admin.v1.IDeleteIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.DeleteIndexCallback): void; + /** + * 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); - /** - * Calls DeleteIndex. - * @param request DeleteIndexRequest message or plain object - * @returns Promise - */ - public deleteIndex(request: google.datastore.admin.v1.IDeleteIndexRequest): Promise; + /** + * 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; - /** - * Calls GetIndex. - * @param request GetIndexRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Index - */ - public getIndex(request: google.datastore.admin.v1.IGetIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.GetIndexCallback): void; + /** + * 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 }; - /** - * Calls GetIndex. - * @param request GetIndexRequest message or plain object - * @returns Promise - */ - public getIndex(request: google.datastore.admin.v1.IGetIndexRequest): Promise; + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Calls ListIndexes. - * @param request ListIndexesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListIndexesResponse - */ - public listIndexes(request: google.datastore.admin.v1.IListIndexesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ListIndexesCallback): void; + /** Properties of a Value. */ + interface IValue { - /** - * Calls ListIndexes. - * @param request ListIndexesRequest message or plain object - * @returns Promise - */ - public listIndexes(request: google.datastore.admin.v1.IListIndexesRequest): Promise; - } + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|null); - namespace DatastoreAdmin { + /** Value numberValue */ + numberValue?: (number|null); - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#exportEntities}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** Value stringValue */ + stringValue?: (string|null); - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#importEntities}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** Value boolValue */ + boolValue?: (boolean|null); - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#createIndex}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateIndexCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#deleteIndex}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteIndexCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#getIndex}. - * @param error Error, if any - * @param [response] Index - */ - type GetIndexCallback = (error: (Error|null), response?: google.datastore.admin.v1.Index) => void; + /** Represents a Value. */ + class Value implements IValue { - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#listIndexes}. - * @param error Error, if any - * @param [response] ListIndexesResponse - */ - type ListIndexesCallback = (error: (Error|null), response?: google.datastore.admin.v1.ListIndexesResponse) => void; - } + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); - /** Properties of a CommonMetadata. */ - interface ICommonMetadata { + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|null); - /** CommonMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Value numberValue. */ + public numberValue?: (number|null); - /** CommonMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** Value stringValue. */ + public stringValue?: (string|null); - /** CommonMetadata operationType */ - operationType?: (google.datastore.admin.v1.OperationType|keyof typeof google.datastore.admin.v1.OperationType|null); + /** Value boolValue. */ + public boolValue?: (boolean|null); - /** CommonMetadata labels */ - labels?: ({ [k: string]: string }|null); + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); - /** CommonMetadata state */ - state?: (google.datastore.admin.v1.CommonMetadata.State|keyof typeof google.datastore.admin.v1.CommonMetadata.State|null); - } + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); - /** Represents a CommonMetadata. */ - class CommonMetadata implements ICommonMetadata { + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - /** - * Constructs a new CommonMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.ICommonMetadata); + /** + * 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; - /** CommonMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** + * 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; - /** CommonMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** + * 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; - /** CommonMetadata operationType. */ - public operationType: (google.datastore.admin.v1.OperationType|keyof typeof google.datastore.admin.v1.OperationType); + /** + * 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; - /** CommonMetadata labels. */ - public labels: { [k: string]: string }; + /** + * 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; - /** CommonMetadata state. */ - public state: (google.datastore.admin.v1.CommonMetadata.State|keyof typeof google.datastore.admin.v1.CommonMetadata.State); + /** + * 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 new CommonMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.ICommonMetadata): google.datastore.admin.v1.CommonMetadata; + /** + * 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; - /** - * Encodes the specified CommonMetadata message. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. - * @param message CommonMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.ICommonMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 }; - /** - * Encodes the specified CommonMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. - * @param message CommonMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.ICommonMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a CommonMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.CommonMetadata; + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } - /** - * Decodes a CommonMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.CommonMetadata; + /** Properties of a ListValue. */ + interface IListValue { - /** - * Verifies a CommonMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } - /** - * Creates a CommonMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.CommonMetadata; + /** Represents a ListValue. */ + class ListValue implements IListValue { - /** - * Creates a plain object from a CommonMetadata message. Also converts values to other types if specified. - * @param message CommonMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.CommonMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); - /** - * Converts this CommonMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListValue values. */ + public values: google.protobuf.IValue[]; - namespace CommonMetadata { + /** + * 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; - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - INITIALIZING = 1, - PROCESSING = 2, - CANCELLING = 3, - FINALIZING = 4, - SUCCESSFUL = 5, - FAILED = 6, - CANCELLED = 7 - } - } + /** + * 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; - /** Properties of a Progress. */ - interface IProgress { + /** + * 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; - /** Progress workCompleted */ - workCompleted?: (number|Long|string|null); + /** + * 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; - /** Progress workEstimated */ - workEstimated?: (number|Long|string|null); - } + /** + * 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; - /** Represents a Progress. */ - class Progress implements IProgress { + /** + * 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); - /** - * Constructs a new Progress. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IProgress); + /** + * 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; - /** Progress workCompleted. */ - public workCompleted: (number|Long|string); + /** + * 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 }; - /** Progress workEstimated. */ - public workEstimated: (number|Long|string); + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new Progress instance using the specified properties. - * @param [properties] Properties to set - * @returns Progress instance - */ - public static create(properties?: google.datastore.admin.v1.IProgress): google.datastore.admin.v1.Progress; + /** Properties of a Timestamp. */ + interface ITimestamp { - /** - * Encodes the specified Progress message. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. - * @param message Progress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + /** Timestamp seconds */ + seconds?: (number|Long|null); - /** - * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. - * @param message Progress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + /** Timestamp nanos */ + nanos?: (number|null); + } - /** - * Decodes a Progress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Progress; + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { - /** - * Decodes a Progress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Progress; + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); - /** - * Verifies a Progress message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Timestamp seconds. */ + public seconds: (number|Long); - /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Progress - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Progress; + /** Timestamp nanos. */ + public nanos: number; - /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @param message Progress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this Progress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of an ExportEntitiesRequest. */ - interface IExportEntitiesRequest { + /** + * 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; - /** ExportEntitiesRequest projectId */ - projectId?: (string|null); + /** + * 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; - /** ExportEntitiesRequest labels */ - labels?: ({ [k: string]: string }|null); + /** + * 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; - /** ExportEntitiesRequest entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** + * 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); - /** ExportEntitiesRequest outputUrlPrefix */ - outputUrlPrefix?: (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; - /** Represents an ExportEntitiesRequest. */ - class ExportEntitiesRequest implements IExportEntitiesRequest { + /** + * 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 }; - /** - * Constructs a new ExportEntitiesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IExportEntitiesRequest); + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ExportEntitiesRequest projectId. */ - public projectId: string; + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { - /** ExportEntitiesRequest labels. */ - public labels: { [k: string]: string }; + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } - /** ExportEntitiesRequest entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { - /** ExportEntitiesRequest outputUrlPrefix. */ - public outputUrlPrefix: string; + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); - /** - * Creates a new ExportEntitiesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportEntitiesRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IExportEntitiesRequest): google.datastore.admin.v1.ExportEntitiesRequest; + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; - /** - * Encodes the specified ExportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. - * @param message ExportEntitiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IExportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 ExportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. - * @param message ExportEntitiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes an ExportEntitiesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesRequest; + /** + * 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 an ExportEntitiesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesRequest; + /** + * 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; - /** - * Verifies an ExportEntitiesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a 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; - /** - * Creates an ExportEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportEntitiesRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesRequest; + /** + * 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 plain object from an ExportEntitiesRequest message. Also converts values to other types if specified. - * @param message ExportEntitiesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ExportEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this ExportEntitiesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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 }; - /** Properties of an ImportEntitiesRequest. */ - interface IImportEntitiesRequest { + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ImportEntitiesRequest projectId */ - projectId?: (string|null); + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { - /** ImportEntitiesRequest labels */ - labels?: ({ [k: string]: string }|null); + /** FileDescriptorProto name */ + name?: (string|null); - /** ImportEntitiesRequest inputUrl */ - inputUrl?: (string|null); + /** FileDescriptorProto package */ + "package"?: (string|null); - /** ImportEntitiesRequest entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - } + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); - /** Represents an ImportEntitiesRequest. */ - class ImportEntitiesRequest implements IImportEntitiesRequest { + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); - /** - * Constructs a new ImportEntitiesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IImportEntitiesRequest); + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); - /** ImportEntitiesRequest projectId. */ - public projectId: string; + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); - /** ImportEntitiesRequest labels. */ - public labels: { [k: string]: string }; + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - /** ImportEntitiesRequest inputUrl. */ - public inputUrl: string; + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); - /** ImportEntitiesRequest entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); - /** - * Creates a new ImportEntitiesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportEntitiesRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IImportEntitiesRequest): google.datastore.admin.v1.ImportEntitiesRequest; + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); - /** - * Encodes the specified ImportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. - * @param message ImportEntitiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IImportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - /** - * Encodes the specified ImportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. - * @param message ImportEntitiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IImportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } - /** - * Decodes an ImportEntitiesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ImportEntitiesRequest; + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { - /** - * Decodes an ImportEntitiesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ImportEntitiesRequest; + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); - /** - * Verifies an ImportEntitiesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileDescriptorProto name. */ + public name: string; - /** - * Creates an ImportEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportEntitiesRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ImportEntitiesRequest; + /** FileDescriptorProto package. */ + public package: string; - /** - * Creates a plain object from an ImportEntitiesRequest message. Also converts values to other types if specified. - * @param message ImportEntitiesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ImportEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileDescriptorProto dependency. */ + public dependency: string[]; - /** - * Converts this ImportEntitiesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; - /** Properties of an ExportEntitiesResponse. */ - interface IExportEntitiesResponse { + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; - /** ExportEntitiesResponse outputUrl */ - outputUrl?: (string|null); - } + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; - /** Represents an ExportEntitiesResponse. */ - class ExportEntitiesResponse implements IExportEntitiesResponse { + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; - /** - * Constructs a new ExportEntitiesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IExportEntitiesResponse); + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; - /** ExportEntitiesResponse outputUrl. */ - public outputUrl: string; + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; - /** - * Creates a new ExportEntitiesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportEntitiesResponse instance - */ - public static create(properties?: google.datastore.admin.v1.IExportEntitiesResponse): google.datastore.admin.v1.ExportEntitiesResponse; + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); - /** - * Encodes the specified ExportEntitiesResponse message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. - * @param message ExportEntitiesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IExportEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - /** - * Encodes the specified ExportEntitiesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. - * @param message ExportEntitiesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto syntax. */ + public syntax: string; - /** - * Decodes an ExportEntitiesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportEntitiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesResponse; + /** + * 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; - /** - * Decodes an ExportEntitiesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportEntitiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesResponse; + /** + * 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; - /** - * Verifies an ExportEntitiesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExportEntitiesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportEntitiesResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesResponse; - - /** - * Creates a plain object from an ExportEntitiesResponse message. Also converts values to other types if specified. - * @param message ExportEntitiesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ExportEntitiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this ExportEntitiesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of an ExportEntitiesMetadata. */ - interface IExportEntitiesMetadata { + /** + * 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; - /** ExportEntitiesMetadata common */ - common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** + * 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); - /** ExportEntitiesMetadata progressEntities */ - progressEntities?: (google.datastore.admin.v1.IProgress|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; - /** ExportEntitiesMetadata progressBytes */ - progressBytes?: (google.datastore.admin.v1.IProgress|null); + /** + * 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 }; - /** ExportEntitiesMetadata entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ExportEntitiesMetadata outputUrlPrefix */ - outputUrlPrefix?: (string|null); - } + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { - /** Represents an ExportEntitiesMetadata. */ - class ExportEntitiesMetadata implements IExportEntitiesMetadata { + /** DescriptorProto name */ + name?: (string|null); - /** - * Constructs a new ExportEntitiesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IExportEntitiesMetadata); + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); - /** ExportEntitiesMetadata common. */ - public common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); - /** ExportEntitiesMetadata progressEntities. */ - public progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); - /** ExportEntitiesMetadata progressBytes. */ - public progressBytes?: (google.datastore.admin.v1.IProgress|null); + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - /** ExportEntitiesMetadata entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - /** ExportEntitiesMetadata outputUrlPrefix. */ - public outputUrlPrefix: string; + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - /** - * Creates a new ExportEntitiesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportEntitiesMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.IExportEntitiesMetadata): google.datastore.admin.v1.ExportEntitiesMetadata; + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); - /** - * Encodes the specified ExportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. - * @param message ExportEntitiesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IExportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - /** - * Encodes the specified ExportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. - * @param message ExportEntitiesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } - /** - * Decodes an ExportEntitiesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesMetadata; + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { - /** - * Decodes an ExportEntitiesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesMetadata; + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); - /** - * Verifies an ExportEntitiesMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** DescriptorProto name. */ + public name: string; - /** - * Creates an ExportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportEntitiesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesMetadata; + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; - /** - * Creates a plain object from an ExportEntitiesMetadata message. Also converts values to other types if specified. - * @param message ExportEntitiesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ExportEntitiesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; - /** - * Converts this ExportEntitiesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; - /** Properties of an ImportEntitiesMetadata. */ - interface IImportEntitiesMetadata { + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; - /** ImportEntitiesMetadata common */ - common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - /** ImportEntitiesMetadata progressEntities */ - progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - /** ImportEntitiesMetadata progressBytes */ - progressBytes?: (google.datastore.admin.v1.IProgress|null); + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); - /** ImportEntitiesMetadata entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - /** ImportEntitiesMetadata inputUrl */ - inputUrl?: (string|null); - } + /** DescriptorProto reservedName. */ + public reservedName: string[]; - /** Represents an ImportEntitiesMetadata. */ - class ImportEntitiesMetadata implements IImportEntitiesMetadata { + /** + * 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; - /** - * Constructs a new ImportEntitiesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IImportEntitiesMetadata); + /** + * 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; - /** ImportEntitiesMetadata common. */ - public common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** + * 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; - /** ImportEntitiesMetadata progressEntities. */ - public progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** + * 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; - /** ImportEntitiesMetadata progressBytes. */ - public progressBytes?: (google.datastore.admin.v1.IProgress|null); + /** + * 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; - /** ImportEntitiesMetadata entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** + * 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); - /** ImportEntitiesMetadata inputUrl. */ - public inputUrl: string; + /** + * 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 new ImportEntitiesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportEntitiesMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.IImportEntitiesMetadata): google.datastore.admin.v1.ImportEntitiesMetadata; + /** + * 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 }; - /** - * Encodes the specified ImportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. - * @param message ImportEntitiesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IImportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified ImportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. - * @param message ImportEntitiesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IImportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + namespace DescriptorProto { - /** - * Decodes an ImportEntitiesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ImportEntitiesMetadata; + /** Properties of an ExtensionRange. */ + interface IExtensionRange { - /** - * Decodes an ImportEntitiesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ImportEntitiesMetadata; + /** ExtensionRange start */ + start?: (number|null); - /** - * Verifies an ImportEntitiesMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ExtensionRange end */ + end?: (number|null); - /** - * Creates an ImportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportEntitiesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ImportEntitiesMetadata; + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } - /** - * Creates a plain object from an ImportEntitiesMetadata message. Also converts values to other types if specified. - * @param message ImportEntitiesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ImportEntitiesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { - /** - * Converts this ImportEntitiesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - /** Properties of an EntityFilter. */ - interface IEntityFilter { + /** ExtensionRange start. */ + public start: number; - /** EntityFilter kinds */ - kinds?: (string[]|null); + /** ExtensionRange end. */ + public end: number; - /** EntityFilter namespaceIds */ - namespaceIds?: (string[]|null); - } + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); - /** Represents an EntityFilter. */ - class EntityFilter implements IEntityFilter { + /** + * 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; - /** - * Constructs a new EntityFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IEntityFilter); + /** + * 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; - /** EntityFilter kinds. */ - public kinds: string[]; + /** + * 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; - /** EntityFilter namespaceIds. */ - public namespaceIds: string[]; + /** + * 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; - /** - * Creates a new EntityFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityFilter instance - */ - public static create(properties?: google.datastore.admin.v1.IEntityFilter): google.datastore.admin.v1.EntityFilter; + /** + * 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; - /** - * Encodes the specified EntityFilter message. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. - * @param message EntityFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IEntityFilter, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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); - /** - * Encodes the specified EntityFilter message, length delimited. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. - * @param message EntityFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IEntityFilter, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes an EntityFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.EntityFilter; + /** + * 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 }; - /** - * Decodes an EntityFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.EntityFilter; + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies an EntityFilter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a ReservedRange. */ + interface IReservedRange { - /** - * Creates an EntityFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityFilter - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.EntityFilter; + /** ReservedRange start */ + start?: (number|null); - /** - * Creates a plain object from an EntityFilter message. Also converts values to other types if specified. - * @param message EntityFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.EntityFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ReservedRange end */ + end?: (number|null); + } - /** - * Converts this EntityFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { - /** Properties of a CreateIndexRequest. */ - interface ICreateIndexRequest { + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - /** CreateIndexRequest projectId */ - projectId?: (string|null); + /** ReservedRange start. */ + public start: number; - /** CreateIndexRequest index */ - index?: (google.datastore.admin.v1.IIndex|null); - } + /** ReservedRange end. */ + public end: number; - /** Represents a CreateIndexRequest. */ - class CreateIndexRequest implements ICreateIndexRequest { + /** + * 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; - /** - * Constructs a new CreateIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.ICreateIndexRequest); + /** + * 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; - /** CreateIndexRequest projectId. */ - public projectId: string; + /** + * 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; - /** CreateIndexRequest index. */ - public index?: (google.datastore.admin.v1.IIndex|null); + /** + * 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; - /** - * Creates a new CreateIndexRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateIndexRequest instance - */ - public static create(properties?: google.datastore.admin.v1.ICreateIndexRequest): google.datastore.admin.v1.CreateIndexRequest; + /** + * 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; - /** - * Encodes the specified CreateIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. - * @param message CreateIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.ICreateIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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); - /** - * Encodes the specified CreateIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. - * @param message CreateIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.ICreateIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes a CreateIndexRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.CreateIndexRequest; + /** + * 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 }; - /** - * Decodes a CreateIndexRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.CreateIndexRequest; + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Verifies a CreateIndexRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { - /** - * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateIndexRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.CreateIndexRequest; + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. - * @param message CreateIndexRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.CreateIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { - /** - * Converts this CreateIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); - /** Properties of a DeleteIndexRequest. */ - interface IDeleteIndexRequest { + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** DeleteIndexRequest projectId */ - projectId?: (string|null); + /** + * 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; - /** DeleteIndexRequest indexId */ - indexId?: (string|null); - } + /** + * 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; - /** Represents a DeleteIndexRequest. */ - class DeleteIndexRequest implements IDeleteIndexRequest { + /** + * 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; - /** - * Constructs a new DeleteIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IDeleteIndexRequest); + /** + * 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; - /** DeleteIndexRequest projectId. */ - public projectId: string; + /** + * 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; - /** DeleteIndexRequest indexId. */ - public indexId: string; + /** + * 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 a new DeleteIndexRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteIndexRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IDeleteIndexRequest): google.datastore.admin.v1.DeleteIndexRequest; - - /** - * Encodes the specified DeleteIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. - * @param message DeleteIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IDeleteIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. - * @param message DeleteIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IDeleteIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteIndexRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.DeleteIndexRequest; + /** + * 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; - /** - * Decodes a DeleteIndexRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.DeleteIndexRequest; + /** + * 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 }; - /** - * Verifies a DeleteIndexRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteIndexRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.DeleteIndexRequest; + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { - /** - * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. - * @param message DeleteIndexRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.DeleteIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FieldDescriptorProto name */ + name?: (string|null); - /** - * Converts this DeleteIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldDescriptorProto number */ + number?: (number|null); - /** Properties of a GetIndexRequest. */ - interface IGetIndexRequest { + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|null); - /** GetIndexRequest projectId */ - projectId?: (string|null); + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|null); - /** GetIndexRequest indexId */ - indexId?: (string|null); - } + /** FieldDescriptorProto typeName */ + typeName?: (string|null); - /** Represents a GetIndexRequest. */ - class GetIndexRequest implements IGetIndexRequest { + /** FieldDescriptorProto extendee */ + extendee?: (string|null); - /** - * Constructs a new GetIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IGetIndexRequest); + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); - /** GetIndexRequest projectId. */ - public projectId: string; + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); - /** GetIndexRequest indexId. */ - public indexId: string; + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); - /** - * Creates a new GetIndexRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIndexRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IGetIndexRequest): google.datastore.admin.v1.GetIndexRequest; + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); - /** - * Encodes the specified GetIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. - * @param message GetIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IGetIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } - /** - * Encodes the specified GetIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. - * @param message GetIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IGetIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { - /** - * Decodes a GetIndexRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.GetIndexRequest; + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); - /** - * Decodes a GetIndexRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.GetIndexRequest; + /** FieldDescriptorProto name. */ + public name: string; - /** - * Verifies a GetIndexRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FieldDescriptorProto number. */ + public number: number; - /** - * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIndexRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.GetIndexRequest; + /** FieldDescriptorProto label. */ + public label: google.protobuf.FieldDescriptorProto.Label; - /** - * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. - * @param message GetIndexRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.GetIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FieldDescriptorProto type. */ + public type: google.protobuf.FieldDescriptorProto.Type; - /** - * Converts this GetIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldDescriptorProto typeName. */ + public typeName: string; - /** Properties of a ListIndexesRequest. */ - interface IListIndexesRequest { + /** FieldDescriptorProto extendee. */ + public extendee: string; - /** ListIndexesRequest projectId */ - projectId?: (string|null); + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; - /** ListIndexesRequest filter */ - filter?: (string|null); + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; - /** ListIndexesRequest pageSize */ - pageSize?: (number|null); + /** FieldDescriptorProto jsonName. */ + public jsonName: string; - /** ListIndexesRequest pageToken */ - pageToken?: (string|null); - } + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); - /** Represents a ListIndexesRequest. */ - class ListIndexesRequest implements IListIndexesRequest { + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; - /** - * Constructs a new ListIndexesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IListIndexesRequest); + /** + * 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; - /** ListIndexesRequest projectId. */ - public projectId: string; + /** + * 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; - /** ListIndexesRequest filter. */ - public filter: string; + /** + * 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; - /** ListIndexesRequest pageSize. */ - public pageSize: number; + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); - /** ListIndexesRequest pageToken. */ - public pageToken: string; + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); - /** - * Creates a new ListIndexesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListIndexesRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IListIndexesRequest): google.datastore.admin.v1.ListIndexesRequest; + /** FileOptions goPackage */ + goPackage?: (string|null); - /** - * Encodes the specified ListIndexesRequest message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. - * @param message ListIndexesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IListIndexesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); - /** - * Encodes the specified ListIndexesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. - * @param message ListIndexesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IListIndexesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); - /** - * Decodes a ListIndexesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListIndexesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ListIndexesRequest; + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); - /** - * Decodes a ListIndexesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListIndexesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ListIndexesRequest; + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); - /** - * Verifies a ListIndexesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileOptions deprecated */ + deprecated?: (boolean|null); - /** - * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListIndexesRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ListIndexesRequest; + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); - /** - * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. - * @param message ListIndexesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ListIndexesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); - /** - * Converts this ListIndexesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); - /** Properties of a ListIndexesResponse. */ - interface IListIndexesResponse { + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); - /** ListIndexesResponse indexes */ - indexes?: (google.datastore.admin.v1.IIndex[]|null); + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); - /** ListIndexesResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); - /** Represents a ListIndexesResponse. */ - class ListIndexesResponse implements IListIndexesResponse { + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); - /** - * Constructs a new ListIndexesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IListIndexesResponse); + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); - /** ListIndexesResponse indexes. */ - public indexes: google.datastore.admin.v1.IIndex[]; + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** ListIndexesResponse nextPageToken. */ - public nextPageToken: string; + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } - /** - * Creates a new ListIndexesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListIndexesResponse instance - */ - public static create(properties?: google.datastore.admin.v1.IListIndexesResponse): google.datastore.admin.v1.ListIndexesResponse; + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { - /** - * Encodes the specified ListIndexesResponse message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. - * @param message ListIndexesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IListIndexesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); - /** - * Encodes the specified ListIndexesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. - * @param message ListIndexesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IListIndexesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions javaPackage. */ + public javaPackage: string; - /** - * Decodes a ListIndexesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListIndexesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ListIndexesResponse; + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; - /** - * Decodes a ListIndexesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListIndexesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ListIndexesResponse; + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; - /** - * Verifies a ListIndexesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - /** - * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListIndexesResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ListIndexesResponse; + /** + * 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; - /** - * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. - * @param message ListIndexesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ListIndexesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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); - /** - * Converts this ListIndexesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of an IndexOperationMetadata. */ - interface IIndexOperationMetadata { + /** + * 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 }; - /** IndexOperationMetadata common */ - common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** IndexOperationMetadata progressEntities */ - progressEntities?: (google.datastore.admin.v1.IProgress|null); + namespace FileOptions { - /** IndexOperationMetadata indexId */ - indexId?: (string|null); - } + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } - /** Represents an IndexOperationMetadata. */ - class IndexOperationMetadata implements IIndexOperationMetadata { + /** Properties of a MessageOptions. */ + interface IMessageOptions { - /** - * Constructs a new IndexOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IIndexOperationMetadata); + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); - /** IndexOperationMetadata common. */ - public common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); - /** IndexOperationMetadata progressEntities. */ - public progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** MessageOptions deprecated */ + deprecated?: (boolean|null); - /** IndexOperationMetadata indexId. */ - public indexId: string; + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); - /** - * Creates a new IndexOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns IndexOperationMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.IIndexOperationMetadata): google.datastore.admin.v1.IndexOperationMetadata; + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Encodes the specified IndexOperationMetadata message. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. - * @param message IndexOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IIndexOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } - /** - * Encodes the specified IndexOperationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. - * @param message IndexOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IIndexOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { - /** - * Decodes an IndexOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndexOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.IndexOperationMetadata; + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); - /** - * Decodes an IndexOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndexOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.IndexOperationMetadata; + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; - /** - * Verifies an IndexOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; - /** - * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.IndexOperationMetadata; + /** MessageOptions deprecated. */ + public deprecated: boolean; - /** - * Creates a plain object from an IndexOperationMetadata message. Also converts values to other types if specified. - * @param message IndexOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.IndexOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MessageOptions mapEntry. */ + public mapEntry: boolean; - /** - * Converts this IndexOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** Properties of a DatastoreFirestoreMigrationMetadata. */ - interface IDatastoreFirestoreMigrationMetadata { + /** + * 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; - /** DatastoreFirestoreMigrationMetadata migrationState */ - migrationState?: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState|null); + /** + * 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; - /** DatastoreFirestoreMigrationMetadata migrationStep */ - migrationStep?: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep|null); - } + /** + * 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; - /** Represents a DatastoreFirestoreMigrationMetadata. */ - class DatastoreFirestoreMigrationMetadata implements IDatastoreFirestoreMigrationMetadata { + /** + * 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; - /** - * Constructs a new DatastoreFirestoreMigrationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata); + /** + * 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; - /** DatastoreFirestoreMigrationMetadata migrationState. */ - public migrationState: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState); + /** + * 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); - /** DatastoreFirestoreMigrationMetadata migrationStep. */ - public migrationStep: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep); + /** + * 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 new DatastoreFirestoreMigrationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DatastoreFirestoreMigrationMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; + /** + * 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 }; + } - /** - * Encodes the specified DatastoreFirestoreMigrationMetadata message. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. - * @param message DatastoreFirestoreMigrationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a FieldOptions. */ + interface IFieldOptions { - /** - * Encodes the specified DatastoreFirestoreMigrationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. - * @param message DatastoreFirestoreMigrationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|null); - /** - * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DatastoreFirestoreMigrationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; + /** FieldOptions packed */ + packed?: (boolean|null); - /** - * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DatastoreFirestoreMigrationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|null); - /** - * Verifies a DatastoreFirestoreMigrationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FieldOptions lazy */ + lazy?: (boolean|null); - /** - * Creates a DatastoreFirestoreMigrationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DatastoreFirestoreMigrationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); - /** - * Creates a plain object from a DatastoreFirestoreMigrationMetadata message. Also converts values to other types if specified. - * @param message DatastoreFirestoreMigrationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FieldOptions deprecated */ + deprecated?: (boolean|null); - /** - * Converts this DatastoreFirestoreMigrationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldOptions weak */ + weak?: (boolean|null); - /** OperationType enum. */ - enum OperationType { - OPERATION_TYPE_UNSPECIFIED = 0, - EXPORT_ENTITIES = 1, - IMPORT_ENTITIES = 2, - CREATE_INDEX = 3, - DELETE_INDEX = 4 - } + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** Properties of an Index. */ - interface IIndex { + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - /** Index projectId */ - projectId?: (string|null); + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } - /** Index indexId */ - indexId?: (string|null); + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { - /** Index kind */ - kind?: (string|null); + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); - /** Index ancestor */ - ancestor?: (google.datastore.admin.v1.Index.AncestorMode|keyof typeof google.datastore.admin.v1.Index.AncestorMode|null); + /** FieldOptions ctype. */ + public ctype: google.protobuf.FieldOptions.CType; - /** Index properties */ - properties?: (google.datastore.admin.v1.Index.IIndexedProperty[]|null); + /** FieldOptions packed. */ + public packed: boolean; - /** Index state */ - state?: (google.datastore.admin.v1.Index.State|keyof typeof google.datastore.admin.v1.Index.State|null); - } + /** FieldOptions jstype. */ + public jstype: google.protobuf.FieldOptions.JSType; - /** Represents an Index. */ - class Index implements IIndex { + /** FieldOptions lazy. */ + public lazy: boolean; - /** - * Constructs a new Index. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IIndex); + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; - /** Index projectId. */ - public projectId: string; + /** FieldOptions deprecated. */ + public deprecated: boolean; - /** Index indexId. */ - public indexId: string; + /** FieldOptions weak. */ + public weak: boolean; - /** Index kind. */ - public kind: string; + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** Index ancestor. */ - public ancestor: (google.datastore.admin.v1.Index.AncestorMode|keyof typeof google.datastore.admin.v1.Index.AncestorMode); + /** + * 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; - /** Index properties. */ - public properties: google.datastore.admin.v1.Index.IIndexedProperty[]; + /** + * 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; - /** Index state. */ - public state: (google.datastore.admin.v1.Index.State|keyof typeof google.datastore.admin.v1.Index.State); + /** + * 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; - /** - * Creates a new Index instance using the specified properties. - * @param [properties] Properties to set - * @returns Index instance - */ - public static create(properties?: google.datastore.admin.v1.IIndex): google.datastore.admin.v1.Index; + /** + * 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; - /** - * Encodes the specified Index message. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. - * @param message Index message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IIndex, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Encodes the specified Index message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. - * @param message Index message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IIndex, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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); - /** - * Decodes an Index message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Index - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Index; + /** + * 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; - /** - * Decodes an Index message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Index - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Index; + /** + * 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 }; - /** - * Verifies an Index message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates an Index message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Index - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Index; + 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 + } + } - /** - * Creates a plain object from an Index message. Also converts values to other types if specified. - * @param message Index - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.Index, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of an OneofOptions. */ + interface IOneofOptions { - /** - * Converts this Index to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - namespace Index { + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { - /** AncestorMode enum. */ - enum AncestorMode { - ANCESTOR_MODE_UNSPECIFIED = 0, - NONE = 1, - ALL_ANCESTORS = 2 - } + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); - /** Direction enum. */ - enum Direction { - DIRECTION_UNSPECIFIED = 0, - ASCENDING = 1, - DESCENDING = 2 - } + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** Properties of an IndexedProperty. */ - interface IIndexedProperty { + /** + * 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; - /** IndexedProperty name */ - name?: (string|null); + /** + * 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; - /** IndexedProperty direction */ - direction?: (google.datastore.admin.v1.Index.Direction|keyof typeof google.datastore.admin.v1.Index.Direction|null); - } + /** + * 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; - /** Represents an IndexedProperty. */ - class IndexedProperty implements IIndexedProperty { + /** + * 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; - /** - * Constructs a new IndexedProperty. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.Index.IIndexedProperty); + /** + * 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; - /** IndexedProperty name. */ - public name: string; + /** + * 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); - /** IndexedProperty direction. */ - public direction: (google.datastore.admin.v1.Index.Direction|keyof typeof google.datastore.admin.v1.Index.Direction); + /** + * 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 new IndexedProperty instance using the specified properties. - * @param [properties] Properties to set - * @returns IndexedProperty instance - */ - public static create(properties?: google.datastore.admin.v1.Index.IIndexedProperty): google.datastore.admin.v1.Index.IndexedProperty; + /** + * 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 }; - /** - * Encodes the specified IndexedProperty message. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. - * @param message IndexedProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.Index.IIndexedProperty, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified IndexedProperty message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. - * @param message IndexedProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.Index.IIndexedProperty, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an EnumOptions. */ + interface IEnumOptions { - /** - * Decodes an IndexedProperty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndexedProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Index.IndexedProperty; + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); - /** - * Decodes an IndexedProperty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndexedProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Index.IndexedProperty; + /** EnumOptions deprecated */ + deprecated?: (boolean|null); - /** - * Verifies an IndexedProperty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Creates an IndexedProperty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexedProperty - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Index.IndexedProperty; + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { - /** - * Creates a plain object from an IndexedProperty message. Also converts values to other types if specified. - * @param message IndexedProperty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.Index.IndexedProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); - /** - * Converts this IndexedProperty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** EnumOptions allowAlias. */ + public allowAlias: boolean; - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - DELETING = 3, - ERROR = 4 - } - } + /** EnumOptions deprecated. */ + public deprecated: boolean; - /** Properties of a MigrationStateEvent. */ - interface IMigrationStateEvent { + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** MigrationStateEvent state */ - state?: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState|null); - } + /** + * 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; - /** Represents a MigrationStateEvent. */ - class MigrationStateEvent implements IMigrationStateEvent { + /** + * 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; - /** - * Constructs a new MigrationStateEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IMigrationStateEvent); + /** + * 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; - /** MigrationStateEvent state. */ - public state: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState); + /** + * 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; - /** - * Creates a new MigrationStateEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns MigrationStateEvent instance - */ - public static create(properties?: google.datastore.admin.v1.IMigrationStateEvent): google.datastore.admin.v1.MigrationStateEvent; + /** + * 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); - /** - * Encodes the specified MigrationStateEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. - * @param message MigrationStateEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IMigrationStateEvent, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Encodes the specified MigrationStateEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. - * @param message MigrationStateEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IMigrationStateEvent, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 }; - /** - * Decodes a MigrationStateEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MigrationStateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationStateEvent; + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a MigrationStateEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MigrationStateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationStateEvent; + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { - /** - * Verifies a MigrationStateEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); - /** - * Creates a MigrationStateEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MigrationStateEvent - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationStateEvent; + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Creates a plain object from a MigrationStateEvent message. Also converts values to other types if specified. - * @param message MigrationStateEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.MigrationStateEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { - /** - * Converts this MigrationStateEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); - /** Properties of a MigrationProgressEvent. */ - interface IMigrationProgressEvent { + /** EnumValueOptions deprecated. */ + public deprecated: boolean; - /** MigrationProgressEvent step */ - step?: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep|null); + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** MigrationProgressEvent prepareStepDetails */ - prepareStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null); + /** + * 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; - /** MigrationProgressEvent redirectWritesStepDetails */ - redirectWritesStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null); - } + /** + * 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; - /** Represents a MigrationProgressEvent. */ - class MigrationProgressEvent implements IMigrationProgressEvent { + /** + * 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; - /** - * Constructs a new MigrationProgressEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IMigrationProgressEvent); + /** + * 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; - /** MigrationProgressEvent step. */ - public step: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep); + /** + * 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; - /** MigrationProgressEvent prepareStepDetails. */ - public prepareStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null); + /** + * 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); - /** MigrationProgressEvent redirectWritesStepDetails. */ - public redirectWritesStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|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; - /** MigrationProgressEvent stepDetails. */ - public stepDetails?: ("prepareStepDetails"|"redirectWritesStepDetails"); + /** + * 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 }; - /** - * Creates a new MigrationProgressEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns MigrationProgressEvent instance - */ - public static create(properties?: google.datastore.admin.v1.IMigrationProgressEvent): google.datastore.admin.v1.MigrationProgressEvent; + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified MigrationProgressEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. - * @param message MigrationProgressEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IMigrationProgressEvent, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a ServiceOptions. */ + interface IServiceOptions { - /** - * Encodes the specified MigrationProgressEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. - * @param message MigrationProgressEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IMigrationProgressEvent, writer?: $protobuf.Writer): $protobuf.Writer; + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); - /** - * Decodes a MigrationProgressEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MigrationProgressEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent; + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Decodes a MigrationProgressEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MigrationProgressEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent; + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); - /** - * Verifies a MigrationProgressEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } - /** - * Creates a MigrationProgressEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MigrationProgressEvent - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent; + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { - /** - * Creates a plain object from a MigrationProgressEvent message. Also converts values to other types if specified. - * @param message MigrationProgressEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); - /** - * Converts this MigrationProgressEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ServiceOptions deprecated. */ + public deprecated: boolean; - namespace MigrationProgressEvent { + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** ConcurrencyMode enum. */ - enum ConcurrencyMode { - CONCURRENCY_MODE_UNSPECIFIED = 0, - PESSIMISTIC = 1, - OPTIMISTIC = 2, - OPTIMISTIC_WITH_ENTITY_GROUPS = 3 - } + /** + * 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; - /** Properties of a PrepareStepDetails. */ - interface IPrepareStepDetails { + /** + * 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; - /** PrepareStepDetails concurrencyMode */ - concurrencyMode?: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|keyof typeof google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null); - } + /** + * 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; - /** Represents a PrepareStepDetails. */ - class PrepareStepDetails implements IPrepareStepDetails { + /** + * 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; - /** - * Constructs a new PrepareStepDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails); + /** + * 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; - /** PrepareStepDetails concurrencyMode. */ - public concurrencyMode: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|keyof typeof google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode); + /** + * 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 new PrepareStepDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns PrepareStepDetails instance - */ - public static create(properties?: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; + /** + * 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; - /** - * Encodes the specified PrepareStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. - * @param message PrepareStepDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 }; - /** - * Encodes the specified PrepareStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. - * @param message PrepareStepDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a PrepareStepDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PrepareStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; + /** Properties of a MethodOptions. */ + interface IMethodOptions { - /** - * Decodes a PrepareStepDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PrepareStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; + /** MethodOptions deprecated */ + deprecated?: (boolean|null); - /** - * Verifies a PrepareStepDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); - /** - * Creates a PrepareStepDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PrepareStepDetails - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Creates a plain object from a PrepareStepDetails message. Also converts values to other types if specified. - * @param message PrepareStepDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); - /** - * Converts this PrepareStepDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); - /** Properties of a RedirectWritesStepDetails. */ - interface IRedirectWritesStepDetails { + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } - /** RedirectWritesStepDetails concurrencyMode */ - concurrencyMode?: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|keyof typeof google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null); - } + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { - /** Represents a RedirectWritesStepDetails. */ - class RedirectWritesStepDetails implements IRedirectWritesStepDetails { + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); - /** - * Constructs a new RedirectWritesStepDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails); + /** MethodOptions deprecated. */ + public deprecated: boolean; - /** RedirectWritesStepDetails concurrencyMode. */ - public concurrencyMode: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|keyof typeof google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode); + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; - /** - * Creates a new RedirectWritesStepDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns RedirectWritesStepDetails instance - */ - public static create(properties?: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Encodes the specified RedirectWritesStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. - * @param message RedirectWritesStepDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 RedirectWritesStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. - * @param message RedirectWritesStepDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes a RedirectWritesStepDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RedirectWritesStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; + /** + * 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 RedirectWritesStepDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RedirectWritesStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; + /** + * 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 RedirectWritesStepDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a 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 RedirectWritesStepDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RedirectWritesStepDetails - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; + /** + * 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 RedirectWritesStepDetails message. Also converts values to other types if specified. - * @param message RedirectWritesStepDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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 RedirectWritesStepDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MigrationState enum. */ - enum MigrationState { - MIGRATION_STATE_UNSPECIFIED = 0, - RUNNING = 1, - PAUSED = 2, - COMPLETE = 3 - } + namespace MethodOptions { - /** MigrationStep enum. */ - enum MigrationStep { - MIGRATION_STEP_UNSPECIFIED = 0, - PREPARE = 6, - START = 1, - APPLY_WRITES_SYNCHRONOUSLY = 7, - COPY_AND_VERIFY = 2, - REDIRECT_EVENTUALLY_CONSISTENT_READS = 3, - REDIRECT_STRONGLY_CONSISTENT_READS = 4, - REDIRECT_WRITES = 5 - } + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 } } - /** Namespace v1. */ - namespace v1 { + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { - /** Represents a Datastore */ - class Datastore extends $protobuf.rpc.Service { + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - /** - * Constructs a new Datastore 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); + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); - /** - * Creates new Datastore 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): Datastore; + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|null); - /** - * Calls Lookup. - * @param request LookupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and LookupResponse - */ - public lookup(request: google.datastore.v1.ILookupRequest, callback: google.datastore.v1.Datastore.LookupCallback): void; + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|null); - /** - * Calls Lookup. - * @param request LookupRequest message or plain object - * @returns Promise - */ - public lookup(request: google.datastore.v1.ILookupRequest): Promise; + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); - /** - * Calls RunQuery. - * @param request RunQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RunQueryResponse - */ - public runQuery(request: google.datastore.v1.IRunQueryRequest, callback: google.datastore.v1.Datastore.RunQueryCallback): void; + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|null); - /** - * Calls RunQuery. - * @param request RunQueryRequest message or plain object - * @returns Promise - */ - public runQuery(request: google.datastore.v1.IRunQueryRequest): Promise; + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BeginTransactionResponse - */ - public beginTransaction(request: google.datastore.v1.IBeginTransactionRequest, callback: google.datastore.v1.Datastore.BeginTransactionCallback): void; + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @returns Promise - */ - public beginTransaction(request: google.datastore.v1.IBeginTransactionRequest): Promise; + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); - /** - * 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.datastore.v1.ICommitRequest, callback: google.datastore.v1.Datastore.CommitCallback): void; + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @returns Promise - */ - public commit(request: google.datastore.v1.ICommitRequest): Promise; + /** UninterpretedOption identifierValue. */ + public identifierValue: string; - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RollbackResponse - */ - public rollback(request: google.datastore.v1.IRollbackRequest, callback: google.datastore.v1.Datastore.RollbackCallback): void; + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long); - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @returns Promise - */ - public rollback(request: google.datastore.v1.IRollbackRequest): Promise; + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long); - /** - * Calls AllocateIds. - * @param request AllocateIdsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AllocateIdsResponse - */ - public allocateIds(request: google.datastore.v1.IAllocateIdsRequest, callback: google.datastore.v1.Datastore.AllocateIdsCallback): void; + /** UninterpretedOption doubleValue. */ + public doubleValue: number; - /** - * Calls AllocateIds. - * @param request AllocateIdsRequest message or plain object - * @returns Promise - */ - public allocateIds(request: google.datastore.v1.IAllocateIdsRequest): Promise; + /** UninterpretedOption stringValue. */ + public stringValue: Uint8Array; - /** - * Calls ReserveIds. - * @param request ReserveIdsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReserveIdsResponse - */ - public reserveIds(request: google.datastore.v1.IReserveIdsRequest, callback: google.datastore.v1.Datastore.ReserveIdsCallback): void; + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; - /** - * Calls ReserveIds. - * @param request ReserveIdsRequest message or plain object - * @returns Promise - */ - public reserveIds(request: google.datastore.v1.IReserveIdsRequest): Promise; - } + /** + * 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; - namespace Datastore { + /** + * 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; - /** - * Callback as used by {@link google.datastore.v1.Datastore#lookup}. - * @param error Error, if any - * @param [response] LookupResponse - */ - type LookupCallback = (error: (Error|null), response?: google.datastore.v1.LookupResponse) => void; + /** + * 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; - /** - * Callback as used by {@link google.datastore.v1.Datastore#runQuery}. - * @param error Error, if any - * @param [response] RunQueryResponse - */ - type RunQueryCallback = (error: (Error|null), response?: google.datastore.v1.RunQueryResponse) => void; + /** + * 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; - /** - * Callback as used by {@link google.datastore.v1.Datastore#beginTransaction}. - * @param error Error, if any - * @param [response] BeginTransactionResponse - */ - type BeginTransactionCallback = (error: (Error|null), response?: google.datastore.v1.BeginTransactionResponse) => void; + /** + * 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; - /** - * Callback as used by {@link google.datastore.v1.Datastore#commit}. - * @param error Error, if any - * @param [response] CommitResponse - */ - type CommitCallback = (error: (Error|null), response?: google.datastore.v1.CommitResponse) => void; + /** + * 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); - /** - * Callback as used by {@link google.datastore.v1.Datastore#rollback}. - * @param error Error, if any - * @param [response] RollbackResponse - */ - type RollbackCallback = (error: (Error|null), response?: google.datastore.v1.RollbackResponse) => void; + /** + * 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; - /** - * Callback as used by {@link google.datastore.v1.Datastore#allocateIds}. - * @param error Error, if any - * @param [response] AllocateIdsResponse - */ - type AllocateIdsCallback = (error: (Error|null), response?: google.datastore.v1.AllocateIdsResponse) => void; + /** + * 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 }; - /** - * Callback as used by {@link google.datastore.v1.Datastore#reserveIds}. - * @param error Error, if any - * @param [response] ReserveIdsResponse - */ - type ReserveIdsCallback = (error: (Error|null), response?: google.datastore.v1.ReserveIdsResponse) => void; - } + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a LookupRequest. */ - interface ILookupRequest { + namespace UninterpretedOption { - /** LookupRequest projectId */ - projectId?: (string|null); + /** Properties of a NamePart. */ + interface INamePart { - /** LookupRequest readOptions */ - readOptions?: (google.datastore.v1.IReadOptions|null); + /** NamePart namePart */ + namePart: string; - /** LookupRequest keys */ - keys?: (google.datastore.v1.IKey[]|null); + /** NamePart isExtension */ + isExtension: boolean; } - /** Represents a LookupRequest. */ - class LookupRequest implements ILookupRequest { + /** Represents a NamePart. */ + class NamePart implements INamePart { /** - * Constructs a new LookupRequest. + * Constructs a new NamePart. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.ILookupRequest); - - /** LookupRequest projectId. */ - public projectId: string; + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - /** LookupRequest readOptions. */ - public readOptions?: (google.datastore.v1.IReadOptions|null); + /** NamePart namePart. */ + public namePart: string; - /** LookupRequest keys. */ - public keys: google.datastore.v1.IKey[]; + /** NamePart isExtension. */ + public isExtension: boolean; /** - * Creates a new LookupRequest instance using the specified properties. + * Creates a new NamePart instance using the specified properties. * @param [properties] Properties to set - * @returns LookupRequest instance + * @returns NamePart instance */ - public static create(properties?: google.datastore.v1.ILookupRequest): google.datastore.v1.LookupRequest; + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; /** - * Encodes the specified LookupRequest message. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. - * @param message LookupRequest message or plain object to encode + * 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.datastore.v1.ILookupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LookupRequest message, length delimited. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. - * @param message LookupRequest message or plain object to encode + * 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.datastore.v1.ILookupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LookupRequest message from the specified reader or buffer. + * 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 LookupRequest + * @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.datastore.v1.LookupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; /** - * Decodes a LookupRequest message from the specified reader or buffer, length delimited. + * Decodes a NamePart message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LookupRequest + * @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.datastore.v1.LookupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; /** - * Verifies a LookupRequest message. + * 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 LookupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LookupRequest + * @returns NamePart */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.LookupRequest; + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a LookupRequest message. Also converts values to other types if specified. - * @param message LookupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.LookupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this LookupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + namespace SourceCodeInfo { - /** Properties of a LookupResponse. */ - interface ILookupResponse { + /** Properties of a Location. */ + interface ILocation { - /** LookupResponse found */ - found?: (google.datastore.v1.IEntityResult[]|null); + /** Location path */ + path?: (number[]|null); - /** LookupResponse missing */ - missing?: (google.datastore.v1.IEntityResult[]|null); + /** Location span */ + span?: (number[]|null); - /** LookupResponse deferred */ - deferred?: (google.datastore.v1.IKey[]|null); + /** Location leadingComments */ + leadingComments?: (string|null); - /** LookupResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); } - /** Represents a LookupResponse. */ - class LookupResponse implements ILookupResponse { + /** Represents a Location. */ + class Location implements ILocation { /** - * Constructs a new LookupResponse. + * Constructs a new Location. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.ILookupResponse); + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** LookupResponse found. */ - public found: google.datastore.v1.IEntityResult[]; + /** Location path. */ + public path: number[]; - /** LookupResponse missing. */ - public missing: google.datastore.v1.IEntityResult[]; + /** Location span. */ + public span: number[]; - /** LookupResponse deferred. */ - public deferred: google.datastore.v1.IKey[]; + /** Location leadingComments. */ + public leadingComments: string; - /** LookupResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; /** - * Creates a new LookupResponse instance using the specified properties. + * Creates a new Location instance using the specified properties. * @param [properties] Properties to set - * @returns LookupResponse instance + * @returns Location instance */ - public static create(properties?: google.datastore.v1.ILookupResponse): google.datastore.v1.LookupResponse; + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; /** - * Encodes the specified LookupResponse message. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. - * @param message LookupResponse message or plain object to encode + * 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.datastore.v1.ILookupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LookupResponse message, length delimited. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. - * @param message LookupResponse message or plain object to encode + * 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.datastore.v1.ILookupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LookupResponse message from the specified reader or buffer. + * 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 LookupResponse + * @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.datastore.v1.LookupResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; /** - * Decodes a LookupResponse message from the specified reader or buffer, length delimited. + * Decodes a Location message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LookupResponse + * @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.datastore.v1.LookupResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; /** - * Verifies a LookupResponse message. + * 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 LookupResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Location message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LookupResponse + * @returns Location */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.LookupResponse; + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; /** - * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. - * @param message LookupResponse + * 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.datastore.v1.LookupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LookupResponse to JSON. + * Converts this Location to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a RunQueryRequest. */ - interface IRunQueryRequest { + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { - /** RunQueryRequest projectId */ - projectId?: (string|null); + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } - /** RunQueryRequest partitionId */ - partitionId?: (google.datastore.v1.IPartitionId|null); + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { - /** RunQueryRequest readOptions */ - readOptions?: (google.datastore.v1.IReadOptions|null); + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); - /** RunQueryRequest query */ - query?: (google.datastore.v1.IQuery|null); + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - /** RunQueryRequest gqlQuery */ - gqlQuery?: (google.datastore.v1.IGqlQuery|null); + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); } - /** Represents a RunQueryRequest. */ - class RunQueryRequest implements IRunQueryRequest { + /** Represents an Annotation. */ + class Annotation implements IAnnotation { /** - * Constructs a new RunQueryRequest. + * Constructs a new Annotation. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IRunQueryRequest); - - /** RunQueryRequest projectId. */ - public projectId: string; - - /** RunQueryRequest partitionId. */ - public partitionId?: (google.datastore.v1.IPartitionId|null); + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - /** RunQueryRequest readOptions. */ - public readOptions?: (google.datastore.v1.IReadOptions|null); + /** Annotation path. */ + public path: number[]; - /** RunQueryRequest query. */ - public query?: (google.datastore.v1.IQuery|null); + /** Annotation sourceFile. */ + public sourceFile: string; - /** RunQueryRequest gqlQuery. */ - public gqlQuery?: (google.datastore.v1.IGqlQuery|null); + /** Annotation begin. */ + public begin: number; - /** RunQueryRequest queryType. */ - public queryType?: ("query"|"gqlQuery"); + /** Annotation end. */ + public end: number; /** - * Creates a new RunQueryRequest instance using the specified properties. + * Creates a new Annotation instance using the specified properties. * @param [properties] Properties to set - * @returns RunQueryRequest instance + * @returns Annotation instance */ - public static create(properties?: google.datastore.v1.IRunQueryRequest): google.datastore.v1.RunQueryRequest; + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. - * @param message RunQueryRequest message or plain object to encode + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IRunQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. - * @param message RunQueryRequest message or plain object to encode + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IRunQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RunQueryRequest message from the specified reader or buffer. + * Decodes an Annotation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RunQueryRequest + * @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.datastore.v1.RunQueryRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. + * Decodes an Annotation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RunQueryRequest + * @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.datastore.v1.RunQueryRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; /** - * Verifies a RunQueryRequest message. + * Verifies an Annotation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunQueryRequest; + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - /** - * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. - * @param message RunQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.RunQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this RunQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a RunQueryResponse. */ - interface IRunQueryResponse { + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; - /** RunQueryResponse batch */ - batch?: (google.datastore.v1.IQueryResultBatch|null); + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; - /** RunQueryResponse query */ - query?: (google.datastore.v1.IQuery|null); - } + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a RunQueryResponse. */ - class RunQueryResponse implements IRunQueryResponse { + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - /** - * Constructs a new RunQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRunQueryResponse); + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** RunQueryResponse batch. */ - public batch?: (google.datastore.v1.IQueryResultBatch|null); + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** RunQueryResponse query. */ - public query?: (google.datastore.v1.IQuery|null); + /** Properties of a UInt64Value. */ + interface IUInt64Value { - /** - * Creates a new RunQueryResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RunQueryResponse instance - */ - public static create(properties?: google.datastore.v1.IRunQueryResponse): google.datastore.v1.RunQueryResponse; + /** UInt64Value value */ + value?: (number|Long|null); + } - /** - * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. - * @param message RunQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IRunQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { - /** - * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. - * @param message RunQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IRunQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); - /** - * Decodes a RunQueryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunQueryResponse; + /** UInt64Value value. */ + public value: (number|Long); - /** - * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunQueryResponse; + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; - /** - * Verifies a RunQueryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunQueryResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunQueryResponse; + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. - * @param message RunQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.RunQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; - /** - * Converts this RunQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; - /** Properties of a BeginTransactionRequest. */ - interface IBeginTransactionRequest { + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** BeginTransactionRequest projectId */ - projectId?: (string|null); + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - /** BeginTransactionRequest transactionOptions */ - transactionOptions?: (google.datastore.v1.ITransactionOptions|null); - } + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a BeginTransactionRequest. */ - class BeginTransactionRequest implements IBeginTransactionRequest { + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new BeginTransactionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IBeginTransactionRequest); + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } - /** BeginTransactionRequest projectId. */ - public projectId: string; + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { - /** BeginTransactionRequest transactionOptions. */ - public transactionOptions?: (google.datastore.v1.ITransactionOptions|null); + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); - /** - * Creates a new BeginTransactionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BeginTransactionRequest instance - */ - public static create(properties?: google.datastore.v1.IBeginTransactionRequest): google.datastore.v1.BeginTransactionRequest; + /** Int32Value value. */ + public value: number; - /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.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.datastore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; - /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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.datastore.v1.BeginTransactionRequest; + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes 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.datastore.v1.BeginTransactionRequest; + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; - /** - * 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); + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; - /** - * 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.datastore.v1.BeginTransactionRequest; + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a 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.datastore.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - /** - * Converts this BeginTransactionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a BeginTransactionResponse. */ - interface IBeginTransactionResponse { + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** BeginTransactionResponse transaction */ - transaction?: (Uint8Array|string|null); - } + /** Properties of a UInt32Value. */ + interface IUInt32Value { - /** Represents a BeginTransactionResponse. */ - class BeginTransactionResponse implements IBeginTransactionResponse { + /** UInt32Value value */ + value?: (number|null); + } - /** - * Constructs a new BeginTransactionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IBeginTransactionResponse); + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { - /** BeginTransactionResponse transaction. */ - public transaction: (Uint8Array|string); + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); - /** - * Creates a new BeginTransactionResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BeginTransactionResponse instance - */ - public static create(properties?: google.datastore.v1.IBeginTransactionResponse): google.datastore.v1.BeginTransactionResponse; + /** UInt32Value value. */ + public value: number; - /** - * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @param message BeginTransactionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IBeginTransactionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - /** - * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @param message BeginTransactionResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IBeginTransactionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BeginTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.BeginTransactionResponse; + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BeginTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.BeginTransactionResponse; + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; - /** - * Verifies a BeginTransactionResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - /** - * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BeginTransactionResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.BeginTransactionResponse; + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. - * @param message BeginTransactionResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.BeginTransactionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this BeginTransactionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a BoolValue. */ + interface IBoolValue { - /** Properties of a RollbackRequest. */ - interface IRollbackRequest { + /** BoolValue value */ + value?: (boolean|null); + } - /** RollbackRequest projectId */ - projectId?: (string|null); + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { - /** RollbackRequest transaction */ - transaction?: (Uint8Array|string|null); - } + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); - /** Represents a RollbackRequest. */ - class RollbackRequest implements IRollbackRequest { + /** BoolValue value. */ + public value: boolean; - /** - * Constructs a new RollbackRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRollbackRequest); + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; - /** RollbackRequest projectId. */ - public projectId: string; + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** RollbackRequest transaction. */ - public transaction: (Uint8Array|string); + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new RollbackRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RollbackRequest instance - */ - public static create(properties?: google.datastore.v1.IRollbackRequest): google.datastore.v1.RollbackRequest; + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; - /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.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.datastore.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; - /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * 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.datastore.v1.RollbackRequest; + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - /** - * 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.datastore.v1.RollbackRequest; + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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); + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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.datastore.v1.RollbackRequest; + /** Properties of a StringValue. */ + interface IStringValue { - /** - * 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.datastore.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** StringValue value */ + value?: (string|null); + } - /** - * Converts this RollbackRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a StringValue. */ + class StringValue implements IStringValue { - /** Properties of a RollbackResponse. */ - interface IRollbackResponse { - } + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); - /** Represents a RollbackResponse. */ - class RollbackResponse implements IRollbackResponse { + /** StringValue value. */ + public value: string; - /** - * Constructs a new RollbackResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRollbackResponse); + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; - /** - * Creates a new RollbackResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RollbackResponse instance - */ - public static create(properties?: google.datastore.v1.IRollbackResponse): google.datastore.v1.RollbackResponse; + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. - * @param message RollbackResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IRollbackResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. - * @param message RollbackResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IRollbackResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; - /** - * Decodes a RollbackResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RollbackResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RollbackResponse; + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; - /** - * Decodes a RollbackResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RollbackResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RollbackResponse; + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a RollbackResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - /** - * Creates a RollbackResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RollbackResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.RollbackResponse; + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a RollbackResponse message. Also converts values to other types if specified. - * @param message RollbackResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.RollbackResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this RollbackResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a BytesValue. */ + interface IBytesValue { - /** Properties of a CommitRequest. */ - interface ICommitRequest { + /** BytesValue value */ + value?: (Uint8Array|null); + } - /** CommitRequest projectId */ - projectId?: (string|null); + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { - /** CommitRequest mode */ - mode?: (google.datastore.v1.CommitRequest.Mode|keyof typeof google.datastore.v1.CommitRequest.Mode|null); + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); - /** CommitRequest transaction */ - transaction?: (Uint8Array|string|null); + /** BytesValue value. */ + public value: Uint8Array; - /** CommitRequest mutations */ - mutations?: (google.datastore.v1.IMutation[]|null); - } + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - /** Represents a CommitRequest. */ - class CommitRequest implements ICommitRequest { + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new CommitRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ICommitRequest); + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** CommitRequest projectId. */ - public projectId: string; + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; - /** CommitRequest mode. */ - public mode: (google.datastore.v1.CommitRequest.Mode|keyof typeof google.datastore.v1.CommitRequest.Mode); + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; - /** CommitRequest transaction. */ - public transaction?: (Uint8Array|string|null); + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CommitRequest mutations. */ - public mutations: google.datastore.v1.IMutation[]; + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - /** CommitRequest transactionSelector. */ - public transactionSelector?: "transaction"; + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new CommitRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitRequest instance - */ - public static create(properties?: google.datastore.v1.ICommitRequest): google.datastore.v1.CommitRequest; + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.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.datastore.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an Any. */ + interface IAny { - /** - * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Any type_url */ + type_url?: (string|null); - /** - * 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.datastore.v1.CommitRequest; + /** Any value */ + value?: (Uint8Array|null); + } - /** - * 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.datastore.v1.CommitRequest; + /** Represents an Any. */ + class Any implements IAny { - /** - * 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); + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); - /** - * 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.datastore.v1.CommitRequest; + /** Any type_url. */ + public type_url: string; - /** - * 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.datastore.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Any value. */ + public value: Uint8Array; + + /** + * 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; - /** - * Converts this CommitRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: 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; - namespace CommitRequest { + /** + * 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; - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - TRANSACTIONAL = 1, - NON_TRANSACTIONAL = 2 - } - } + /** + * 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; - /** Properties of a CommitResponse. */ - interface ICommitResponse { + /** + * 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; - /** CommitResponse mutationResults */ - mutationResults?: (google.datastore.v1.IMutationResult[]|null); + /** + * 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); - /** CommitResponse indexUpdates */ - indexUpdates?: (number|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; - /** CommitResponse commitTime */ - commitTime?: (google.protobuf.ITimestamp|null); - } + /** + * 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 }; - /** Represents a CommitResponse. */ - class CommitResponse implements ICommitResponse { + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new CommitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ICommitResponse); + /** Properties of a Duration. */ + interface IDuration { - /** CommitResponse mutationResults. */ - public mutationResults: google.datastore.v1.IMutationResult[]; + /** Duration seconds */ + seconds?: (number|Long|null); - /** CommitResponse indexUpdates. */ - public indexUpdates: number; + /** Duration nanos */ + nanos?: (number|null); + } - /** CommitResponse commitTime. */ - public commitTime?: (google.protobuf.ITimestamp|null); + /** Represents a Duration. */ + class Duration implements IDuration { - /** - * Creates a new CommitResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitResponse instance - */ - public static create(properties?: google.datastore.v1.ICommitResponse): google.datastore.v1.CommitResponse; + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); - /** - * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.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.datastore.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Duration seconds. */ + public seconds: (number|Long); - /** - * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Duration nanos. */ + public nanos: number; - /** - * 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.datastore.v1.CommitResponse; + /** + * 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; - /** - * 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.datastore.v1.CommitResponse; + /** + * 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; - /** - * 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); + /** + * 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; - /** - * 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.datastore.v1.CommitResponse; + /** + * 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; - /** - * 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.datastore.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this CommitResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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); - /** Properties of an AllocateIdsRequest. */ - interface IAllocateIdsRequest { + /** + * 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; - /** AllocateIdsRequest projectId */ - projectId?: (string|null); + /** + * 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 }; - /** AllocateIdsRequest keys */ - keys?: (google.datastore.v1.IKey[]|null); - } + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents an AllocateIdsRequest. */ - class AllocateIdsRequest implements IAllocateIdsRequest { + /** Properties of an Empty. */ + interface IEmpty { + } - /** - * Constructs a new AllocateIdsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IAllocateIdsRequest); + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); - /** AllocateIdsRequest projectId. */ - public projectId: string; + /** + * 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; - /** AllocateIdsRequest keys. */ - public keys: google.datastore.v1.IKey[]; + /** + * 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; - /** - * Creates a new AllocateIdsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AllocateIdsRequest instance - */ - public static create(properties?: google.datastore.v1.IAllocateIdsRequest): google.datastore.v1.AllocateIdsRequest; + /** + * 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; - /** - * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @param message AllocateIdsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IAllocateIdsRequest, 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; - /** - * Encodes the specified AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @param message AllocateIdsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IAllocateIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes an AllocateIdsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllocateIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AllocateIdsRequest; + /** + * 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); - /** - * Decodes an AllocateIdsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllocateIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AllocateIdsRequest; + /** + * 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; - /** - * Verifies an AllocateIdsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from an 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 }; - /** - * Creates an AllocateIdsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllocateIdsRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AllocateIdsRequest; + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Creates a plain object from an AllocateIdsRequest message. Also converts values to other types if specified. - * @param message AllocateIdsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AllocateIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Namespace datastore. */ + namespace datastore { - /** - * Converts this AllocateIdsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Namespace v1. */ + namespace v1 { - /** Properties of an AllocateIdsResponse. */ - interface IAllocateIdsResponse { + /** Properties of an AggregationResult. */ + interface IAggregationResult { - /** AllocateIdsResponse keys */ - keys?: (google.datastore.v1.IKey[]|null); + /** AggregationResult aggregateProperties */ + aggregateProperties?: ({ [k: string]: google.datastore.v1.IValue }|null); } - /** Represents an AllocateIdsResponse. */ - class AllocateIdsResponse implements IAllocateIdsResponse { + /** Represents an AggregationResult. */ + class AggregationResult implements IAggregationResult { /** - * Constructs a new AllocateIdsResponse. + * Constructs a new AggregationResult. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IAllocateIdsResponse); + constructor(properties?: google.datastore.v1.IAggregationResult); - /** AllocateIdsResponse keys. */ - public keys: google.datastore.v1.IKey[]; + /** AggregationResult aggregateProperties. */ + public aggregateProperties: { [k: string]: google.datastore.v1.IValue }; /** - * Creates a new AllocateIdsResponse instance using the specified properties. + * Creates a new AggregationResult instance using the specified properties. * @param [properties] Properties to set - * @returns AllocateIdsResponse instance + * @returns AggregationResult instance */ - public static create(properties?: google.datastore.v1.IAllocateIdsResponse): google.datastore.v1.AllocateIdsResponse; + public static create(properties?: google.datastore.v1.IAggregationResult): google.datastore.v1.AggregationResult; /** - * Encodes the specified AllocateIdsResponse message. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. - * @param message AllocateIdsResponse message or plain object to encode + * Encodes the specified AggregationResult message. Does not implicitly {@link google.datastore.v1.AggregationResult.verify|verify} messages. + * @param message AggregationResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IAllocateIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IAggregationResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AllocateIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. - * @param message AllocateIdsResponse message or plain object to encode + * Encodes the specified AggregationResult message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResult.verify|verify} messages. + * @param message AggregationResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IAllocateIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IAggregationResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AllocateIdsResponse message from the specified reader or buffer. + * Decodes an AggregationResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AllocateIdsResponse + * @returns AggregationResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AllocateIdsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationResult; /** - * Decodes an AllocateIdsResponse message from the specified reader or buffer, length delimited. + * Decodes an AggregationResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AllocateIdsResponse + * @returns AggregationResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AllocateIdsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationResult; /** - * Verifies an AllocateIdsResponse message. + * Verifies an AggregationResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AllocateIdsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AllocateIdsResponse + * @returns AggregationResult */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AllocateIdsResponse; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationResult; /** - * Creates a plain object from an AllocateIdsResponse message. Also converts values to other types if specified. - * @param message AllocateIdsResponse + * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. + * @param message AggregationResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.AllocateIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.AggregationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AllocateIdsResponse to JSON. + * Converts this AggregationResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ReserveIdsRequest. */ - interface IReserveIdsRequest { + /** Properties of an AggregationResultBatch. */ + interface IAggregationResultBatch { - /** ReserveIdsRequest projectId */ - projectId?: (string|null); + /** AggregationResultBatch aggregationResults */ + aggregationResults?: (google.datastore.v1.IAggregationResult[]|null); - /** ReserveIdsRequest databaseId */ - databaseId?: (string|null); + /** AggregationResultBatch moreResults */ + moreResults?: (google.datastore.v1.QueryResultBatch.MoreResultsType|null); - /** ReserveIdsRequest keys */ - keys?: (google.datastore.v1.IKey[]|null); + /** AggregationResultBatch readTime */ + readTime?: (google.protobuf.ITimestamp|null); } - /** Represents a ReserveIdsRequest. */ - class ReserveIdsRequest implements IReserveIdsRequest { + /** Represents an AggregationResultBatch. */ + class AggregationResultBatch implements IAggregationResultBatch { /** - * Constructs a new ReserveIdsRequest. + * Constructs a new AggregationResultBatch. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IReserveIdsRequest); + constructor(properties?: google.datastore.v1.IAggregationResultBatch); - /** ReserveIdsRequest projectId. */ - public projectId: string; + /** AggregationResultBatch aggregationResults. */ + public aggregationResults: google.datastore.v1.IAggregationResult[]; - /** ReserveIdsRequest databaseId. */ - public databaseId: string; + /** AggregationResultBatch moreResults. */ + public moreResults: google.datastore.v1.QueryResultBatch.MoreResultsType; - /** ReserveIdsRequest keys. */ - public keys: google.datastore.v1.IKey[]; + /** AggregationResultBatch readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new ReserveIdsRequest instance using the specified properties. + * Creates a new AggregationResultBatch instance using the specified properties. * @param [properties] Properties to set - * @returns ReserveIdsRequest instance + * @returns AggregationResultBatch instance */ - public static create(properties?: google.datastore.v1.IReserveIdsRequest): google.datastore.v1.ReserveIdsRequest; + public static create(properties?: google.datastore.v1.IAggregationResultBatch): google.datastore.v1.AggregationResultBatch; /** - * Encodes the specified ReserveIdsRequest message. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. - * @param message ReserveIdsRequest message or plain object to encode + * Encodes the specified AggregationResultBatch message. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * @param message AggregationResultBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IReserveIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IAggregationResultBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReserveIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. - * @param message ReserveIdsRequest message or plain object to encode + * Encodes the specified AggregationResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * @param message AggregationResultBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IReserveIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IAggregationResultBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReserveIdsRequest message from the specified reader or buffer. + * Decodes an AggregationResultBatch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReserveIdsRequest + * @returns AggregationResultBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReserveIdsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationResultBatch; /** - * Decodes a ReserveIdsRequest message from the specified reader or buffer, length delimited. + * Decodes an AggregationResultBatch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReserveIdsRequest + * @returns AggregationResultBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReserveIdsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationResultBatch; /** - * Verifies a ReserveIdsRequest message. + * Verifies an AggregationResultBatch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReserveIdsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AggregationResultBatch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReserveIdsRequest + * @returns AggregationResultBatch */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReserveIdsRequest; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationResultBatch; /** - * Creates a plain object from a ReserveIdsRequest message. Also converts values to other types if specified. - * @param message ReserveIdsRequest + * Creates a plain object from an AggregationResultBatch message. Also converts values to other types if specified. + * @param message AggregationResultBatch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.ReserveIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.AggregationResultBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReserveIdsRequest to JSON. + * Converts this AggregationResultBatch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ReserveIdsResponse. */ - interface IReserveIdsResponse { + /** Properties of a PartitionId. */ + interface IPartitionId { + + /** PartitionId projectId */ + projectId?: (string|null); + + /** PartitionId databaseId */ + databaseId?: (string|null); + + /** PartitionId namespaceId */ + namespaceId?: (string|null); } - /** Represents a ReserveIdsResponse. */ - class ReserveIdsResponse implements IReserveIdsResponse { + /** Represents a PartitionId. */ + class PartitionId implements IPartitionId { /** - * Constructs a new ReserveIdsResponse. + * Constructs a new PartitionId. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IReserveIdsResponse); + constructor(properties?: google.datastore.v1.IPartitionId); + + /** PartitionId projectId. */ + public projectId: string; + + /** PartitionId databaseId. */ + public databaseId: string; + + /** PartitionId namespaceId. */ + public namespaceId: string; /** - * Creates a new ReserveIdsResponse instance using the specified properties. + * Creates a new PartitionId instance using the specified properties. * @param [properties] Properties to set - * @returns ReserveIdsResponse instance + * @returns PartitionId instance */ - public static create(properties?: google.datastore.v1.IReserveIdsResponse): google.datastore.v1.ReserveIdsResponse; + public static create(properties?: google.datastore.v1.IPartitionId): google.datastore.v1.PartitionId; /** - * Encodes the specified ReserveIdsResponse message. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. - * @param message ReserveIdsResponse message or plain object to encode + * Encodes the specified PartitionId message. Does not implicitly {@link google.datastore.v1.PartitionId.verify|verify} messages. + * @param message PartitionId message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IReserveIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IPartitionId, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReserveIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. - * @param message ReserveIdsResponse message or plain object to encode + * Encodes the specified PartitionId message, length delimited. Does not implicitly {@link google.datastore.v1.PartitionId.verify|verify} messages. + * @param message PartitionId message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IReserveIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IPartitionId, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReserveIdsResponse message from the specified reader or buffer. + * Decodes a PartitionId message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReserveIdsResponse + * @returns PartitionId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReserveIdsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.PartitionId; /** - * Decodes a ReserveIdsResponse message from the specified reader or buffer, length delimited. + * Decodes a PartitionId message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReserveIdsResponse + * @returns PartitionId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReserveIdsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.PartitionId; /** - * Verifies a ReserveIdsResponse message. + * Verifies a PartitionId message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReserveIdsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PartitionId message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReserveIdsResponse + * @returns PartitionId */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReserveIdsResponse; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.PartitionId; /** - * Creates a plain object from a ReserveIdsResponse message. Also converts values to other types if specified. - * @param message ReserveIdsResponse + * Creates a plain object from a PartitionId message. Also converts values to other types if specified. + * @param message PartitionId * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.ReserveIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.PartitionId, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReserveIdsResponse to JSON. + * Converts this PartitionId to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Mutation. */ - interface IMutation { - - /** Mutation insert */ - insert?: (google.datastore.v1.IEntity|null); - - /** Mutation update */ - update?: (google.datastore.v1.IEntity|null); - - /** Mutation upsert */ - upsert?: (google.datastore.v1.IEntity|null); - - /** Mutation delete */ - "delete"?: (google.datastore.v1.IKey|null); + /** Properties of a Key. */ + interface IKey { - /** Mutation baseVersion */ - baseVersion?: (number|Long|string|null); + /** Key partitionId */ + partitionId?: (google.datastore.v1.IPartitionId|null); - /** Mutation updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Key path */ + path?: (google.datastore.v1.Key.IPathElement[]|null); } - /** Represents a Mutation. */ - class Mutation implements IMutation { + /** Represents a Key. */ + class Key implements IKey { /** - * Constructs a new Mutation. + * Constructs a new Key. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IMutation); - - /** Mutation insert. */ - public insert?: (google.datastore.v1.IEntity|null); - - /** Mutation update. */ - public update?: (google.datastore.v1.IEntity|null); - - /** Mutation upsert. */ - public upsert?: (google.datastore.v1.IEntity|null); - - /** Mutation delete. */ - public delete?: (google.datastore.v1.IKey|null); - - /** Mutation baseVersion. */ - public baseVersion?: (number|Long|string|null); - - /** Mutation updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.datastore.v1.IKey); - /** Mutation operation. */ - public operation?: ("insert"|"update"|"upsert"|"delete"); + /** Key partitionId. */ + public partitionId?: (google.datastore.v1.IPartitionId|null); - /** Mutation conflictDetectionStrategy. */ - public conflictDetectionStrategy?: ("baseVersion"|"updateTime"); + /** Key path. */ + public path: google.datastore.v1.Key.IPathElement[]; /** - * Creates a new Mutation instance using the specified properties. + * Creates a new Key instance using the specified properties. * @param [properties] Properties to set - * @returns Mutation instance + * @returns Key instance */ - public static create(properties?: google.datastore.v1.IMutation): google.datastore.v1.Mutation; + public static create(properties?: google.datastore.v1.IKey): google.datastore.v1.Key; /** - * Encodes the specified Mutation message. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. - * @param message Mutation message or plain object to encode + * Encodes the specified Key message. Does not implicitly {@link google.datastore.v1.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.datastore.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. - * @param message Mutation message or plain object to encode + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.datastore.v1.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.datastore.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Mutation message from the specified reader or buffer. + * 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 Mutation + * @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.datastore.v1.Mutation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Key; /** - * Decodes a Mutation message from the specified reader or buffer, length delimited. + * Decodes a Key message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Mutation + * @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.datastore.v1.Mutation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Key; /** - * Verifies a Mutation message. + * 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 Mutation message from a plain object. Also converts values to their respective internal types. + * Creates a Key message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Mutation + * @returns Key */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Mutation; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.Key; /** - * Creates a plain object from a Mutation message. Also converts values to other types if specified. - * @param message Mutation + * 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.datastore.v1.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Mutation to JSON. + * Converts this Key to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a MutationResult. */ - interface IMutationResult { + namespace Key { - /** MutationResult key */ - key?: (google.datastore.v1.IKey|null); + /** Properties of a PathElement. */ + interface IPathElement { - /** MutationResult version */ - version?: (number|Long|string|null); + /** PathElement kind */ + kind?: (string|null); - /** MutationResult updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** PathElement id */ + id?: (number|Long|null); - /** MutationResult conflictDetected */ - conflictDetected?: (boolean|null); - } + /** PathElement name */ + name?: (string|null); + } - /** Represents a MutationResult. */ - class MutationResult implements IMutationResult { + /** Represents a PathElement. */ + class PathElement implements IPathElement { - /** - * Constructs a new MutationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IMutationResult); + /** + * Constructs a new PathElement. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.Key.IPathElement); - /** MutationResult key. */ - public key?: (google.datastore.v1.IKey|null); + /** PathElement kind. */ + public kind: string; - /** MutationResult version. */ - public version: (number|Long|string); + /** PathElement id. */ + public id?: (number|Long|null); + + /** PathElement name. */ + public name?: (string|null); + + /** PathElement idType. */ + public idType?: ("id"|"name"); + + /** + * Creates a new PathElement instance using the specified properties. + * @param [properties] Properties to set + * @returns PathElement instance + */ + public static create(properties?: google.datastore.v1.Key.IPathElement): google.datastore.v1.Key.PathElement; + + /** + * Encodes the specified PathElement message. Does not implicitly {@link google.datastore.v1.Key.PathElement.verify|verify} messages. + * @param message PathElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.Key.IPathElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PathElement message, length delimited. Does not implicitly {@link google.datastore.v1.Key.PathElement.verify|verify} messages. + * @param message PathElement message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.Key.IPathElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PathElement message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Key.PathElement; + + /** + * Decodes a PathElement message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Key.PathElement; + + /** + * Verifies a PathElement message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PathElement message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PathElement + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.Key.PathElement; + + /** + * Creates a plain object from a PathElement message. Also converts values to other types if specified. + * @param message PathElement + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.Key.PathElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PathElement to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ArrayValue. */ + interface IArrayValue { + + /** ArrayValue values */ + values?: (google.datastore.v1.IValue[]|null); + } + + /** Represents an ArrayValue. */ + class ArrayValue implements IArrayValue { - /** MutationResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new ArrayValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IArrayValue); - /** MutationResult conflictDetected. */ - public conflictDetected: boolean; + /** ArrayValue values. */ + public values: google.datastore.v1.IValue[]; /** - * Creates a new MutationResult instance using the specified properties. + * Creates a new ArrayValue instance using the specified properties. * @param [properties] Properties to set - * @returns MutationResult instance + * @returns ArrayValue instance */ - public static create(properties?: google.datastore.v1.IMutationResult): google.datastore.v1.MutationResult; + public static create(properties?: google.datastore.v1.IArrayValue): google.datastore.v1.ArrayValue; /** - * Encodes the specified MutationResult message. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. - * @param message MutationResult message or plain object to encode + * Encodes the specified ArrayValue message. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. + * @param message ArrayValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IMutationResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MutationResult message, length delimited. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. - * @param message MutationResult message or plain object to encode + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. + * @param message ArrayValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IMutationResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MutationResult message from the specified reader or buffer. + * Decodes an ArrayValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MutationResult + * @returns ArrayValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.MutationResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ArrayValue; /** - * Decodes a MutationResult message from the specified reader or buffer, length delimited. + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MutationResult + * @returns ArrayValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.MutationResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ArrayValue; /** - * Verifies a MutationResult message. + * Verifies an ArrayValue message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MutationResult message from a plain object. Also converts values to their respective internal types. + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MutationResult + * @returns ArrayValue */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.MutationResult; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.ArrayValue; /** - * Creates a plain object from a MutationResult message. Also converts values to other types if specified. - * @param message MutationResult + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @param message ArrayValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.MutationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.ArrayValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MutationResult to JSON. + * Converts this ArrayValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ReadOptions. */ - interface IReadOptions { + /** Properties of a Value. */ + interface IValue { - /** ReadOptions readConsistency */ - readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|keyof typeof google.datastore.v1.ReadOptions.ReadConsistency|null); + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|null); - /** ReadOptions transaction */ - transaction?: (Uint8Array|string|null); + /** Value booleanValue */ + booleanValue?: (boolean|null); - /** ReadOptions readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** Value integerValue */ + integerValue?: (number|Long|null); + + /** Value doubleValue */ + doubleValue?: (number|null); + + /** Value timestampValue */ + timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value keyValue */ + keyValue?: (google.datastore.v1.IKey|null); + + /** Value stringValue */ + stringValue?: (string|null); + + /** Value blobValue */ + blobValue?: (Uint8Array|null); + + /** Value geoPointValue */ + geoPointValue?: (google.type.ILatLng|null); + + /** Value entityValue */ + entityValue?: (google.datastore.v1.IEntity|null); + + /** Value arrayValue */ + arrayValue?: (google.datastore.v1.IArrayValue|null); + + /** Value meaning */ + meaning?: (number|null); + + /** Value excludeFromIndexes */ + excludeFromIndexes?: (boolean|null); } - /** Represents a ReadOptions. */ - class ReadOptions implements IReadOptions { + /** Represents a Value. */ + class Value implements IValue { /** - * Constructs a new ReadOptions. + * Constructs a new Value. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IReadOptions); + constructor(properties?: google.datastore.v1.IValue); - /** ReadOptions readConsistency. */ - public readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|keyof typeof google.datastore.v1.ReadOptions.ReadConsistency|null); + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|null); - /** ReadOptions transaction. */ - public transaction?: (Uint8Array|string|null); + /** Value booleanValue. */ + public booleanValue?: (boolean|null); - /** ReadOptions readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** Value integerValue. */ + public integerValue?: (number|Long|null); - /** ReadOptions consistencyType. */ - public consistencyType?: ("readConsistency"|"transaction"|"readTime"); + /** Value doubleValue. */ + public doubleValue?: (number|null); + + /** Value timestampValue. */ + public timestampValue?: (google.protobuf.ITimestamp|null); + + /** Value keyValue. */ + public keyValue?: (google.datastore.v1.IKey|null); + + /** Value stringValue. */ + public stringValue?: (string|null); + + /** Value blobValue. */ + public blobValue?: (Uint8Array|null); + + /** Value geoPointValue. */ + public geoPointValue?: (google.type.ILatLng|null); + + /** Value entityValue. */ + public entityValue?: (google.datastore.v1.IEntity|null); + + /** Value arrayValue. */ + public arrayValue?: (google.datastore.v1.IArrayValue|null); + + /** Value meaning. */ + public meaning: number; + + /** Value excludeFromIndexes. */ + public excludeFromIndexes: boolean; + + /** Value valueType. */ + public valueType?: ("nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"keyValue"|"stringValue"|"blobValue"|"geoPointValue"|"entityValue"|"arrayValue"); /** - * Creates a new ReadOptions instance using the specified properties. + * Creates a new Value instance using the specified properties. * @param [properties] Properties to set - * @returns ReadOptions instance + * @returns Value instance */ - public static create(properties?: google.datastore.v1.IReadOptions): google.datastore.v1.ReadOptions; + public static create(properties?: google.datastore.v1.IValue): google.datastore.v1.Value; /** - * Encodes the specified ReadOptions message. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. - * @param message ReadOptions message or plain object to encode + * Encodes the specified Value message. Does not implicitly {@link google.datastore.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.datastore.v1.IReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. - * @param message ReadOptions message or plain object to encode + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadOptions message from the specified reader or buffer. + * 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 ReadOptions + * @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.datastore.v1.ReadOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Value; /** - * Decodes a ReadOptions message from the specified reader or buffer, length delimited. + * Decodes a Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadOptions + * @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.datastore.v1.ReadOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Value; /** - * Verifies a ReadOptions message. + * 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 ReadOptions message from a plain object. Also converts values to their respective internal types. + * Creates a Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadOptions + * @returns Value */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReadOptions; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.Value; /** - * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. - * @param message ReadOptions + * 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.datastore.v1.ReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadOptions to JSON. + * Converts this Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ReadOptions { - - /** ReadConsistency enum. */ - enum ReadConsistency { - READ_CONSISTENCY_UNSPECIFIED = 0, - STRONG = 1, - EVENTUAL = 2 - } - } - - /** Properties of a TransactionOptions. */ - interface ITransactionOptions { + /** Properties of an Entity. */ + interface IEntity { - /** TransactionOptions readWrite */ - readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); + /** Entity key */ + key?: (google.datastore.v1.IKey|null); - /** TransactionOptions readOnly */ - readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); + /** Entity properties */ + properties?: ({ [k: string]: google.datastore.v1.IValue }|null); } - /** Represents a TransactionOptions. */ - class TransactionOptions implements ITransactionOptions { + /** Represents an Entity. */ + class Entity implements IEntity { /** - * Constructs a new TransactionOptions. + * Constructs a new Entity. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.ITransactionOptions); - - /** TransactionOptions readWrite. */ - public readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); + constructor(properties?: google.datastore.v1.IEntity); - /** TransactionOptions readOnly. */ - public readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); + /** Entity key. */ + public key?: (google.datastore.v1.IKey|null); - /** TransactionOptions mode. */ - public mode?: ("readWrite"|"readOnly"); + /** Entity properties. */ + public properties: { [k: string]: google.datastore.v1.IValue }; /** - * Creates a new TransactionOptions instance using the specified properties. + * Creates a new Entity instance using the specified properties. * @param [properties] Properties to set - * @returns TransactionOptions instance + * @returns Entity instance */ - public static create(properties?: google.datastore.v1.ITransactionOptions): google.datastore.v1.TransactionOptions; + public static create(properties?: google.datastore.v1.IEntity): google.datastore.v1.Entity; /** - * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. - * @param message TransactionOptions message or plain object to encode + * Encodes the specified Entity message. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. - * @param message TransactionOptions message or plain object to encode + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TransactionOptions message from the specified reader or buffer. + * Decodes an Entity message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TransactionOptions + * @returns Entity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.TransactionOptions; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Entity; /** - * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. + * Decodes an Entity message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TransactionOptions + * @returns Entity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.TransactionOptions; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Entity; /** - * Verifies a TransactionOptions message. + * Verifies an Entity message. * @param message Plain object 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. + * Creates an Entity message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TransactionOptions + * @returns Entity */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.TransactionOptions; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.Entity; /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @param message TransactionOptions + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TransactionOptions to JSON. + * Converts this Entity to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace TransactionOptions { - - /** Properties of a ReadWrite. */ - interface IReadWrite { - - /** ReadWrite previousTransaction */ - previousTransaction?: (Uint8Array|string|null); - } - - /** Represents a ReadWrite. */ - class ReadWrite implements IReadWrite { - - /** - * Constructs a new ReadWrite. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.TransactionOptions.IReadWrite); - - /** ReadWrite previousTransaction. */ - public previousTransaction: (Uint8Array|string); - - /** - * Creates a new ReadWrite instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadWrite instance - */ - public static create(properties?: google.datastore.v1.TransactionOptions.IReadWrite): google.datastore.v1.TransactionOptions.ReadWrite; - - /** - * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.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.datastore.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.datastore.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.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReadWrite to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReadOnly. */ - interface IReadOnly { - - /** ReadOnly readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ReadOnly. */ - class ReadOnly implements IReadOnly { - - /** - * Constructs a new ReadOnly. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.TransactionOptions.IReadOnly); - - /** ReadOnly readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new ReadOnly instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadOnly instance - */ - public static create(properties?: google.datastore.v1.TransactionOptions.IReadOnly): google.datastore.v1.TransactionOptions.ReadOnly; - - /** - * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.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.datastore.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.datastore.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.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of an EntityResult. */ + interface IEntityResult { - /** - * Converts this ReadOnly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** EntityResult entity */ + entity?: (google.datastore.v1.IEntity|null); - /** Properties of a PartitionId. */ - interface IPartitionId { + /** EntityResult version */ + version?: (number|Long|null); - /** PartitionId projectId */ - projectId?: (string|null); + /** EntityResult updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** PartitionId namespaceId */ - namespaceId?: (string|null); + /** EntityResult cursor */ + cursor?: (Uint8Array|null); } - /** Represents a PartitionId. */ - class PartitionId implements IPartitionId { + /** Represents an EntityResult. */ + class EntityResult implements IEntityResult { /** - * Constructs a new PartitionId. + * Constructs a new EntityResult. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IPartitionId); + constructor(properties?: google.datastore.v1.IEntityResult); - /** PartitionId projectId. */ - public projectId: string; + /** EntityResult entity. */ + public entity?: (google.datastore.v1.IEntity|null); - /** PartitionId namespaceId. */ - public namespaceId: string; + /** EntityResult version. */ + public version: (number|Long); + + /** EntityResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** EntityResult cursor. */ + public cursor: Uint8Array; /** - * Creates a new PartitionId instance using the specified properties. + * Creates a new EntityResult instance using the specified properties. * @param [properties] Properties to set - * @returns PartitionId instance + * @returns EntityResult instance */ - public static create(properties?: google.datastore.v1.IPartitionId): google.datastore.v1.PartitionId; + public static create(properties?: google.datastore.v1.IEntityResult): google.datastore.v1.EntityResult; /** - * Encodes the specified PartitionId message. Does not implicitly {@link google.datastore.v1.PartitionId.verify|verify} messages. - * @param message PartitionId message or plain object to encode + * Encodes the specified EntityResult message. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. + * @param message EntityResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IPartitionId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IEntityResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PartitionId message, length delimited. Does not implicitly {@link google.datastore.v1.PartitionId.verify|verify} messages. - * @param message PartitionId message or plain object to encode + * Encodes the specified EntityResult message, length delimited. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. + * @param message EntityResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IPartitionId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IEntityResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PartitionId message from the specified reader or buffer. + * Decodes an EntityResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PartitionId + * @returns EntityResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.PartitionId; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.EntityResult; /** - * Decodes a PartitionId message from the specified reader or buffer, length delimited. + * Decodes an EntityResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PartitionId + * @returns EntityResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.PartitionId; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.EntityResult; /** - * Verifies a PartitionId message. + * Verifies an EntityResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PartitionId message from a plain object. Also converts values to their respective internal types. + * Creates an EntityResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PartitionId + * @returns EntityResult */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PartitionId; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.EntityResult; /** - * Creates a plain object from a PartitionId message. Also converts values to other types if specified. - * @param message PartitionId + * Creates a plain object from an EntityResult message. Also converts values to other types if specified. + * @param message EntityResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.PartitionId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.EntityResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PartitionId to JSON. + * Converts this EntityResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Key. */ - interface IKey { + namespace EntityResult { - /** Key partitionId */ - partitionId?: (google.datastore.v1.IPartitionId|null); + /** ResultType enum. */ + enum ResultType { + RESULT_TYPE_UNSPECIFIED = 0, + FULL = 1, + PROJECTION = 2, + KEY_ONLY = 3 + } + } - /** Key path */ - path?: (google.datastore.v1.Key.IPathElement[]|null); + /** Properties of a Query. */ + interface IQuery { + + /** Query projection */ + projection?: (google.datastore.v1.IProjection[]|null); + + /** Query kind */ + kind?: (google.datastore.v1.IKindExpression[]|null); + + /** Query filter */ + filter?: (google.datastore.v1.IFilter|null); + + /** Query order */ + order?: (google.datastore.v1.IPropertyOrder[]|null); + + /** Query distinctOn */ + distinctOn?: (google.datastore.v1.IPropertyReference[]|null); + + /** Query startCursor */ + startCursor?: (Uint8Array|null); + + /** Query endCursor */ + endCursor?: (Uint8Array|null); + + /** Query offset */ + offset?: (number|null); + + /** Query limit */ + limit?: (google.protobuf.IInt32Value|null); } - /** Represents a Key. */ - class Key implements IKey { + /** Represents a Query. */ + class Query implements IQuery { /** - * Constructs a new Key. + * Constructs a new Query. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IKey); + constructor(properties?: google.datastore.v1.IQuery); - /** Key partitionId. */ - public partitionId?: (google.datastore.v1.IPartitionId|null); + /** Query projection. */ + public projection: google.datastore.v1.IProjection[]; - /** Key path. */ - public path: google.datastore.v1.Key.IPathElement[]; + /** Query kind. */ + public kind: google.datastore.v1.IKindExpression[]; + + /** Query filter. */ + public filter?: (google.datastore.v1.IFilter|null); + + /** Query order. */ + public order: google.datastore.v1.IPropertyOrder[]; + + /** Query distinctOn. */ + public distinctOn: google.datastore.v1.IPropertyReference[]; + + /** Query startCursor. */ + public startCursor: Uint8Array; + + /** Query endCursor. */ + public endCursor: Uint8Array; + + /** Query offset. */ + public offset: number; + + /** Query limit. */ + public limit?: (google.protobuf.IInt32Value|null); /** - * Creates a new Key instance using the specified properties. + * Creates a new Query instance using the specified properties. * @param [properties] Properties to set - * @returns Key instance + * @returns Query instance */ - public static create(properties?: google.datastore.v1.IKey): google.datastore.v1.Key; + public static create(properties?: google.datastore.v1.IQuery): google.datastore.v1.Query; /** - * Encodes the specified Key message. Does not implicitly {@link google.datastore.v1.Key.verify|verify} messages. - * @param message Key message or plain object to encode + * Encodes the specified Query message. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. + * @param message Query message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.datastore.v1.Key.verify|verify} messages. - * @param message Key message or plain object to encode + * Encodes the specified Query message, length delimited. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. + * @param message Query message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Key message from the specified reader or buffer. + * Decodes a Query message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Key + * @returns Query * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Key; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Query; /** - * Decodes a Key message from the specified reader or buffer, length delimited. + * Decodes a Query message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Key + * @returns Query * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Key; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Query; /** - * Verifies a Key message. + * Verifies a Query message. * @param message Plain object 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. + * Creates a Query 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.datastore.v1.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 + * @returns Query */ - public static toObject(message: google.datastore.v1.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.Query; /** - * Converts this Key to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Key { - - /** Properties of a PathElement. */ - interface IPathElement { - - /** PathElement kind */ - kind?: (string|null); - - /** PathElement id */ - id?: (number|Long|string|null); - - /** PathElement name */ - name?: (string|null); - } - - /** Represents a PathElement. */ - class PathElement implements IPathElement { - - /** - * Constructs a new PathElement. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.Key.IPathElement); - - /** PathElement kind. */ - public kind: string; - - /** PathElement id. */ - public id?: (number|Long|string|null); - - /** PathElement name. */ - public name?: (string|null); - - /** PathElement idType. */ - public idType?: ("id"|"name"); - - /** - * Creates a new PathElement instance using the specified properties. - * @param [properties] Properties to set - * @returns PathElement instance - */ - public static create(properties?: google.datastore.v1.Key.IPathElement): google.datastore.v1.Key.PathElement; - - /** - * Encodes the specified PathElement message. Does not implicitly {@link google.datastore.v1.Key.PathElement.verify|verify} messages. - * @param message PathElement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.Key.IPathElement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PathElement message, length delimited. Does not implicitly {@link google.datastore.v1.Key.PathElement.verify|verify} messages. - * @param message PathElement message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.Key.IPathElement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PathElement message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PathElement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Key.PathElement; - - /** - * Decodes a PathElement message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PathElement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Key.PathElement; - - /** - * Verifies a PathElement message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PathElement message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PathElement - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Key.PathElement; - - /** - * Creates a plain object from a PathElement message. Also converts values to other types if specified. - * @param message PathElement - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.Key.PathElement, options?: $protobuf.IConversionOptions): { [k: string]: any }; + * Creates a plain object from a Query message. Also converts values to other types if specified. + * @param message Query + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.Query, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this PathElement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this Query to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of an ArrayValue. */ - interface IArrayValue { + /** Properties of an AggregationQuery. */ + interface IAggregationQuery { - /** ArrayValue values */ - values?: (google.datastore.v1.IValue[]|null); + /** AggregationQuery nestedQuery */ + nestedQuery?: (google.datastore.v1.IQuery|null); + + /** AggregationQuery aggregations */ + aggregations?: (google.datastore.v1.AggregationQuery.IAggregation[]|null); } - /** Represents an ArrayValue. */ - class ArrayValue implements IArrayValue { + /** Represents an AggregationQuery. */ + class AggregationQuery implements IAggregationQuery { /** - * Constructs a new ArrayValue. + * Constructs a new AggregationQuery. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IArrayValue); + constructor(properties?: google.datastore.v1.IAggregationQuery); - /** ArrayValue values. */ - public values: google.datastore.v1.IValue[]; + /** AggregationQuery nestedQuery. */ + public nestedQuery?: (google.datastore.v1.IQuery|null); + + /** AggregationQuery aggregations. */ + public aggregations: google.datastore.v1.AggregationQuery.IAggregation[]; + + /** AggregationQuery queryType. */ + public queryType?: "nestedQuery"; /** - * Creates a new ArrayValue instance using the specified properties. + * Creates a new AggregationQuery instance using the specified properties. * @param [properties] Properties to set - * @returns ArrayValue instance + * @returns AggregationQuery instance */ - public static create(properties?: google.datastore.v1.IArrayValue): google.datastore.v1.ArrayValue; + public static create(properties?: google.datastore.v1.IAggregationQuery): google.datastore.v1.AggregationQuery; /** - * Encodes the specified ArrayValue message. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. - * @param message ArrayValue message or plain object to encode + * Encodes the specified AggregationQuery message. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. + * @param message AggregationQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IAggregationQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. - * @param message ArrayValue message or plain object to encode + * Encodes the specified AggregationQuery message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. + * @param message AggregationQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IAggregationQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ArrayValue message from the specified reader or buffer. + * Decodes an AggregationQuery message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ArrayValue + * @returns AggregationQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ArrayValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationQuery; /** - * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * Decodes an AggregationQuery message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ArrayValue + * @returns AggregationQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ArrayValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationQuery; /** - * Verifies an ArrayValue message. + * Verifies an AggregationQuery message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * Creates an AggregationQuery message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ArrayValue + * @returns AggregationQuery */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ArrayValue; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery; /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. - * @param message ArrayValue + * Creates a plain object from an AggregationQuery message. Also converts values to other types if specified. + * @param message AggregationQuery * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.ArrayValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.AggregationQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ArrayValue to JSON. + * Converts this AggregationQuery to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Value. */ - interface IValue { + namespace AggregationQuery { - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + /** Properties of an Aggregation. */ + interface IAggregation { - /** Value booleanValue */ - booleanValue?: (boolean|null); + /** Aggregation count */ + count?: (google.datastore.v1.AggregationQuery.Aggregation.ICount|null); - /** Value integerValue */ - integerValue?: (number|Long|string|null); + /** Aggregation alias */ + alias?: (string|null); + } - /** Value doubleValue */ - doubleValue?: (number|null); + /** Represents an Aggregation. */ + class Aggregation implements IAggregation { - /** Value timestampValue */ - timestampValue?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new Aggregation. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.AggregationQuery.IAggregation); - /** Value keyValue */ - keyValue?: (google.datastore.v1.IKey|null); + /** Aggregation count. */ + public count?: (google.datastore.v1.AggregationQuery.Aggregation.ICount|null); - /** Value stringValue */ - stringValue?: (string|null); + /** Aggregation alias. */ + public alias: string; - /** Value blobValue */ - blobValue?: (Uint8Array|string|null); + /** Aggregation operator. */ + public operator?: "count"; - /** Value geoPointValue */ - geoPointValue?: (google.type.ILatLng|null); + /** + * Creates a new Aggregation instance using the specified properties. + * @param [properties] Properties to set + * @returns Aggregation instance + */ + public static create(properties?: google.datastore.v1.AggregationQuery.IAggregation): google.datastore.v1.AggregationQuery.Aggregation; - /** Value entityValue */ - entityValue?: (google.datastore.v1.IEntity|null); + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.AggregationQuery.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; - /** Value arrayValue */ - arrayValue?: (google.datastore.v1.IArrayValue|null); + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.verify|verify} messages. + * @param message Aggregation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.AggregationQuery.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; - /** Value meaning */ - meaning?: (number|null); + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationQuery.Aggregation; - /** Value excludeFromIndexes */ - excludeFromIndexes?: (boolean|null); - } + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationQuery.Aggregation; - /** Represents a Value. */ - class Value implements IValue { + /** + * Verifies an Aggregation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IValue); + /** + * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Aggregation + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery.Aggregation; - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + /** + * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * @param message Aggregation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.AggregationQuery.Aggregation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Value booleanValue. */ - public booleanValue?: (boolean|null); + /** + * Converts this Aggregation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Value integerValue. */ - public integerValue?: (number|Long|string|null); + namespace Aggregation { - /** Value doubleValue. */ - public doubleValue?: (number|null); + /** Properties of a Count. */ + interface ICount { - /** Value timestampValue. */ - public timestampValue?: (google.protobuf.ITimestamp|null); + /** Count upTo */ + upTo?: (number|null); + } - /** Value keyValue. */ - public keyValue?: (google.datastore.v1.IKey|null); + /** Represents a Count. */ + class Count implements ICount { - /** Value stringValue. */ - public stringValue?: (string|null); + /** + * Constructs a new Count. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.AggregationQuery.Aggregation.ICount); - /** Value blobValue. */ - public blobValue?: (Uint8Array|string|null); + /** Count upTo. */ + public upTo: number; - /** Value geoPointValue. */ - public geoPointValue?: (google.type.ILatLng|null); + /** + * Creates a new Count instance using the specified properties. + * @param [properties] Properties to set + * @returns Count instance + */ + public static create(properties?: google.datastore.v1.AggregationQuery.Aggregation.ICount): google.datastore.v1.AggregationQuery.Aggregation.Count; - /** Value entityValue. */ - public entityValue?: (google.datastore.v1.IEntity|null); + /** + * Encodes the specified Count message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Count.verify|verify} messages. + * @param message Count message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.AggregationQuery.Aggregation.ICount, writer?: $protobuf.Writer): $protobuf.Writer; - /** Value arrayValue. */ - public arrayValue?: (google.datastore.v1.IArrayValue|null); + /** + * Encodes the specified Count message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Count.verify|verify} messages. + * @param message Count message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.AggregationQuery.Aggregation.ICount, writer?: $protobuf.Writer): $protobuf.Writer; - /** Value meaning. */ - public meaning: number; + /** + * Decodes a Count message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Count + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationQuery.Aggregation.Count; - /** Value excludeFromIndexes. */ - public excludeFromIndexes: boolean; + /** + * Decodes a Count message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Count + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationQuery.Aggregation.Count; - /** Value valueType. */ - public valueType?: ("nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"keyValue"|"stringValue"|"blobValue"|"geoPointValue"|"entityValue"|"arrayValue"); + /** + * Verifies a Count message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Count message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Count + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery.Aggregation.Count; + + /** + * Creates a plain object from a Count message. Also converts values to other types if specified. + * @param message Count + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.AggregationQuery.Aggregation.Count, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Count to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Properties of a KindExpression. */ + interface IKindExpression { + + /** KindExpression name */ + name?: (string|null); + } + + /** Represents a KindExpression. */ + class KindExpression implements IKindExpression { /** - * Creates a new Value instance using the specified properties. + * Constructs a new KindExpression. * @param [properties] Properties to set - * @returns Value instance */ - public static create(properties?: google.datastore.v1.IValue): google.datastore.v1.Value; + constructor(properties?: google.datastore.v1.IKindExpression); + + /** KindExpression name. */ + public name: string; /** - * Encodes the specified Value message. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. - * @param message Value message or plain object to encode + * Creates a new KindExpression instance using the specified properties. + * @param [properties] Properties to set + * @returns KindExpression instance + */ + public static create(properties?: google.datastore.v1.IKindExpression): google.datastore.v1.KindExpression; + + /** + * Encodes the specified KindExpression message. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. + * @param message KindExpression message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IKindExpression, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. - * @param message Value message or plain object to encode + * Encodes the specified KindExpression message, length delimited. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. + * @param message KindExpression message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IKindExpression, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Value message from the specified reader or buffer. + * Decodes a KindExpression message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Value + * @returns KindExpression * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Value; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.KindExpression; /** - * Decodes a Value message from the specified reader or buffer, length delimited. + * Decodes a KindExpression message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Value + * @returns KindExpression * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Value; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.KindExpression; /** - * Verifies a Value message. + * Verifies a KindExpression message. * @param message Plain object 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. + * Creates a KindExpression message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Value + * @returns KindExpression */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Value; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.KindExpression; /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value + * Creates a plain object from a KindExpression message. Also converts values to other types if specified. + * @param message KindExpression * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.KindExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Value to JSON. + * Converts this KindExpression to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Entity. */ - interface IEntity { - - /** Entity key */ - key?: (google.datastore.v1.IKey|null); + /** Properties of a PropertyReference. */ + interface IPropertyReference { - /** Entity properties */ - properties?: ({ [k: string]: google.datastore.v1.IValue }|null); + /** PropertyReference name */ + name?: (string|null); } - /** Represents an Entity. */ - class Entity implements IEntity { + /** Represents a PropertyReference. */ + class PropertyReference implements IPropertyReference { /** - * Constructs a new Entity. + * Constructs a new PropertyReference. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IEntity); - - /** Entity key. */ - public key?: (google.datastore.v1.IKey|null); + constructor(properties?: google.datastore.v1.IPropertyReference); - /** Entity properties. */ - public properties: { [k: string]: google.datastore.v1.IValue }; + /** PropertyReference name. */ + public name: string; /** - * Creates a new Entity instance using the specified properties. + * Creates a new PropertyReference instance using the specified properties. * @param [properties] Properties to set - * @returns Entity instance + * @returns PropertyReference instance */ - public static create(properties?: google.datastore.v1.IEntity): google.datastore.v1.Entity; + public static create(properties?: google.datastore.v1.IPropertyReference): google.datastore.v1.PropertyReference; /** - * Encodes the specified Entity message. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. - * @param message Entity message or plain object to encode + * Encodes the specified PropertyReference message. Does not implicitly {@link google.datastore.v1.PropertyReference.verify|verify} messages. + * @param message PropertyReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IPropertyReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. - * @param message Entity message or plain object to encode + * Encodes the specified PropertyReference message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyReference.verify|verify} messages. + * @param message PropertyReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IPropertyReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Entity message from the specified reader or buffer. + * Decodes a PropertyReference message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Entity + * @returns PropertyReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Entity; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.PropertyReference; /** - * Decodes an Entity message from the specified reader or buffer, length delimited. + * Decodes a PropertyReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Entity + * @returns PropertyReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Entity; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.PropertyReference; /** - * Verifies an Entity message. + * Verifies a PropertyReference message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * Creates a PropertyReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Entity + * @returns PropertyReference */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Entity; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyReference; /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. - * @param message Entity + * Creates a plain object from a PropertyReference message. Also converts values to other types if specified. + * @param message PropertyReference * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.PropertyReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Entity to JSON. + * Converts this PropertyReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an EntityResult. */ - interface IEntityResult { - - /** EntityResult entity */ - entity?: (google.datastore.v1.IEntity|null); - - /** EntityResult version */ - version?: (number|Long|string|null); - - /** EntityResult updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Properties of a Projection. */ + interface IProjection { - /** EntityResult cursor */ - cursor?: (Uint8Array|string|null); + /** Projection property */ + property?: (google.datastore.v1.IPropertyReference|null); } - /** Represents an EntityResult. */ - class EntityResult implements IEntityResult { + /** Represents a Projection. */ + class Projection implements IProjection { /** - * Constructs a new EntityResult. + * Constructs a new Projection. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IEntityResult); - - /** EntityResult entity. */ - public entity?: (google.datastore.v1.IEntity|null); - - /** EntityResult version. */ - public version: (number|Long|string); - - /** EntityResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.datastore.v1.IProjection); - /** EntityResult cursor. */ - public cursor: (Uint8Array|string); + /** Projection property. */ + public property?: (google.datastore.v1.IPropertyReference|null); /** - * Creates a new EntityResult instance using the specified properties. + * Creates a new Projection instance using the specified properties. * @param [properties] Properties to set - * @returns EntityResult instance + * @returns Projection instance */ - public static create(properties?: google.datastore.v1.IEntityResult): google.datastore.v1.EntityResult; + public static create(properties?: google.datastore.v1.IProjection): google.datastore.v1.Projection; /** - * Encodes the specified EntityResult message. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. - * @param message EntityResult message or plain object to encode + * Encodes the specified Projection message. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. + * @param message Projection message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IEntityResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IProjection, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EntityResult message, length delimited. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. - * @param message EntityResult message or plain object to encode + * Encodes the specified Projection message, length delimited. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. + * @param message Projection message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IEntityResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IProjection, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EntityResult message from the specified reader or buffer. + * Decodes a Projection message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EntityResult + * @returns Projection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.EntityResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Projection; /** - * Decodes an EntityResult message from the specified reader or buffer, length delimited. + * Decodes a Projection message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EntityResult + * @returns Projection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.EntityResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Projection; /** - * Verifies an EntityResult message. + * Verifies a Projection message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EntityResult message from a plain object. Also converts values to their respective internal types. + * Creates a Projection message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EntityResult + * @returns Projection */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.EntityResult; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.Projection; /** - * Creates a plain object from an EntityResult message. Also converts values to other types if specified. - * @param message EntityResult + * Creates a plain object from a Projection message. Also converts values to other types if specified. + * @param message Projection * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.EntityResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.Projection, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EntityResult to JSON. + * Converts this Projection to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace EntityResult { - - /** ResultType enum. */ - enum ResultType { - RESULT_TYPE_UNSPECIFIED = 0, - FULL = 1, - PROJECTION = 2, - KEY_ONLY = 3 - } - } - - /** Properties of a Query. */ - interface IQuery { - - /** Query projection */ - projection?: (google.datastore.v1.IProjection[]|null); - - /** Query kind */ - kind?: (google.datastore.v1.IKindExpression[]|null); - - /** Query filter */ - filter?: (google.datastore.v1.IFilter|null); - - /** Query order */ - order?: (google.datastore.v1.IPropertyOrder[]|null); - - /** Query distinctOn */ - distinctOn?: (google.datastore.v1.IPropertyReference[]|null); - - /** Query startCursor */ - startCursor?: (Uint8Array|string|null); - - /** Query endCursor */ - endCursor?: (Uint8Array|string|null); + /** Properties of a PropertyOrder. */ + interface IPropertyOrder { - /** Query offset */ - offset?: (number|null); + /** PropertyOrder property */ + property?: (google.datastore.v1.IPropertyReference|null); - /** Query limit */ - limit?: (google.protobuf.IInt32Value|null); + /** PropertyOrder direction */ + direction?: (google.datastore.v1.PropertyOrder.Direction|null); } - /** Represents a Query. */ - class Query implements IQuery { + /** Represents a PropertyOrder. */ + class PropertyOrder implements IPropertyOrder { /** - * Constructs a new Query. + * Constructs a new PropertyOrder. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IQuery); - - /** Query projection. */ - public projection: google.datastore.v1.IProjection[]; - - /** Query kind. */ - public kind: google.datastore.v1.IKindExpression[]; - - /** Query filter. */ - public filter?: (google.datastore.v1.IFilter|null); - - /** Query order. */ - public order: google.datastore.v1.IPropertyOrder[]; - - /** Query distinctOn. */ - public distinctOn: google.datastore.v1.IPropertyReference[]; - - /** Query startCursor. */ - public startCursor: (Uint8Array|string); - - /** Query endCursor. */ - public endCursor: (Uint8Array|string); + constructor(properties?: google.datastore.v1.IPropertyOrder); - /** Query offset. */ - public offset: number; + /** PropertyOrder property. */ + public property?: (google.datastore.v1.IPropertyReference|null); - /** Query limit. */ - public limit?: (google.protobuf.IInt32Value|null); + /** PropertyOrder direction. */ + public direction: google.datastore.v1.PropertyOrder.Direction; /** - * Creates a new Query instance using the specified properties. + * Creates a new PropertyOrder instance using the specified properties. * @param [properties] Properties to set - * @returns Query instance + * @returns PropertyOrder instance */ - public static create(properties?: google.datastore.v1.IQuery): google.datastore.v1.Query; + public static create(properties?: google.datastore.v1.IPropertyOrder): google.datastore.v1.PropertyOrder; /** - * Encodes the specified Query message. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. - * @param message Query message or plain object to encode + * Encodes the specified PropertyOrder message. Does not implicitly {@link google.datastore.v1.PropertyOrder.verify|verify} messages. + * @param message PropertyOrder message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IQuery, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IPropertyOrder, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Query message, length delimited. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. - * @param message Query message or plain object to encode + * Encodes the specified PropertyOrder message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyOrder.verify|verify} messages. + * @param message PropertyOrder message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IQuery, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IPropertyOrder, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Query message from the specified reader or buffer. + * Decodes a PropertyOrder message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Query + * @returns PropertyOrder * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Query; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.PropertyOrder; /** - * Decodes a Query message from the specified reader or buffer, length delimited. + * Decodes a PropertyOrder message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Query + * @returns PropertyOrder * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Query; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.PropertyOrder; /** - * Verifies a Query message. + * Verifies a PropertyOrder message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Query message from a plain object. Also converts values to their respective internal types. + * Creates a PropertyOrder message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Query + * @returns PropertyOrder */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Query; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyOrder; /** - * Creates a plain object from a Query message. Also converts values to other types if specified. - * @param message Query + * Creates a plain object from a PropertyOrder message. Also converts values to other types if specified. + * @param message PropertyOrder * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.Query, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.PropertyOrder, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Query to JSON. + * Converts this PropertyOrder to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a KindExpression. */ - interface IKindExpression { + namespace PropertyOrder { - /** KindExpression name */ - name?: (string|null); + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + ASCENDING = 1, + DESCENDING = 2 + } } - /** Represents a KindExpression. */ - class KindExpression implements IKindExpression { + /** Properties of a Filter. */ + interface IFilter { + + /** Filter compositeFilter */ + compositeFilter?: (google.datastore.v1.ICompositeFilter|null); + + /** Filter propertyFilter */ + propertyFilter?: (google.datastore.v1.IPropertyFilter|null); + } + + /** Represents a Filter. */ + class Filter implements IFilter { /** - * Constructs a new KindExpression. + * Constructs a new Filter. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IKindExpression); + constructor(properties?: google.datastore.v1.IFilter); - /** KindExpression name. */ - public name: string; + /** Filter compositeFilter. */ + public compositeFilter?: (google.datastore.v1.ICompositeFilter|null); + + /** Filter propertyFilter. */ + public propertyFilter?: (google.datastore.v1.IPropertyFilter|null); + + /** Filter filterType. */ + public filterType?: ("compositeFilter"|"propertyFilter"); /** - * Creates a new KindExpression instance using the specified properties. + * Creates a new Filter instance using the specified properties. * @param [properties] Properties to set - * @returns KindExpression instance + * @returns Filter instance */ - public static create(properties?: google.datastore.v1.IKindExpression): google.datastore.v1.KindExpression; + public static create(properties?: google.datastore.v1.IFilter): google.datastore.v1.Filter; /** - * Encodes the specified KindExpression message. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. - * @param message KindExpression message or plain object to encode + * Encodes the specified Filter message. Does not implicitly {@link google.datastore.v1.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IKindExpression, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified KindExpression message, length delimited. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. - * @param message KindExpression message or plain object to encode + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.datastore.v1.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IKindExpression, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a KindExpression message from the specified reader or buffer. + * Decodes a Filter message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns KindExpression + * @returns Filter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.KindExpression; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Filter; /** - * Decodes a KindExpression message from the specified reader or buffer, length delimited. + * Decodes a Filter message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns KindExpression + * @returns Filter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.KindExpression; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Filter; /** - * Verifies a KindExpression message. + * Verifies a Filter message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a KindExpression message from a plain object. Also converts values to their respective internal types. + * Creates a Filter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns KindExpression + * @returns Filter */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.KindExpression; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.Filter; /** - * Creates a plain object from a KindExpression message. Also converts values to other types if specified. - * @param message KindExpression + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @param message Filter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.KindExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this KindExpression to JSON. + * Converts this Filter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PropertyReference. */ - interface IPropertyReference { + /** Properties of a CompositeFilter. */ + interface ICompositeFilter { - /** PropertyReference name */ - name?: (string|null); + /** CompositeFilter op */ + op?: (google.datastore.v1.CompositeFilter.Operator|null); + + /** CompositeFilter filters */ + filters?: (google.datastore.v1.IFilter[]|null); } - /** Represents a PropertyReference. */ - class PropertyReference implements IPropertyReference { + /** Represents a CompositeFilter. */ + class CompositeFilter implements ICompositeFilter { /** - * Constructs a new PropertyReference. + * Constructs a new CompositeFilter. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IPropertyReference); + constructor(properties?: google.datastore.v1.ICompositeFilter); - /** PropertyReference name. */ - public name: string; + /** CompositeFilter op. */ + public op: google.datastore.v1.CompositeFilter.Operator; + + /** CompositeFilter filters. */ + public filters: google.datastore.v1.IFilter[]; /** - * Creates a new PropertyReference instance using the specified properties. + * Creates a new CompositeFilter instance using the specified properties. * @param [properties] Properties to set - * @returns PropertyReference instance + * @returns CompositeFilter instance */ - public static create(properties?: google.datastore.v1.IPropertyReference): google.datastore.v1.PropertyReference; + public static create(properties?: google.datastore.v1.ICompositeFilter): google.datastore.v1.CompositeFilter; /** - * Encodes the specified PropertyReference message. Does not implicitly {@link google.datastore.v1.PropertyReference.verify|verify} messages. - * @param message PropertyReference message or plain object to encode + * Encodes the specified CompositeFilter message. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. + * @param message CompositeFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IPropertyReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.ICompositeFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PropertyReference message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyReference.verify|verify} messages. - * @param message PropertyReference message or plain object to encode + * Encodes the specified CompositeFilter message, length delimited. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. + * @param message CompositeFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IPropertyReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.ICompositeFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PropertyReference message from the specified reader or buffer. + * Decodes a CompositeFilter message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PropertyReference + * @returns CompositeFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.PropertyReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.CompositeFilter; /** - * Decodes a PropertyReference message from the specified reader or buffer, length delimited. + * Decodes a CompositeFilter message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PropertyReference + * @returns CompositeFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.PropertyReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.CompositeFilter; /** - * Verifies a PropertyReference message. + * Verifies a CompositeFilter message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PropertyReference message from a plain object. Also converts values to their respective internal types. + * Creates a CompositeFilter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PropertyReference + * @returns CompositeFilter */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyReference; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.CompositeFilter; /** - * Creates a plain object from a PropertyReference message. Also converts values to other types if specified. - * @param message PropertyReference + * Creates a plain object from a CompositeFilter message. Also converts values to other types if specified. + * @param message CompositeFilter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.PropertyReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.CompositeFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PropertyReference to JSON. + * Converts this CompositeFilter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Projection. */ - interface IProjection { + namespace CompositeFilter { - /** Projection property */ + /** Operator enum. */ + enum Operator { + OPERATOR_UNSPECIFIED = 0, + AND = 1, + OR = 2 + } + } + + /** Properties of a PropertyFilter. */ + interface IPropertyFilter { + + /** PropertyFilter property */ property?: (google.datastore.v1.IPropertyReference|null); + + /** PropertyFilter op */ + op?: (google.datastore.v1.PropertyFilter.Operator|null); + + /** PropertyFilter value */ + value?: (google.datastore.v1.IValue|null); } - /** Represents a Projection. */ - class Projection implements IProjection { + /** Represents a PropertyFilter. */ + class PropertyFilter implements IPropertyFilter { /** - * Constructs a new Projection. + * Constructs a new PropertyFilter. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IProjection); + constructor(properties?: google.datastore.v1.IPropertyFilter); - /** Projection property. */ + /** PropertyFilter property. */ public property?: (google.datastore.v1.IPropertyReference|null); + /** PropertyFilter op. */ + public op: google.datastore.v1.PropertyFilter.Operator; + + /** PropertyFilter value. */ + public value?: (google.datastore.v1.IValue|null); + /** - * Creates a new Projection instance using the specified properties. + * Creates a new PropertyFilter instance using the specified properties. * @param [properties] Properties to set - * @returns Projection instance + * @returns PropertyFilter instance */ - public static create(properties?: google.datastore.v1.IProjection): google.datastore.v1.Projection; + public static create(properties?: google.datastore.v1.IPropertyFilter): google.datastore.v1.PropertyFilter; /** - * Encodes the specified Projection message. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. - * @param message Projection message or plain object to encode + * Encodes the specified PropertyFilter message. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. + * @param message PropertyFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IProjection, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Projection message, length delimited. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. - * @param message Projection message or plain object to encode + * Encodes the specified PropertyFilter message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. + * @param message PropertyFilter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IProjection, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Projection message from the specified reader or buffer. + * Decodes a PropertyFilter message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Projection + * @returns PropertyFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Projection; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.PropertyFilter; /** - * Decodes a Projection message from the specified reader or buffer, length delimited. + * Decodes a PropertyFilter message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Projection + * @returns PropertyFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Projection; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.PropertyFilter; /** - * Verifies a Projection message. + * Verifies a PropertyFilter message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Projection message from a plain object. Also converts values to their respective internal types. + * Creates a PropertyFilter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Projection + * @returns PropertyFilter */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Projection; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyFilter; - /** - * Creates a plain object from a Projection message. Also converts values to other types if specified. - * @param message Projection + /** + * Creates a plain object from a PropertyFilter message. Also converts values to other types if specified. + * @param message PropertyFilter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.Projection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.PropertyFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Projection to JSON. + * Converts this PropertyFilter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a PropertyOrder. */ - interface IPropertyOrder { + namespace PropertyFilter { - /** PropertyOrder property */ - property?: (google.datastore.v1.IPropertyReference|null); + /** Operator enum. */ + enum Operator { + OPERATOR_UNSPECIFIED = 0, + LESS_THAN = 1, + LESS_THAN_OR_EQUAL = 2, + GREATER_THAN = 3, + GREATER_THAN_OR_EQUAL = 4, + EQUAL = 5, + IN = 6, + NOT_EQUAL = 9, + HAS_ANCESTOR = 11, + NOT_IN = 13 + } + } - /** PropertyOrder direction */ - direction?: (google.datastore.v1.PropertyOrder.Direction|keyof typeof google.datastore.v1.PropertyOrder.Direction|null); + /** Properties of a GqlQuery. */ + interface IGqlQuery { + + /** GqlQuery queryString */ + queryString?: (string|null); + + /** GqlQuery allowLiterals */ + allowLiterals?: (boolean|null); + + /** GqlQuery namedBindings */ + namedBindings?: ({ [k: string]: google.datastore.v1.IGqlQueryParameter }|null); + + /** GqlQuery positionalBindings */ + positionalBindings?: (google.datastore.v1.IGqlQueryParameter[]|null); } - /** Represents a PropertyOrder. */ - class PropertyOrder implements IPropertyOrder { + /** Represents a GqlQuery. */ + class GqlQuery implements IGqlQuery { /** - * Constructs a new PropertyOrder. + * Constructs a new GqlQuery. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IPropertyOrder); + constructor(properties?: google.datastore.v1.IGqlQuery); - /** PropertyOrder property. */ - public property?: (google.datastore.v1.IPropertyReference|null); + /** GqlQuery queryString. */ + public queryString: string; - /** PropertyOrder direction. */ - public direction: (google.datastore.v1.PropertyOrder.Direction|keyof typeof google.datastore.v1.PropertyOrder.Direction); + /** GqlQuery allowLiterals. */ + public allowLiterals: boolean; + + /** GqlQuery namedBindings. */ + public namedBindings: { [k: string]: google.datastore.v1.IGqlQueryParameter }; + + /** GqlQuery positionalBindings. */ + public positionalBindings: google.datastore.v1.IGqlQueryParameter[]; /** - * Creates a new PropertyOrder instance using the specified properties. + * Creates a new GqlQuery instance using the specified properties. * @param [properties] Properties to set - * @returns PropertyOrder instance + * @returns GqlQuery instance */ - public static create(properties?: google.datastore.v1.IPropertyOrder): google.datastore.v1.PropertyOrder; + public static create(properties?: google.datastore.v1.IGqlQuery): google.datastore.v1.GqlQuery; /** - * Encodes the specified PropertyOrder message. Does not implicitly {@link google.datastore.v1.PropertyOrder.verify|verify} messages. - * @param message PropertyOrder message or plain object to encode + * Encodes the specified GqlQuery message. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. + * @param message GqlQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IPropertyOrder, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IGqlQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PropertyOrder message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyOrder.verify|verify} messages. - * @param message PropertyOrder message or plain object to encode + * Encodes the specified GqlQuery message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. + * @param message GqlQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IPropertyOrder, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IGqlQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PropertyOrder message from the specified reader or buffer. + * Decodes a GqlQuery message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PropertyOrder + * @returns GqlQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.PropertyOrder; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.GqlQuery; /** - * Decodes a PropertyOrder message from the specified reader or buffer, length delimited. + * Decodes a GqlQuery message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PropertyOrder + * @returns GqlQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.PropertyOrder; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.GqlQuery; /** - * Verifies a PropertyOrder message. + * Verifies a GqlQuery message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PropertyOrder message from a plain object. Also converts values to their respective internal types. + * Creates a GqlQuery message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PropertyOrder + * @returns GqlQuery */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyOrder; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.GqlQuery; /** - * Creates a plain object from a PropertyOrder message. Also converts values to other types if specified. - * @param message PropertyOrder + * Creates a plain object from a GqlQuery message. Also converts values to other types if specified. + * @param message GqlQuery * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.PropertyOrder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.GqlQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PropertyOrder to JSON. + * Converts this GqlQuery to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace PropertyOrder { - - /** Direction enum. */ - enum Direction { - DIRECTION_UNSPECIFIED = 0, - ASCENDING = 1, - DESCENDING = 2 - } - } - - /** Properties of a Filter. */ - interface IFilter { + /** Properties of a GqlQueryParameter. */ + interface IGqlQueryParameter { - /** Filter compositeFilter */ - compositeFilter?: (google.datastore.v1.ICompositeFilter|null); + /** GqlQueryParameter value */ + value?: (google.datastore.v1.IValue|null); - /** Filter propertyFilter */ - propertyFilter?: (google.datastore.v1.IPropertyFilter|null); + /** GqlQueryParameter cursor */ + cursor?: (Uint8Array|null); } - /** Represents a Filter. */ - class Filter implements IFilter { + /** Represents a GqlQueryParameter. */ + class GqlQueryParameter implements IGqlQueryParameter { /** - * Constructs a new Filter. + * Constructs a new GqlQueryParameter. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IFilter); + constructor(properties?: google.datastore.v1.IGqlQueryParameter); - /** Filter compositeFilter. */ - public compositeFilter?: (google.datastore.v1.ICompositeFilter|null); + /** GqlQueryParameter value. */ + public value?: (google.datastore.v1.IValue|null); - /** Filter propertyFilter. */ - public propertyFilter?: (google.datastore.v1.IPropertyFilter|null); + /** GqlQueryParameter cursor. */ + public cursor?: (Uint8Array|null); - /** Filter filterType. */ - public filterType?: ("compositeFilter"|"propertyFilter"); + /** GqlQueryParameter parameterType. */ + public parameterType?: ("value"|"cursor"); /** - * Creates a new Filter instance using the specified properties. + * Creates a new GqlQueryParameter instance using the specified properties. * @param [properties] Properties to set - * @returns Filter instance + * @returns GqlQueryParameter instance */ - public static create(properties?: google.datastore.v1.IFilter): google.datastore.v1.Filter; + public static create(properties?: google.datastore.v1.IGqlQueryParameter): google.datastore.v1.GqlQueryParameter; /** - * Encodes the specified Filter message. Does not implicitly {@link google.datastore.v1.Filter.verify|verify} messages. - * @param message Filter message or plain object to encode + * Encodes the specified GqlQueryParameter message. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. + * @param message GqlQueryParameter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IGqlQueryParameter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.datastore.v1.Filter.verify|verify} messages. - * @param message Filter message or plain object to encode + * Encodes the specified GqlQueryParameter message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. + * @param message GqlQueryParameter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IGqlQueryParameter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Filter message from the specified reader or buffer. + * Decodes a GqlQueryParameter message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Filter + * @returns GqlQueryParameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Filter; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.GqlQueryParameter; /** - * Decodes a Filter message from the specified reader or buffer, length delimited. + * Decodes a GqlQueryParameter message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Filter + * @returns GqlQueryParameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Filter; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.GqlQueryParameter; /** - * Verifies a Filter message. + * Verifies a GqlQueryParameter message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * Creates a GqlQueryParameter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Filter + * @returns GqlQueryParameter */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Filter; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.GqlQueryParameter; /** - * Creates a plain object from a Filter message. Also converts values to other types if specified. - * @param message Filter + * Creates a plain object from a GqlQueryParameter message. Also converts values to other types if specified. + * @param message GqlQueryParameter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.GqlQueryParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Filter to JSON. + * Converts this GqlQueryParameter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CompositeFilter. */ - interface ICompositeFilter { + /** Properties of a QueryResultBatch. */ + interface IQueryResultBatch { - /** CompositeFilter op */ - op?: (google.datastore.v1.CompositeFilter.Operator|keyof typeof google.datastore.v1.CompositeFilter.Operator|null); + /** QueryResultBatch skippedResults */ + skippedResults?: (number|null); - /** CompositeFilter filters */ - filters?: (google.datastore.v1.IFilter[]|null); + /** QueryResultBatch skippedCursor */ + skippedCursor?: (Uint8Array|null); + + /** QueryResultBatch entityResultType */ + entityResultType?: (google.datastore.v1.EntityResult.ResultType|null); + + /** QueryResultBatch entityResults */ + entityResults?: (google.datastore.v1.IEntityResult[]|null); + + /** QueryResultBatch endCursor */ + endCursor?: (Uint8Array|null); + + /** QueryResultBatch moreResults */ + moreResults?: (google.datastore.v1.QueryResultBatch.MoreResultsType|null); + + /** QueryResultBatch snapshotVersion */ + snapshotVersion?: (number|Long|null); + + /** QueryResultBatch readTime */ + readTime?: (google.protobuf.ITimestamp|null); } - /** Represents a CompositeFilter. */ - class CompositeFilter implements ICompositeFilter { + /** Represents a QueryResultBatch. */ + class QueryResultBatch implements IQueryResultBatch { /** - * Constructs a new CompositeFilter. + * Constructs a new QueryResultBatch. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.ICompositeFilter); + constructor(properties?: google.datastore.v1.IQueryResultBatch); - /** CompositeFilter op. */ - public op: (google.datastore.v1.CompositeFilter.Operator|keyof typeof google.datastore.v1.CompositeFilter.Operator); + /** QueryResultBatch skippedResults. */ + public skippedResults: number; - /** CompositeFilter filters. */ - public filters: google.datastore.v1.IFilter[]; + /** QueryResultBatch skippedCursor. */ + public skippedCursor: Uint8Array; + + /** QueryResultBatch entityResultType. */ + public entityResultType: google.datastore.v1.EntityResult.ResultType; + + /** QueryResultBatch entityResults. */ + public entityResults: google.datastore.v1.IEntityResult[]; + + /** QueryResultBatch endCursor. */ + public endCursor: Uint8Array; + + /** QueryResultBatch moreResults. */ + public moreResults: google.datastore.v1.QueryResultBatch.MoreResultsType; + + /** QueryResultBatch snapshotVersion. */ + public snapshotVersion: (number|Long); + + /** QueryResultBatch readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new CompositeFilter instance using the specified properties. + * Creates a new QueryResultBatch instance using the specified properties. * @param [properties] Properties to set - * @returns CompositeFilter instance + * @returns QueryResultBatch instance */ - public static create(properties?: google.datastore.v1.ICompositeFilter): google.datastore.v1.CompositeFilter; + public static create(properties?: google.datastore.v1.IQueryResultBatch): google.datastore.v1.QueryResultBatch; /** - * Encodes the specified CompositeFilter message. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. - * @param message CompositeFilter message or plain object to encode + * Encodes the specified QueryResultBatch message. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. + * @param message QueryResultBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.ICompositeFilter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IQueryResultBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CompositeFilter message, length delimited. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. - * @param message CompositeFilter message or plain object to encode + * Encodes the specified QueryResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. + * @param message QueryResultBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.ICompositeFilter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IQueryResultBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CompositeFilter message from the specified reader or buffer. + * Decodes a QueryResultBatch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CompositeFilter + * @returns QueryResultBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.CompositeFilter; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.QueryResultBatch; /** - * Decodes a CompositeFilter message from the specified reader or buffer, length delimited. + * Decodes a QueryResultBatch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CompositeFilter + * @returns QueryResultBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.CompositeFilter; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.QueryResultBatch; /** - * Verifies a CompositeFilter message. + * Verifies a QueryResultBatch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CompositeFilter message from a plain object. Also converts values to their respective internal types. + * Creates a QueryResultBatch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CompositeFilter + * @returns QueryResultBatch */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.CompositeFilter; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.QueryResultBatch; /** - * Creates a plain object from a CompositeFilter message. Also converts values to other types if specified. - * @param message CompositeFilter + * Creates a plain object from a QueryResultBatch message. Also converts values to other types if specified. + * @param message QueryResultBatch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.CompositeFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.QueryResultBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CompositeFilter to JSON. + * Converts this QueryResultBatch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace CompositeFilter { + namespace QueryResultBatch { - /** Operator enum. */ - enum Operator { - OPERATOR_UNSPECIFIED = 0, - AND = 1 + /** MoreResultsType enum. */ + enum MoreResultsType { + MORE_RESULTS_TYPE_UNSPECIFIED = 0, + NOT_FINISHED = 1, + MORE_RESULTS_AFTER_LIMIT = 2, + MORE_RESULTS_AFTER_CURSOR = 4, + NO_MORE_RESULTS = 3 } } - /** Properties of a PropertyFilter. */ - interface IPropertyFilter { + /** Represents a Datastore */ + class Datastore extends $protobuf.rpc.Service { - /** PropertyFilter property */ - property?: (google.datastore.v1.IPropertyReference|null); + /** + * Constructs a new Datastore 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); - /** PropertyFilter op */ - op?: (google.datastore.v1.PropertyFilter.Operator|keyof typeof google.datastore.v1.PropertyFilter.Operator|null); + /** + * Creates new Datastore 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): Datastore; - /** PropertyFilter value */ - value?: (google.datastore.v1.IValue|null); - } + /** + * Calls Lookup. + * @param request LookupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LookupResponse + */ + public lookup(request: google.datastore.v1.ILookupRequest, callback: google.datastore.v1.Datastore.LookupCallback): void; - /** Represents a PropertyFilter. */ - class PropertyFilter implements IPropertyFilter { + /** + * Calls Lookup. + * @param request LookupRequest message or plain object + * @returns Promise + */ + public lookup(request: google.datastore.v1.ILookupRequest): Promise; /** - * Constructs a new PropertyFilter. - * @param [properties] Properties to set + * Calls RunQuery. + * @param request RunQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunQueryResponse */ - constructor(properties?: google.datastore.v1.IPropertyFilter); + public runQuery(request: google.datastore.v1.IRunQueryRequest, callback: google.datastore.v1.Datastore.RunQueryCallback): void; - /** PropertyFilter property. */ - public property?: (google.datastore.v1.IPropertyReference|null); + /** + * Calls RunQuery. + * @param request RunQueryRequest message or plain object + * @returns Promise + */ + public runQuery(request: google.datastore.v1.IRunQueryRequest): Promise; - /** PropertyFilter op. */ - public op: (google.datastore.v1.PropertyFilter.Operator|keyof typeof google.datastore.v1.PropertyFilter.Operator); + /** + * Calls RunAggregationQuery. + * @param request RunAggregationQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunAggregationQueryResponse + */ + public runAggregationQuery(request: google.datastore.v1.IRunAggregationQueryRequest, callback: google.datastore.v1.Datastore.RunAggregationQueryCallback): void; - /** PropertyFilter value. */ - public value?: (google.datastore.v1.IValue|null); + /** + * Calls RunAggregationQuery. + * @param request RunAggregationQueryRequest message or plain object + * @returns Promise + */ + public runAggregationQuery(request: google.datastore.v1.IRunAggregationQueryRequest): Promise; /** - * Creates a new PropertyFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyFilter instance + * Calls BeginTransaction. + * @param request BeginTransactionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BeginTransactionResponse */ - public static create(properties?: google.datastore.v1.IPropertyFilter): google.datastore.v1.PropertyFilter; + public beginTransaction(request: google.datastore.v1.IBeginTransactionRequest, callback: google.datastore.v1.Datastore.BeginTransactionCallback): void; /** - * Encodes the specified PropertyFilter message. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. - * @param message PropertyFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls BeginTransaction. + * @param request BeginTransactionRequest message or plain object + * @returns Promise */ - public static encode(message: google.datastore.v1.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; + public beginTransaction(request: google.datastore.v1.IBeginTransactionRequest): Promise; /** - * Encodes the specified PropertyFilter message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. - * @param message PropertyFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls Commit. + * @param request CommitRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CommitResponse */ - public static encodeDelimited(message: google.datastore.v1.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; + public commit(request: google.datastore.v1.ICommitRequest, callback: google.datastore.v1.Datastore.CommitCallback): void; /** - * Decodes a PropertyFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PropertyFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls Commit. + * @param request CommitRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.PropertyFilter; + public commit(request: google.datastore.v1.ICommitRequest): Promise; /** - * Decodes a PropertyFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PropertyFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls Rollback. + * @param request RollbackRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RollbackResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.PropertyFilter; + public rollback(request: google.datastore.v1.IRollbackRequest, callback: google.datastore.v1.Datastore.RollbackCallback): void; /** - * Verifies a PropertyFilter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls Rollback. + * @param request RollbackRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public rollback(request: google.datastore.v1.IRollbackRequest): Promise; /** - * Creates a PropertyFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyFilter + * Calls AllocateIds. + * @param request AllocateIdsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AllocateIdsResponse */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyFilter; + public allocateIds(request: google.datastore.v1.IAllocateIdsRequest, callback: google.datastore.v1.Datastore.AllocateIdsCallback): void; /** - * Creates a plain object from a PropertyFilter message. Also converts values to other types if specified. - * @param message PropertyFilter - * @param [options] Conversion options - * @returns Plain object + * Calls AllocateIds. + * @param request AllocateIdsRequest message or plain object + * @returns Promise */ - public static toObject(message: google.datastore.v1.PropertyFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public allocateIds(request: google.datastore.v1.IAllocateIdsRequest): Promise; /** - * Converts this PropertyFilter to JSON. - * @returns JSON object + * Calls ReserveIds. + * @param request ReserveIdsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReserveIdsResponse */ - public toJSON(): { [k: string]: any }; + public reserveIds(request: google.datastore.v1.IReserveIdsRequest, callback: google.datastore.v1.Datastore.ReserveIdsCallback): void; + + /** + * Calls ReserveIds. + * @param request ReserveIdsRequest message or plain object + * @returns Promise + */ + public reserveIds(request: google.datastore.v1.IReserveIdsRequest): Promise; } - namespace PropertyFilter { + namespace Datastore { - /** Operator enum. */ - enum Operator { - OPERATOR_UNSPECIFIED = 0, - LESS_THAN = 1, - LESS_THAN_OR_EQUAL = 2, - GREATER_THAN = 3, - GREATER_THAN_OR_EQUAL = 4, - EQUAL = 5, - IN = 6, - NOT_EQUAL = 9, - HAS_ANCESTOR = 11, - NOT_IN = 13 - } + /** + * Callback as used by {@link google.datastore.v1.Datastore#lookup}. + * @param error Error, if any + * @param [response] LookupResponse + */ + type LookupCallback = (error: (Error|null), response?: google.datastore.v1.LookupResponse) => void; + + /** + * Callback as used by {@link google.datastore.v1.Datastore#runQuery}. + * @param error Error, if any + * @param [response] RunQueryResponse + */ + type RunQueryCallback = (error: (Error|null), response?: google.datastore.v1.RunQueryResponse) => void; + + /** + * Callback as used by {@link google.datastore.v1.Datastore#runAggregationQuery}. + * @param error Error, if any + * @param [response] RunAggregationQueryResponse + */ + type RunAggregationQueryCallback = (error: (Error|null), response?: google.datastore.v1.RunAggregationQueryResponse) => void; + + /** + * Callback as used by {@link google.datastore.v1.Datastore#beginTransaction}. + * @param error Error, if any + * @param [response] BeginTransactionResponse + */ + type BeginTransactionCallback = (error: (Error|null), response?: google.datastore.v1.BeginTransactionResponse) => void; + + /** + * Callback as used by {@link google.datastore.v1.Datastore#commit}. + * @param error Error, if any + * @param [response] CommitResponse + */ + type CommitCallback = (error: (Error|null), response?: google.datastore.v1.CommitResponse) => void; + + /** + * Callback as used by {@link google.datastore.v1.Datastore#rollback}. + * @param error Error, if any + * @param [response] RollbackResponse + */ + type RollbackCallback = (error: (Error|null), response?: google.datastore.v1.RollbackResponse) => void; + + /** + * Callback as used by {@link google.datastore.v1.Datastore#allocateIds}. + * @param error Error, if any + * @param [response] AllocateIdsResponse + */ + type AllocateIdsCallback = (error: (Error|null), response?: google.datastore.v1.AllocateIdsResponse) => void; + + /** + * Callback as used by {@link google.datastore.v1.Datastore#reserveIds}. + * @param error Error, if any + * @param [response] ReserveIdsResponse + */ + type ReserveIdsCallback = (error: (Error|null), response?: google.datastore.v1.ReserveIdsResponse) => void; } - /** Properties of a GqlQuery. */ - interface IGqlQuery { + /** Properties of a LookupRequest. */ + interface ILookupRequest { - /** GqlQuery queryString */ - queryString?: (string|null); + /** LookupRequest projectId */ + projectId?: (string|null); - /** GqlQuery allowLiterals */ - allowLiterals?: (boolean|null); + /** LookupRequest databaseId */ + databaseId?: (string|null); - /** GqlQuery namedBindings */ - namedBindings?: ({ [k: string]: google.datastore.v1.IGqlQueryParameter }|null); + /** LookupRequest readOptions */ + readOptions?: (google.datastore.v1.IReadOptions|null); - /** GqlQuery positionalBindings */ - positionalBindings?: (google.datastore.v1.IGqlQueryParameter[]|null); + /** LookupRequest keys */ + keys?: (google.datastore.v1.IKey[]|null); } - /** Represents a GqlQuery. */ - class GqlQuery implements IGqlQuery { + /** Represents a LookupRequest. */ + class LookupRequest implements ILookupRequest { /** - * Constructs a new GqlQuery. + * Constructs a new LookupRequest. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IGqlQuery); + constructor(properties?: google.datastore.v1.ILookupRequest); - /** GqlQuery queryString. */ - public queryString: string; + /** LookupRequest projectId. */ + public projectId: string; - /** GqlQuery allowLiterals. */ - public allowLiterals: boolean; + /** LookupRequest databaseId. */ + public databaseId: string; - /** GqlQuery namedBindings. */ - public namedBindings: { [k: string]: google.datastore.v1.IGqlQueryParameter }; + /** LookupRequest readOptions. */ + public readOptions?: (google.datastore.v1.IReadOptions|null); - /** GqlQuery positionalBindings. */ - public positionalBindings: google.datastore.v1.IGqlQueryParameter[]; + /** LookupRequest keys. */ + public keys: google.datastore.v1.IKey[]; /** - * Creates a new GqlQuery instance using the specified properties. + * Creates a new LookupRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GqlQuery instance + * @returns LookupRequest instance */ - public static create(properties?: google.datastore.v1.IGqlQuery): google.datastore.v1.GqlQuery; + public static create(properties?: google.datastore.v1.ILookupRequest): google.datastore.v1.LookupRequest; /** - * Encodes the specified GqlQuery message. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. - * @param message GqlQuery message or plain object to encode + * Encodes the specified LookupRequest message. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * @param message LookupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IGqlQuery, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.ILookupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GqlQuery message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. - * @param message GqlQuery message or plain object to encode + * Encodes the specified LookupRequest message, length delimited. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * @param message LookupRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IGqlQuery, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.ILookupRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GqlQuery message from the specified reader or buffer. + * Decodes a LookupRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GqlQuery + * @returns LookupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.GqlQuery; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.LookupRequest; /** - * Decodes a GqlQuery message from the specified reader or buffer, length delimited. + * Decodes a LookupRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GqlQuery + * @returns LookupRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.GqlQuery; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.LookupRequest; /** - * Verifies a GqlQuery message. + * Verifies a LookupRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GqlQuery message from a plain object. Also converts values to their respective internal types. + * Creates a LookupRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GqlQuery + * @returns LookupRequest */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.GqlQuery; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.LookupRequest; /** - * Creates a plain object from a GqlQuery message. Also converts values to other types if specified. - * @param message GqlQuery + * Creates a plain object from a LookupRequest message. Also converts values to other types if specified. + * @param message LookupRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.GqlQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.LookupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GqlQuery to JSON. + * Converts this LookupRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GqlQueryParameter. */ - interface IGqlQueryParameter { + /** Properties of a LookupResponse. */ + interface ILookupResponse { - /** GqlQueryParameter value */ - value?: (google.datastore.v1.IValue|null); + /** LookupResponse found */ + found?: (google.datastore.v1.IEntityResult[]|null); - /** GqlQueryParameter cursor */ - cursor?: (Uint8Array|string|null); + /** LookupResponse missing */ + missing?: (google.datastore.v1.IEntityResult[]|null); + + /** LookupResponse deferred */ + deferred?: (google.datastore.v1.IKey[]|null); + + /** LookupResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); } - /** Represents a GqlQueryParameter. */ - class GqlQueryParameter implements IGqlQueryParameter { + /** Represents a LookupResponse. */ + class LookupResponse implements ILookupResponse { /** - * Constructs a new GqlQueryParameter. + * Constructs a new LookupResponse. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IGqlQueryParameter); + constructor(properties?: google.datastore.v1.ILookupResponse); - /** GqlQueryParameter value. */ - public value?: (google.datastore.v1.IValue|null); + /** LookupResponse found. */ + public found: google.datastore.v1.IEntityResult[]; - /** GqlQueryParameter cursor. */ - public cursor?: (Uint8Array|string|null); + /** LookupResponse missing. */ + public missing: google.datastore.v1.IEntityResult[]; - /** GqlQueryParameter parameterType. */ - public parameterType?: ("value"|"cursor"); + /** LookupResponse deferred. */ + public deferred: google.datastore.v1.IKey[]; + + /** LookupResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new GqlQueryParameter instance using the specified properties. + * Creates a new LookupResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GqlQueryParameter instance + * @returns LookupResponse instance */ - public static create(properties?: google.datastore.v1.IGqlQueryParameter): google.datastore.v1.GqlQueryParameter; + public static create(properties?: google.datastore.v1.ILookupResponse): google.datastore.v1.LookupResponse; /** - * Encodes the specified GqlQueryParameter message. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. - * @param message GqlQueryParameter message or plain object to encode + * Encodes the specified LookupResponse message. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * @param message LookupResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IGqlQueryParameter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.ILookupResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GqlQueryParameter message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. - * @param message GqlQueryParameter message or plain object to encode + * Encodes the specified LookupResponse message, length delimited. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * @param message LookupResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IGqlQueryParameter, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.ILookupResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GqlQueryParameter message from the specified reader or buffer. + * Decodes a LookupResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GqlQueryParameter + * @returns LookupResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.GqlQueryParameter; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.LookupResponse; /** - * Decodes a GqlQueryParameter message from the specified reader or buffer, length delimited. + * Decodes a LookupResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GqlQueryParameter + * @returns LookupResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.GqlQueryParameter; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.LookupResponse; /** - * Verifies a GqlQueryParameter message. + * Verifies a LookupResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GqlQueryParameter message from a plain object. Also converts values to their respective internal types. + * Creates a LookupResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GqlQueryParameter + * @returns LookupResponse */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.GqlQueryParameter; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.LookupResponse; /** - * Creates a plain object from a GqlQueryParameter message. Also converts values to other types if specified. - * @param message GqlQueryParameter + * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. + * @param message LookupResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.GqlQueryParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.LookupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GqlQueryParameter to JSON. + * Converts this LookupResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a QueryResultBatch. */ - interface IQueryResultBatch { - - /** QueryResultBatch skippedResults */ - skippedResults?: (number|null); - - /** QueryResultBatch skippedCursor */ - skippedCursor?: (Uint8Array|string|null); + /** Properties of a RunQueryRequest. */ + interface IRunQueryRequest { - /** QueryResultBatch entityResultType */ - entityResultType?: (google.datastore.v1.EntityResult.ResultType|keyof typeof google.datastore.v1.EntityResult.ResultType|null); + /** RunQueryRequest projectId */ + projectId?: (string|null); - /** QueryResultBatch entityResults */ - entityResults?: (google.datastore.v1.IEntityResult[]|null); + /** RunQueryRequest databaseId */ + databaseId?: (string|null); - /** QueryResultBatch endCursor */ - endCursor?: (Uint8Array|string|null); + /** RunQueryRequest partitionId */ + partitionId?: (google.datastore.v1.IPartitionId|null); - /** QueryResultBatch moreResults */ - moreResults?: (google.datastore.v1.QueryResultBatch.MoreResultsType|keyof typeof google.datastore.v1.QueryResultBatch.MoreResultsType|null); + /** RunQueryRequest readOptions */ + readOptions?: (google.datastore.v1.IReadOptions|null); - /** QueryResultBatch snapshotVersion */ - snapshotVersion?: (number|Long|string|null); + /** RunQueryRequest query */ + query?: (google.datastore.v1.IQuery|null); - /** QueryResultBatch readTime */ - readTime?: (google.protobuf.ITimestamp|null); + /** RunQueryRequest gqlQuery */ + gqlQuery?: (google.datastore.v1.IGqlQuery|null); } - /** Represents a QueryResultBatch. */ - class QueryResultBatch implements IQueryResultBatch { + /** Represents a RunQueryRequest. */ + class RunQueryRequest implements IRunQueryRequest { /** - * Constructs a new QueryResultBatch. + * Constructs a new RunQueryRequest. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IQueryResultBatch); - - /** QueryResultBatch skippedResults. */ - public skippedResults: number; + constructor(properties?: google.datastore.v1.IRunQueryRequest); - /** QueryResultBatch skippedCursor. */ - public skippedCursor: (Uint8Array|string); + /** RunQueryRequest projectId. */ + public projectId: string; - /** QueryResultBatch entityResultType. */ - public entityResultType: (google.datastore.v1.EntityResult.ResultType|keyof typeof google.datastore.v1.EntityResult.ResultType); + /** RunQueryRequest databaseId. */ + public databaseId: string; - /** QueryResultBatch entityResults. */ - public entityResults: google.datastore.v1.IEntityResult[]; + /** RunQueryRequest partitionId. */ + public partitionId?: (google.datastore.v1.IPartitionId|null); - /** QueryResultBatch endCursor. */ - public endCursor: (Uint8Array|string); + /** RunQueryRequest readOptions. */ + public readOptions?: (google.datastore.v1.IReadOptions|null); - /** QueryResultBatch moreResults. */ - public moreResults: (google.datastore.v1.QueryResultBatch.MoreResultsType|keyof typeof google.datastore.v1.QueryResultBatch.MoreResultsType); + /** RunQueryRequest query. */ + public query?: (google.datastore.v1.IQuery|null); - /** QueryResultBatch snapshotVersion. */ - public snapshotVersion: (number|Long|string); + /** RunQueryRequest gqlQuery. */ + public gqlQuery?: (google.datastore.v1.IGqlQuery|null); - /** QueryResultBatch readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** RunQueryRequest queryType. */ + public queryType?: ("query"|"gqlQuery"); /** - * Creates a new QueryResultBatch instance using the specified properties. + * Creates a new RunQueryRequest instance using the specified properties. * @param [properties] Properties to set - * @returns QueryResultBatch instance + * @returns RunQueryRequest instance */ - public static create(properties?: google.datastore.v1.IQueryResultBatch): google.datastore.v1.QueryResultBatch; + public static create(properties?: google.datastore.v1.IRunQueryRequest): google.datastore.v1.RunQueryRequest; /** - * Encodes the specified QueryResultBatch message. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. - * @param message QueryResultBatch message or plain object to encode + * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * @param message RunQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.datastore.v1.IQueryResultBatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IRunQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QueryResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. - * @param message QueryResultBatch message or plain object to encode + * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * @param message RunQueryRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.datastore.v1.IQueryResultBatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IRunQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QueryResultBatch message from the specified reader or buffer. + * Decodes a RunQueryRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QueryResultBatch + * @returns RunQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.QueryResultBatch; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunQueryRequest; /** - * Decodes a QueryResultBatch message from the specified reader or buffer, length delimited. + * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QueryResultBatch + * @returns RunQueryRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.QueryResultBatch; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunQueryRequest; /** - * Verifies a QueryResultBatch message. + * Verifies a RunQueryRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QueryResultBatch message from a plain object. Also converts values to their respective internal types. + * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QueryResultBatch + * @returns RunQueryRequest */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.QueryResultBatch; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunQueryRequest; /** - * Creates a plain object from a QueryResultBatch message. Also converts values to other types if specified. - * @param message QueryResultBatch + * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. + * @param message RunQueryRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.datastore.v1.QueryResultBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.RunQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QueryResultBatch to JSON. + * Converts this RunQueryRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace QueryResultBatch { - - /** MoreResultsType enum. */ - enum MoreResultsType { - MORE_RESULTS_TYPE_UNSPECIFIED = 0, - NOT_FINISHED = 1, - MORE_RESULTS_AFTER_LIMIT = 2, - MORE_RESULTS_AFTER_CURSOR = 4, - NO_MORE_RESULTS = 3 - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; + /** Properties of a RunQueryResponse. */ + interface IRunQueryResponse { - /** HttpRule get. */ - public get?: (string|null); + /** RunQueryResponse batch */ + batch?: (google.datastore.v1.IQueryResultBatch|null); - /** HttpRule put. */ - public put?: (string|null); + /** RunQueryResponse query */ + query?: (google.datastore.v1.IQuery|null); + } - /** HttpRule post. */ - public post?: (string|null); + /** Represents a RunQueryResponse. */ + class RunQueryResponse implements IRunQueryResponse { - /** HttpRule delete. */ - public delete?: (string|null); + /** + * Constructs a new RunQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IRunQueryResponse); - /** HttpRule patch. */ - public patch?: (string|null); + /** RunQueryResponse batch. */ + public batch?: (google.datastore.v1.IQueryResultBatch|null); - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); + /** RunQueryResponse query. */ + public query?: (google.datastore.v1.IQuery|null); - /** HttpRule body. */ - public body: string; + /** + * Creates a new RunQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunQueryResponse instance + */ + public static create(properties?: google.datastore.v1.IRunQueryResponse): google.datastore.v1.RunQueryResponse; - /** HttpRule responseBody. */ - public responseBody: string; + /** + * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @param message RunQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IRunQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; + /** + * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @param message RunQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IRunQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** + * Decodes a RunQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunQueryResponse; - /** - * 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; + /** + * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunQueryResponse; - /** - * 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; + /** + * Verifies a RunQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified 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; + /** + * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunQueryResponse; - /** - * 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; + /** + * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. + * @param message RunQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.RunQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this RunQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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); + /** Properties of a RunAggregationQueryRequest. */ + interface IRunAggregationQueryRequest { - /** - * 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; + /** RunAggregationQueryRequest projectId */ + projectId?: (string|null); - /** - * 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 }; + /** RunAggregationQueryRequest databaseId */ + databaseId?: (string|null); - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** RunAggregationQueryRequest partitionId */ + partitionId?: (google.datastore.v1.IPartitionId|null); - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { + /** RunAggregationQueryRequest readOptions */ + readOptions?: (google.datastore.v1.IReadOptions|null); - /** CustomHttpPattern kind */ - kind?: (string|null); + /** RunAggregationQueryRequest aggregationQuery */ + aggregationQuery?: (google.datastore.v1.IAggregationQuery|null); - /** CustomHttpPattern path */ - path?: (string|null); - } + /** RunAggregationQueryRequest gqlQuery */ + gqlQuery?: (google.datastore.v1.IGqlQuery|null); + } - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Represents a RunAggregationQueryRequest. */ + class RunAggregationQueryRequest implements IRunAggregationQueryRequest { - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); + /** + * Constructs a new RunAggregationQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IRunAggregationQueryRequest); - /** CustomHttpPattern kind. */ - public kind: string; + /** RunAggregationQueryRequest projectId. */ + public projectId: string; - /** CustomHttpPattern path. */ - public path: string; + /** RunAggregationQueryRequest databaseId. */ + public databaseId: 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; + /** RunAggregationQueryRequest partitionId. */ + public partitionId?: (google.datastore.v1.IPartitionId|null); - /** - * 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; + /** RunAggregationQueryRequest readOptions. */ + public readOptions?: (google.datastore.v1.IReadOptions|null); - /** - * 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; + /** RunAggregationQueryRequest aggregationQuery. */ + public aggregationQuery?: (google.datastore.v1.IAggregationQuery|null); - /** - * 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; + /** RunAggregationQueryRequest gqlQuery. */ + public gqlQuery?: (google.datastore.v1.IGqlQuery|null); - /** - * 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; + /** RunAggregationQueryRequest queryType. */ + public queryType?: ("aggregationQuery"|"gqlQuery"); - /** - * 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 new RunAggregationQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAggregationQueryRequest instance + */ + public static create(properties?: google.datastore.v1.IRunAggregationQueryRequest): google.datastore.v1.RunAggregationQueryRequest; - /** - * 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; + /** + * Encodes the specified RunAggregationQueryRequest message. Does not implicitly {@link google.datastore.v1.RunAggregationQueryRequest.verify|verify} messages. + * @param message RunAggregationQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IRunAggregationQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 }; + /** + * Encodes the specified RunAggregationQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunAggregationQueryRequest.verify|verify} messages. + * @param message RunAggregationQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IRunAggregationQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a RunAggregationQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAggregationQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunAggregationQueryRequest; - /** 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 - } - } + /** + * Decodes a RunAggregationQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAggregationQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunAggregationQueryRequest; - /** Namespace protobuf. */ - namespace protobuf { + /** + * Verifies a RunAggregationQueryRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { + /** + * Creates a RunAggregationQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAggregationQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunAggregationQueryRequest; - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } + /** + * Creates a plain object from a RunAggregationQueryRequest message. Also converts values to other types if specified. + * @param message RunAggregationQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.RunAggregationQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { + /** + * Converts this RunAggregationQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); + /** Properties of a RunAggregationQueryResponse. */ + interface IRunAggregationQueryResponse { - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; + /** RunAggregationQueryResponse batch */ + batch?: (google.datastore.v1.IAggregationResultBatch|null); - /** - * 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; + /** RunAggregationQueryResponse query */ + query?: (google.datastore.v1.IAggregationQuery|null); + } - /** - * 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; + /** Represents a RunAggregationQueryResponse. */ + class RunAggregationQueryResponse implements IRunAggregationQueryResponse { - /** - * 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; + /** + * Constructs a new RunAggregationQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IRunAggregationQueryResponse); - /** - * 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; + /** RunAggregationQueryResponse batch. */ + public batch?: (google.datastore.v1.IAggregationResultBatch|null); - /** - * 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; + /** RunAggregationQueryResponse query. */ + public query?: (google.datastore.v1.IAggregationQuery|null); - /** - * 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 new RunAggregationQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunAggregationQueryResponse instance + */ + public static create(properties?: google.datastore.v1.IRunAggregationQueryResponse): google.datastore.v1.RunAggregationQueryResponse; - /** - * 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; + /** + * Encodes the specified RunAggregationQueryResponse message. Does not implicitly {@link google.datastore.v1.RunAggregationQueryResponse.verify|verify} messages. + * @param message RunAggregationQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IRunAggregationQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 }; + /** + * Encodes the specified RunAggregationQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunAggregationQueryResponse.verify|verify} messages. + * @param message RunAggregationQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IRunAggregationQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a RunAggregationQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunAggregationQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunAggregationQueryResponse; - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { + /** + * Decodes a RunAggregationQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunAggregationQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunAggregationQueryResponse; - /** FileDescriptorProto name */ - name?: (string|null); + /** + * Verifies a RunAggregationQueryResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileDescriptorProto package */ - "package"?: (string|null); + /** + * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunAggregationQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunAggregationQueryResponse; - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); + /** + * Creates a plain object from a RunAggregationQueryResponse message. Also converts values to other types if specified. + * @param message RunAggregationQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.RunAggregationQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); + /** + * Converts this RunAggregationQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); + /** Properties of a BeginTransactionRequest. */ + interface IBeginTransactionRequest { - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); + /** BeginTransactionRequest projectId */ + projectId?: (string|null); - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** BeginTransactionRequest databaseId */ + databaseId?: (string|null); - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); + /** BeginTransactionRequest transactionOptions */ + transactionOptions?: (google.datastore.v1.ITransactionOptions|null); + } - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** Represents a BeginTransactionRequest. */ + class BeginTransactionRequest implements IBeginTransactionRequest { - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); + /** + * Constructs a new BeginTransactionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IBeginTransactionRequest); - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** BeginTransactionRequest projectId. */ + public projectId: string; - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } + /** BeginTransactionRequest databaseId. */ + public databaseId: string; - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { + /** BeginTransactionRequest transactionOptions. */ + public transactionOptions?: (google.datastore.v1.ITransactionOptions|null); - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BeginTransactionRequest instance + */ + public static create(properties?: google.datastore.v1.IBeginTransactionRequest): google.datastore.v1.BeginTransactionRequest; - /** FileDescriptorProto name. */ - public name: string; + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.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.datastore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto package. */ - public package: string; + /** + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto dependency. */ - public dependency: string[]; + /** + * 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.datastore.v1.BeginTransactionRequest; - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; + /** + * 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.datastore.v1.BeginTransactionRequest; - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; + /** + * 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); - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; + /** + * 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.datastore.v1.BeginTransactionRequest; - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** + * 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.datastore.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; + /** + * Converts this BeginTransactionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** Properties of a BeginTransactionResponse. */ + interface IBeginTransactionResponse { - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); + /** BeginTransactionResponse transaction */ + transaction?: (Uint8Array|null); + } - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** Represents a BeginTransactionResponse. */ + class BeginTransactionResponse implements IBeginTransactionResponse { - /** FileDescriptorProto syntax. */ - public syntax: string; + /** + * Constructs a new BeginTransactionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IBeginTransactionResponse); - /** - * 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; + /** BeginTransactionResponse transaction. */ + public transaction: Uint8Array; - /** - * 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; + /** + * Creates a new BeginTransactionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BeginTransactionResponse instance + */ + public static create(properties?: google.datastore.v1.IBeginTransactionResponse): google.datastore.v1.BeginTransactionResponse; - /** - * 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; + /** + * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @param message BeginTransactionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IBeginTransactionResponse, 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; + /** + * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @param message BeginTransactionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IBeginTransactionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.BeginTransactionResponse; - /** - * 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); + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.BeginTransactionResponse; - /** - * 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; + /** + * Verifies a BeginTransactionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from 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 }; + /** + * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BeginTransactionResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.BeginTransactionResponse; - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. + * @param message BeginTransactionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.BeginTransactionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { + /** + * Converts this BeginTransactionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** DescriptorProto name */ - name?: (string|null); + /** Properties of a RollbackRequest. */ + interface IRollbackRequest { - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); + /** RollbackRequest projectId */ + projectId?: (string|null); - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** RollbackRequest databaseId */ + databaseId?: (string|null); - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); + /** RollbackRequest transaction */ + transaction?: (Uint8Array|null); + } - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** Represents a RollbackRequest. */ + class RollbackRequest implements IRollbackRequest { - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + /** + * Constructs a new RollbackRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IRollbackRequest); - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + /** RollbackRequest projectId. */ + public projectId: string; - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); + /** RollbackRequest databaseId. */ + public databaseId: string; - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + /** RollbackRequest transaction. */ + public transaction: Uint8Array; - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } + /** + * Creates a new RollbackRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackRequest instance + */ + public static create(properties?: google.datastore.v1.IRollbackRequest): google.datastore.v1.RollbackRequest; - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.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.datastore.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** DescriptorProto name. */ - public name: string; + /** + * 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.datastore.v1.RollbackRequest; - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; + /** + * 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.datastore.v1.RollbackRequest; - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** + * 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); - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; + /** + * 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.datastore.v1.RollbackRequest; - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** + * 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.datastore.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + /** + * Converts this RollbackRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + /** Properties of a RollbackResponse. */ + interface IRollbackResponse { + } - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); + /** Represents a RollbackResponse. */ + class RollbackResponse implements IRollbackResponse { - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + /** + * Constructs a new RollbackResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IRollbackResponse); - /** DescriptorProto reservedName. */ - public reservedName: string[]; + /** + * Creates a new RollbackResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackResponse instance + */ + public static create(properties?: google.datastore.v1.IRollbackResponse): google.datastore.v1.RollbackResponse; - /** - * 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 RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * @param message RollbackResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IRollbackResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * @param message RollbackResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IRollbackResponse, 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 RollbackResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RollbackResponse; - /** - * 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 RollbackResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RollbackResponse; - /** - * 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 RollbackResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a 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 RollbackResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.RollbackResponse; - /** - * 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 RollbackResponse message. Also converts values to other types if specified. + * @param message RollbackResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.RollbackResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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 RollbackResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a CommitRequest. */ + interface ICommitRequest { - namespace DescriptorProto { + /** CommitRequest projectId */ + projectId?: (string|null); - /** Properties of an ExtensionRange. */ - interface IExtensionRange { + /** CommitRequest databaseId */ + databaseId?: (string|null); - /** ExtensionRange start */ - start?: (number|null); + /** CommitRequest mode */ + mode?: (google.datastore.v1.CommitRequest.Mode|null); - /** ExtensionRange end */ - end?: (number|null); + /** CommitRequest transaction */ + transaction?: (Uint8Array|null); - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); + /** CommitRequest mutations */ + mutations?: (google.datastore.v1.IMutation[]|null); } - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { + /** Represents a CommitRequest. */ + class CommitRequest implements ICommitRequest { /** - * Constructs a new ExtensionRange. + * Constructs a new CommitRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + constructor(properties?: google.datastore.v1.ICommitRequest); - /** ExtensionRange start. */ - public start: number; + /** CommitRequest projectId. */ + public projectId: string; - /** ExtensionRange end. */ - public end: number; + /** CommitRequest databaseId. */ + public databaseId: string; - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); + /** CommitRequest mode. */ + public mode: google.datastore.v1.CommitRequest.Mode; + + /** CommitRequest transaction. */ + public transaction?: (Uint8Array|null); + + /** CommitRequest mutations. */ + public mutations: google.datastore.v1.IMutation[]; + + /** CommitRequest transactionSelector. */ + public transactionSelector?: "transaction"; /** - * Creates a new ExtensionRange instance using the specified properties. + * Creates a new CommitRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExtensionRange instance + * @returns CommitRequest instance */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + public static create(properties?: google.datastore.v1.ICommitRequest): google.datastore.v1.CommitRequest; /** - * 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 + * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.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.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.ICommitRequest, 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 + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.datastore.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.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExtensionRange message from the specified reader or buffer. + * 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 ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.CommitRequest; /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExtensionRange + * @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.protobuf.DescriptorProto.ExtensionRange; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.CommitRequest; /** - * Verifies an ExtensionRange message. + * 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 an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExtensionRange + * @returns CommitRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.CommitRequest; /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange + * 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.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExtensionRange to JSON. + * Converts this CommitRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ReservedRange. */ - interface IReservedRange { + namespace CommitRequest { - /** ReservedRange start */ - start?: (number|null); + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + TRANSACTIONAL = 1, + NON_TRANSACTIONAL = 2 + } + } - /** ReservedRange end */ - end?: (number|null); + /** Properties of a CommitResponse. */ + interface ICommitResponse { + + /** CommitResponse mutationResults */ + mutationResults?: (google.datastore.v1.IMutationResult[]|null); + + /** CommitResponse indexUpdates */ + indexUpdates?: (number|null); + + /** CommitResponse commitTime */ + commitTime?: (google.protobuf.ITimestamp|null); } - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { + /** Represents a CommitResponse. */ + class CommitResponse implements ICommitResponse { /** - * Constructs a new ReservedRange. + * Constructs a new CommitResponse. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + constructor(properties?: google.datastore.v1.ICommitResponse); - /** ReservedRange start. */ - public start: number; + /** CommitResponse mutationResults. */ + public mutationResults: google.datastore.v1.IMutationResult[]; - /** ReservedRange end. */ - public end: number; + /** CommitResponse indexUpdates. */ + public indexUpdates: number; + + /** CommitResponse commitTime. */ + public commitTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new ReservedRange instance using the specified properties. + * Creates a new CommitResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ReservedRange instance + * @returns CommitResponse instance */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + public static create(properties?: google.datastore.v1.ICommitResponse): google.datastore.v1.CommitResponse; /** - * 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 + * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.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.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.ICommitResponse, 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 + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.datastore.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.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReservedRange message from the specified reader or buffer. + * 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 ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.CommitResponse; /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * Decodes a CommitResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReservedRange + * @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.protobuf.DescriptorProto.ReservedRange; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.CommitResponse; /** - * Verifies a ReservedRange message. + * 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 ReservedRange message from a plain object. Also converts values to their respective internal types. + * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReservedRange + * @returns CommitResponse */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.CommitResponse; /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange + * 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.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReservedRange to JSON. + * Converts this CommitResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + /** Properties of an AllocateIdsRequest. */ + interface IAllocateIdsRequest { - /** - * 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); + /** AllocateIdsRequest projectId */ + projectId?: (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; + /** AllocateIdsRequest databaseId */ + databaseId?: (string|null); - /** - * 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 }; + /** AllocateIdsRequest keys */ + keys?: (google.datastore.v1.IKey[]|null); + } - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents an AllocateIdsRequest. */ + class AllocateIdsRequest implements IAllocateIdsRequest { - namespace FieldDescriptorProto { + /** + * Constructs a new AllocateIdsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IAllocateIdsRequest); - /** 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 - } + /** AllocateIdsRequest projectId. */ + public projectId: string; - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } + /** AllocateIdsRequest databaseId. */ + public databaseId: string; - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { + /** AllocateIdsRequest keys. */ + public keys: google.datastore.v1.IKey[]; - /** OneofDescriptorProto name */ - name?: (string|null); + /** + * Creates a new AllocateIdsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocateIdsRequest instance + */ + public static create(properties?: google.datastore.v1.IAllocateIdsRequest): google.datastore.v1.AllocateIdsRequest; - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } + /** + * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. + * @param message AllocateIdsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IAllocateIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { + /** + * Encodes the specified AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. + * @param message AllocateIdsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IAllocateIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); + /** + * Decodes an AllocateIdsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocateIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AllocateIdsRequest; - /** OneofDescriptorProto name. */ - public name: string; + /** + * Decodes an AllocateIdsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocateIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AllocateIdsRequest; - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); + /** + * Verifies an AllocateIdsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|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; + /** + * Creates an AllocateIdsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocateIdsRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AllocateIdsRequest; - /** - * 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; + /** + * Creates a plain object from an AllocateIdsRequest message. Also converts values to other types if specified. + * @param message AllocateIdsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.AllocateIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this AllocateIdsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of an AllocateIdsResponse. */ + interface IAllocateIdsResponse { - /** - * 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; + /** AllocateIdsResponse keys */ + keys?: (google.datastore.v1.IKey[]|null); + } - /** - * 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); + /** Represents an AllocateIdsResponse. */ + class AllocateIdsResponse implements IAllocateIdsResponse { - /** - * 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; + /** + * Constructs a new AllocateIdsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IAllocateIdsResponse); - /** - * 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 }; + /** AllocateIdsResponse keys. */ + public keys: google.datastore.v1.IKey[]; - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new AllocateIdsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocateIdsResponse instance + */ + public static create(properties?: google.datastore.v1.IAllocateIdsResponse): google.datastore.v1.AllocateIdsResponse; - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { + /** + * Encodes the specified AllocateIdsResponse message. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * @param message AllocateIdsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IAllocateIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllocateIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * @param message AllocateIdsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IAllocateIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumDescriptorProto name */ - name?: (string|null); + /** + * Decodes an AllocateIdsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocateIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AllocateIdsResponse; - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + /** + * Decodes an AllocateIdsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocateIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AllocateIdsResponse; - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); + /** + * Verifies an AllocateIdsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + /** + * Creates an AllocateIdsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocateIdsResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AllocateIdsResponse; - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } + /** + * Creates a plain object from an AllocateIdsResponse message. Also converts values to other types if specified. + * @param message AllocateIdsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.AllocateIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { + /** + * Converts this AllocateIdsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); + /** Properties of a ReserveIdsRequest. */ + interface IReserveIdsRequest { - /** EnumDescriptorProto name. */ - public name: string; + /** ReserveIdsRequest projectId */ + projectId?: (string|null); - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; + /** ReserveIdsRequest databaseId */ + databaseId?: (string|null); - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); + /** ReserveIdsRequest keys */ + keys?: (google.datastore.v1.IKey[]|null); + } - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + /** Represents a ReserveIdsRequest. */ + class ReserveIdsRequest implements IReserveIdsRequest { - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; + /** + * Constructs a new ReserveIdsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IReserveIdsRequest); - /** - * 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; + /** ReserveIdsRequest projectId. */ + public projectId: string; - /** - * 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; + /** ReserveIdsRequest databaseId. */ + public databaseId: string; - /** - * 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; + /** ReserveIdsRequest keys. */ + public keys: google.datastore.v1.IKey[]; - /** - * 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; + /** + * Creates a new ReserveIdsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReserveIdsRequest instance + */ + public static create(properties?: google.datastore.v1.IReserveIdsRequest): google.datastore.v1.ReserveIdsRequest; - /** - * 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; + /** + * Encodes the specified ReserveIdsRequest message. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. + * @param message ReserveIdsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IReserveIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Encodes the specified ReserveIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. + * @param message ReserveIdsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IReserveIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a ReserveIdsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReserveIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReserveIdsRequest; - /** - * 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 }; + /** + * Decodes a ReserveIdsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReserveIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReserveIdsRequest; - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a ReserveIdsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - namespace EnumDescriptorProto { + /** + * Creates a ReserveIdsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReserveIdsRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReserveIdsRequest; - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { + /** + * Creates a plain object from a ReserveIdsRequest message. Also converts values to other types if specified. + * @param message ReserveIdsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.ReserveIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnumReservedRange start */ - start?: (number|null); + /** + * Converts this ReserveIdsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** EnumReservedRange end */ - end?: (number|null); + /** Properties of a ReserveIdsResponse. */ + interface IReserveIdsResponse { } - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { + /** Represents a ReserveIdsResponse. */ + class ReserveIdsResponse implements IReserveIdsResponse { /** - * Constructs a new EnumReservedRange. + * Constructs a new ReserveIdsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; + constructor(properties?: google.datastore.v1.IReserveIdsResponse); /** - * Creates a new EnumReservedRange instance using the specified properties. + * Creates a new ReserveIdsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns EnumReservedRange instance + * @returns ReserveIdsResponse instance */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + public static create(properties?: google.datastore.v1.IReserveIdsResponse): google.datastore.v1.ReserveIdsResponse; /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode + * Encodes the specified ReserveIdsResponse message. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. + * @param message ReserveIdsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IReserveIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode + * Encodes the specified ReserveIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. + * @param message ReserveIdsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IReserveIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EnumReservedRange message from the specified reader or buffer. + * Decodes a ReserveIdsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EnumReservedRange + * @returns ReserveIdsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReserveIdsResponse; /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * Decodes a ReserveIdsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EnumReservedRange + * @returns ReserveIdsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReserveIdsResponse; /** - * Verifies an EnumReservedRange message. + * Verifies a ReserveIdsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * Creates a ReserveIdsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EnumReservedRange + * @returns ReserveIdsResponse */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReserveIdsResponse; /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange + * Creates a plain object from a ReserveIdsResponse message. Also converts values to other types if specified. + * @param message ReserveIdsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.ReserveIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EnumReservedRange to JSON. + * Converts this ReserveIdsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - /** ServiceDescriptorProto name */ - name?: (string|null); + /** Properties of a Mutation. */ + interface IMutation { - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); + /** Mutation insert */ + insert?: (google.datastore.v1.IEntity|null); - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } + /** Mutation update */ + update?: (google.datastore.v1.IEntity|null); - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { + /** Mutation upsert */ + upsert?: (google.datastore.v1.IEntity|null); - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); + /** Mutation delete */ + "delete"?: (google.datastore.v1.IKey|null); - /** ServiceDescriptorProto name. */ - public name: string; + /** Mutation baseVersion */ + baseVersion?: (number|Long|null); - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; + /** Mutation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); + /** Represents a Mutation. */ + class Mutation implements IMutation { - /** - * 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; + /** + * Constructs a new Mutation. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IMutation); - /** - * 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; + /** Mutation insert. */ + public insert?: (google.datastore.v1.IEntity|null); - /** - * 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; + /** Mutation update. */ + public update?: (google.datastore.v1.IEntity|null); - /** - * 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; + /** Mutation upsert. */ + public upsert?: (google.datastore.v1.IEntity|null); - /** - * 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; + /** Mutation delete. */ + public delete?: (google.datastore.v1.IKey|null); - /** - * 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); + /** Mutation baseVersion. */ + public baseVersion?: (number|Long|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; + /** Mutation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** - * 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 }; + /** Mutation operation. */ + public operation?: ("insert"|"update"|"upsert"|"delete"); - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Mutation conflictDetectionStrategy. */ + public conflictDetectionStrategy?: ("baseVersion"|"updateTime"); - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { + /** + * Creates a new Mutation instance using the specified properties. + * @param [properties] Properties to set + * @returns Mutation instance + */ + public static create(properties?: google.datastore.v1.IMutation): google.datastore.v1.Mutation; - /** MethodDescriptorProto name */ - name?: (string|null); + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.datastore.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.datastore.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; - /** MethodDescriptorProto inputType */ - inputType?: (string|null); + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; - /** MethodDescriptorProto outputType */ - outputType?: (string|null); + /** + * 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.datastore.v1.Mutation; - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); + /** + * 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.datastore.v1.Mutation; - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); + /** + * 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); - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|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.datastore.v1.Mutation; - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { + /** + * 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.datastore.v1.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); + /** + * Converts this Mutation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MethodDescriptorProto name. */ - public name: string; + /** Properties of a MutationResult. */ + interface IMutationResult { - /** MethodDescriptorProto inputType. */ - public inputType: string; + /** MutationResult key */ + key?: (google.datastore.v1.IKey|null); - /** MethodDescriptorProto outputType. */ - public outputType: string; + /** MutationResult version */ + version?: (number|Long|null); - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); + /** MutationResult updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; + /** MutationResult conflictDetected */ + conflictDetected?: (boolean|null); + } - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; + /** Represents a MutationResult. */ + class MutationResult implements IMutationResult { - /** - * 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; + /** + * Constructs a new MutationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IMutationResult); - /** - * 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; + /** MutationResult key. */ + public key?: (google.datastore.v1.IKey|null); - /** - * 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; + /** MutationResult version. */ + public version: (number|Long); - /** - * 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; + /** MutationResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** - * 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; + /** MutationResult conflictDetected. */ + public conflictDetected: boolean; - /** - * 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 new MutationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns MutationResult instance + */ + public static create(properties?: google.datastore.v1.IMutationResult): google.datastore.v1.MutationResult; - /** - * 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; + /** + * Encodes the specified MutationResult message. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. + * @param message MutationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IMutationResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 }; + /** + * Encodes the specified MutationResult message, length delimited. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. + * @param message MutationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IMutationResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a MutationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.MutationResult; - /** Properties of a FileOptions. */ - interface IFileOptions { + /** + * Decodes a MutationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.MutationResult; - /** FileOptions javaPackage */ - javaPackage?: (string|null); + /** + * Verifies a MutationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); + /** + * Creates a MutationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutationResult + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.MutationResult; - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); + /** + * Creates a plain object from a MutationResult message. Also converts values to other types if specified. + * @param message MutationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.MutationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); + /** + * Converts this MutationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); + /** Properties of a ReadOptions. */ + interface IReadOptions { - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + /** ReadOptions readConsistency */ + readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|null); - /** FileOptions goPackage */ - goPackage?: (string|null); + /** ReadOptions transaction */ + transaction?: (Uint8Array|null); - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); + /** ReadOptions readTime */ + readTime?: (google.protobuf.ITimestamp|null); + } - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); + /** Represents a ReadOptions. */ + class ReadOptions implements IReadOptions { - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); + /** + * Constructs a new ReadOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IReadOptions); - /** FileOptions phpGenericServices */ - phpGenericServices?: (boolean|null); + /** ReadOptions readConsistency. */ + public readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|null); - /** FileOptions deprecated */ - deprecated?: (boolean|null); + /** ReadOptions transaction. */ + public transaction?: (Uint8Array|null); - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); + /** ReadOptions readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); + /** ReadOptions consistencyType. */ + public consistencyType?: ("readConsistency"|"transaction"|"readTime"); - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); + /** + * Creates a new ReadOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadOptions instance + */ + public static create(properties?: google.datastore.v1.IReadOptions): google.datastore.v1.ReadOptions; - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); + /** + * Encodes the specified ReadOptions message. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. + * @param message ReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); + /** + * Encodes the specified ReadOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. + * @param message ReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); + /** + * Decodes a ReadOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReadOptions; - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); + /** + * Decodes a ReadOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReadOptions; - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); + /** + * Verifies a ReadOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** + * Creates a ReadOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadOptions + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReadOptions; - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { + /** + * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. + * @param message ReadOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.ReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); + /** + * Converts this ReadOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileOptions javaPackage. */ - public javaPackage: string; + namespace ReadOptions { - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; + /** ReadConsistency enum. */ + enum ReadConsistency { + READ_CONSISTENCY_UNSPECIFIED = 0, + STRONG = 1, + EVENTUAL = 2 + } + } - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; + /** Properties of a TransactionOptions. */ + interface ITransactionOptions { - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; + /** TransactionOptions readWrite */ + readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; + /** TransactionOptions readOnly */ + readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); + } - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + /** Represents a TransactionOptions. */ + class TransactionOptions implements ITransactionOptions { - /** FileOptions goPackage. */ - public goPackage: string; + /** + * Constructs a new TransactionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.ITransactionOptions); - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; + /** TransactionOptions readWrite. */ + public readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; + /** TransactionOptions readOnly. */ + public readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; + /** TransactionOptions mode. */ + public mode?: ("readWrite"|"readOnly"); - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; + /** + * Creates a new TransactionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionOptions instance + */ + public static create(properties?: google.datastore.v1.ITransactionOptions): google.datastore.v1.TransactionOptions; - /** FileOptions deprecated. */ - public deprecated: boolean; + /** + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.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.datastore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; + /** + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; + /** + * 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.datastore.v1.TransactionOptions; - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; + /** + * 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.datastore.v1.TransactionOptions; - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; + /** + * 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); - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; + /** + * 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.datastore.v1.TransactionOptions; - /** FileOptions phpNamespace. */ - public phpNamespace: string; + /** + * 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.datastore.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; + /** + * Converts this TransactionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileOptions rubyPackage. */ - public rubyPackage: string; + namespace TransactionOptions { + + /** Properties of a ReadWrite. */ + interface IReadWrite { - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** ReadWrite previousTransaction */ + previousTransaction?: (Uint8Array|null); + } - /** - * 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; + /** Represents a ReadWrite. */ + class ReadWrite implements IReadWrite { - /** - * 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; + /** + * Constructs a new ReadWrite. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.TransactionOptions.IReadWrite); - /** - * 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; + /** ReadWrite previousTransaction. */ + public previousTransaction: Uint8Array; - /** - * 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; + /** + * Creates a new ReadWrite instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadWrite instance + */ + public static create(properties?: google.datastore.v1.TransactionOptions.IReadWrite): google.datastore.v1.TransactionOptions.ReadWrite; - /** - * 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; + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * 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.datastore.v1.TransactionOptions.ReadWrite; - /** - * 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 }; + /** + * 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.datastore.v1.TransactionOptions.ReadWrite; - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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); - namespace FileOptions { + /** + * 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.datastore.v1.TransactionOptions.ReadWrite; - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } + /** + * 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.datastore.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a MessageOptions. */ - interface IMessageOptions { + /** + * Converts this ReadWrite to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); + /** Properties of a ReadOnly. */ + interface IReadOnly { - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); + /** ReadOnly readTime */ + readTime?: (google.protobuf.ITimestamp|null); + } - /** MessageOptions deprecated */ - deprecated?: (boolean|null); + /** Represents a ReadOnly. */ + class ReadOnly implements IReadOnly { - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); + /** + * Constructs a new ReadOnly. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.TransactionOptions.IReadOnly); - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** ReadOnly readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { + /** + * Creates a new ReadOnly instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadOnly instance + */ + public static create(properties?: google.datastore.v1.TransactionOptions.IReadOnly): google.datastore.v1.TransactionOptions.ReadOnly; - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; + /** + * 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.datastore.v1.TransactionOptions.ReadOnly; - /** MessageOptions deprecated. */ - public deprecated: boolean; + /** + * 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.datastore.v1.TransactionOptions.ReadOnly; - /** MessageOptions mapEntry. */ - public mapEntry: boolean; + /** + * 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); - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * 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.datastore.v1.TransactionOptions.ReadOnly; - /** - * 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; + /** + * 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.datastore.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadOnly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } - /** - * 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; + /** Namespace admin. */ + namespace admin { - /** - * 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; + /** Namespace v1. */ + namespace v1 { - /** - * 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; + /** Properties of a MigrationStateEvent. */ + interface IMigrationStateEvent { - /** - * 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; + /** MigrationStateEvent state */ + state?: (google.datastore.admin.v1.MigrationState|null); + } - /** - * 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); + /** Represents a MigrationStateEvent. */ + class MigrationStateEvent implements IMigrationStateEvent { - /** - * 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; + /** + * Constructs a new MigrationStateEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IMigrationStateEvent); - /** - * 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 }; + /** MigrationStateEvent state. */ + public state: google.datastore.admin.v1.MigrationState; - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new MigrationStateEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationStateEvent instance + */ + public static create(properties?: google.datastore.admin.v1.IMigrationStateEvent): google.datastore.admin.v1.MigrationStateEvent; - /** Properties of a FieldOptions. */ - interface IFieldOptions { + /** + * Encodes the specified MigrationStateEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. + * @param message MigrationStateEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IMigrationStateEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + /** + * Encodes the specified MigrationStateEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. + * @param message MigrationStateEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IMigrationStateEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions packed */ - packed?: (boolean|null); + /** + * Decodes a MigrationStateEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationStateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationStateEvent; - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + /** + * Decodes a MigrationStateEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationStateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationStateEvent; - /** FieldOptions lazy */ - lazy?: (boolean|null); + /** + * Verifies a MigrationStateEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FieldOptions deprecated */ - deprecated?: (boolean|null); + /** + * Creates a MigrationStateEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationStateEvent + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationStateEvent; - /** FieldOptions weak */ - weak?: (boolean|null); + /** + * Creates a plain object from a MigrationStateEvent message. Also converts values to other types if specified. + * @param message MigrationStateEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.MigrationStateEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Converts this MigrationStateEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - } + /** Properties of a MigrationProgressEvent. */ + interface IMigrationProgressEvent { - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { + /** MigrationProgressEvent step */ + step?: (google.datastore.admin.v1.MigrationStep|null); - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); + /** MigrationProgressEvent prepareStepDetails */ + prepareStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null); - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + /** MigrationProgressEvent redirectWritesStepDetails */ + redirectWritesStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null); + } - /** FieldOptions packed. */ - public packed: boolean; + /** Represents a MigrationProgressEvent. */ + class MigrationProgressEvent implements IMigrationProgressEvent { - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + /** + * Constructs a new MigrationProgressEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IMigrationProgressEvent); - /** FieldOptions lazy. */ - public lazy: boolean; + /** MigrationProgressEvent step. */ + public step: google.datastore.admin.v1.MigrationStep; - /** FieldOptions deprecated. */ - public deprecated: boolean; + /** MigrationProgressEvent prepareStepDetails. */ + public prepareStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null); - /** FieldOptions weak. */ - public weak: boolean; + /** MigrationProgressEvent redirectWritesStepDetails. */ + public redirectWritesStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null); - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** MigrationProgressEvent stepDetails. */ + public stepDetails?: ("prepareStepDetails"|"redirectWritesStepDetails"); - /** - * 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; + /** + * Creates a new MigrationProgressEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationProgressEvent instance + */ + public static create(properties?: google.datastore.admin.v1.IMigrationProgressEvent): google.datastore.admin.v1.MigrationProgressEvent; - /** - * 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 MigrationProgressEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. + * @param message MigrationProgressEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IMigrationProgressEvent, 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; + /** + * Encodes the specified MigrationProgressEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. + * @param message MigrationProgressEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IMigrationProgressEvent, 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 MigrationProgressEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationProgressEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent; + + /** + * Decodes a MigrationProgressEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationProgressEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent; - /** - * 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 MigrationProgressEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a 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 MigrationProgressEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationProgressEvent + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent; - /** - * 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 MigrationProgressEvent message. Also converts values to other types if specified. + * @param message MigrationProgressEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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 MigrationProgressEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + namespace MigrationProgressEvent { - namespace FieldOptions { + /** ConcurrencyMode enum. */ + enum ConcurrencyMode { + CONCURRENCY_MODE_UNSPECIFIED = 0, + PESSIMISTIC = 1, + OPTIMISTIC = 2, + OPTIMISTIC_WITH_ENTITY_GROUPS = 3 + } - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } + /** Properties of a PrepareStepDetails. */ + interface IPrepareStepDetails { - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } + /** PrepareStepDetails concurrencyMode */ + concurrencyMode?: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null); + } - /** Properties of an OneofOptions. */ - interface IOneofOptions { + /** Represents a PrepareStepDetails. */ + class PrepareStepDetails implements IPrepareStepDetails { - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** + * Constructs a new PrepareStepDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails); - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { + /** PrepareStepDetails concurrencyMode. */ + public concurrencyMode: google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode; - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); + /** + * Creates a new PrepareStepDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PrepareStepDetails instance + */ + public static create(properties?: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Encodes the specified PrepareStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. + * @param message PrepareStepDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 PrepareStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. + * @param message PrepareStepDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a PrepareStepDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrepareStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - /** - * 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 a PrepareStepDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrepareStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - /** - * 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; + /** + * Verifies a PrepareStepDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes 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; + /** + * Creates a PrepareStepDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrepareStepDetails + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a PrepareStepDetails message. Also converts values to other types if specified. + * @param message PrepareStepDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this PrepareStepDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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 }; + /** Properties of a RedirectWritesStepDetails. */ + interface IRedirectWritesStepDetails { - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** RedirectWritesStepDetails concurrencyMode */ + concurrencyMode?: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null); + } - /** Properties of an EnumOptions. */ - interface IEnumOptions { + /** Represents a RedirectWritesStepDetails. */ + class RedirectWritesStepDetails implements IRedirectWritesStepDetails { - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); + /** + * Constructs a new RedirectWritesStepDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails); - /** EnumOptions deprecated */ - deprecated?: (boolean|null); + /** RedirectWritesStepDetails concurrencyMode. */ + public concurrencyMode: google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode; + + /** + * Creates a new RedirectWritesStepDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns RedirectWritesStepDetails instance + */ + public static create(properties?: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** + * Encodes the specified RedirectWritesStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. + * @param message RedirectWritesStepDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { + /** + * Encodes the specified RedirectWritesStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. + * @param message RedirectWritesStepDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); + /** + * Decodes a RedirectWritesStepDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedirectWritesStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - /** EnumOptions allowAlias. */ - public allowAlias: boolean; + /** + * Decodes a RedirectWritesStepDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedirectWritesStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - /** EnumOptions deprecated. */ - public deprecated: boolean; + /** + * Verifies a RedirectWritesStepDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Creates a RedirectWritesStepDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedirectWritesStepDetails + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - /** - * 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; + /** + * Creates a plain object from a RedirectWritesStepDetails message. Also converts values to other types if specified. + * @param message RedirectWritesStepDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this RedirectWritesStepDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * 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; + /** MigrationState enum. */ + enum MigrationState { + MIGRATION_STATE_UNSPECIFIED = 0, + RUNNING = 1, + PAUSED = 2, + COMPLETE = 3 + } - /** - * 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; + /** MigrationStep enum. */ + enum MigrationStep { + MIGRATION_STEP_UNSPECIFIED = 0, + PREPARE = 6, + START = 1, + APPLY_WRITES_SYNCHRONOUSLY = 7, + COPY_AND_VERIFY = 2, + REDIRECT_EVENTUALLY_CONSISTENT_READS = 3, + REDIRECT_STRONGLY_CONSISTENT_READS = 4, + REDIRECT_WRITES = 5 + } - /** - * 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; + /** Represents a DatastoreAdmin */ + class DatastoreAdmin extends $protobuf.rpc.Service { - /** - * 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); + /** + * Constructs a new DatastoreAdmin 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 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 new DatastoreAdmin 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): DatastoreAdmin; - /** - * 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 }; + /** + * Calls ExportEntities. + * @param request ExportEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportEntities(request: google.datastore.admin.v1.IExportEntitiesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ExportEntitiesCallback): void; - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls ExportEntities. + * @param request ExportEntitiesRequest message or plain object + * @returns Promise + */ + public exportEntities(request: google.datastore.admin.v1.IExportEntitiesRequest): Promise; - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { + /** + * Calls ImportEntities. + * @param request ImportEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importEntities(request: google.datastore.admin.v1.IImportEntitiesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ImportEntitiesCallback): void; - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); + /** + * Calls ImportEntities. + * @param request ImportEntitiesRequest message or plain object + * @returns Promise + */ + public importEntities(request: google.datastore.admin.v1.IImportEntitiesRequest): Promise; - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** + * Calls CreateIndex. + * @param request CreateIndexRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createIndex(request: google.datastore.admin.v1.ICreateIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.CreateIndexCallback): void; - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { + /** + * Calls CreateIndex. + * @param request CreateIndexRequest message or plain object + * @returns Promise + */ + public createIndex(request: google.datastore.admin.v1.ICreateIndexRequest): Promise; - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); + /** + * Calls DeleteIndex. + * @param request DeleteIndexRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteIndex(request: google.datastore.admin.v1.IDeleteIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.DeleteIndexCallback): void; - /** EnumValueOptions deprecated. */ - public deprecated: boolean; + /** + * Calls DeleteIndex. + * @param request DeleteIndexRequest message or plain object + * @returns Promise + */ + public deleteIndex(request: google.datastore.admin.v1.IDeleteIndexRequest): Promise; - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Calls GetIndex. + * @param request GetIndexRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Index + */ + public getIndex(request: google.datastore.admin.v1.IGetIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.GetIndexCallback): void; - /** - * 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; + /** + * Calls GetIndex. + * @param request GetIndexRequest message or plain object + * @returns Promise + */ + public getIndex(request: google.datastore.admin.v1.IGetIndexRequest): Promise; - /** - * 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; + /** + * Calls ListIndexes. + * @param request ListIndexesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListIndexesResponse + */ + public listIndexes(request: google.datastore.admin.v1.IListIndexesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ListIndexesCallback): void; - /** - * 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; + /** + * Calls ListIndexes. + * @param request ListIndexesRequest message or plain object + * @returns Promise + */ + public listIndexes(request: google.datastore.admin.v1.IListIndexesRequest): Promise; + } - /** - * 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; + namespace DatastoreAdmin { - /** - * 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; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#exportEntities}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * 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); + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#importEntities}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * 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; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#createIndex}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateIndexCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * 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 }; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#deleteIndex}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteIndexCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#getIndex}. + * @param error Error, if any + * @param [response] Index + */ + type GetIndexCallback = (error: (Error|null), response?: google.datastore.admin.v1.Index) => void; - /** Properties of a ServiceOptions. */ - interface IServiceOptions { + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#listIndexes}. + * @param error Error, if any + * @param [response] ListIndexesResponse + */ + type ListIndexesCallback = (error: (Error|null), response?: google.datastore.admin.v1.ListIndexesResponse) => void; + } - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); + /** Properties of a CommonMetadata. */ + interface ICommonMetadata { - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** CommonMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); + /** CommonMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - } + /** CommonMetadata operationType */ + operationType?: (google.datastore.admin.v1.OperationType|null); - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** CommonMetadata labels */ + labels?: ({ [k: string]: string }|null); - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); + /** CommonMetadata state */ + state?: (google.datastore.admin.v1.CommonMetadata.State|null); + } - /** ServiceOptions deprecated. */ - public deprecated: boolean; + /** Represents a CommonMetadata. */ + class CommonMetadata implements ICommonMetadata { - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Constructs a new CommonMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.ICommonMetadata); - /** - * 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; + /** CommonMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** - * 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; + /** CommonMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** - * 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; + /** CommonMetadata operationType. */ + public operationType: google.datastore.admin.v1.OperationType; - /** - * 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; + /** CommonMetadata labels. */ + public labels: { [k: string]: string }; - /** - * 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; + /** CommonMetadata state. */ + public state: google.datastore.admin.v1.CommonMetadata.State; - /** - * 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 new CommonMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.ICommonMetadata): google.datastore.admin.v1.CommonMetadata; - /** - * 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; + /** + * Encodes the specified CommonMetadata message. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. + * @param message CommonMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.ICommonMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 }; + /** + * Encodes the specified CommonMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. + * @param message CommonMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.ICommonMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a CommonMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.CommonMetadata; - /** Properties of a MethodOptions. */ - interface IMethodOptions { + /** + * Decodes a CommonMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.CommonMetadata; - /** MethodOptions deprecated */ - deprecated?: (boolean|null); + /** + * Verifies a CommonMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + /** + * Creates a CommonMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.CommonMetadata; - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Creates a plain object from a CommonMetadata message. Also converts values to other types if specified. + * @param message CommonMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.CommonMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** + * Converts this CommonMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); + namespace CommonMetadata { - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INITIALIZING = 1, + PROCESSING = 2, + CANCELLING = 3, + FINALIZING = 4, + SUCCESSFUL = 5, + FAILED = 6, + CANCELLED = 7 + } + } - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** Properties of a Progress. */ + interface IProgress { - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); + /** Progress workCompleted */ + workCompleted?: (number|Long|null); - /** MethodOptions deprecated. */ - public deprecated: boolean; + /** Progress workEstimated */ + workEstimated?: (number|Long|null); + } - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + /** Represents a Progress. */ + class Progress implements IProgress { - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Constructs a new Progress. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IProgress); - /** - * 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; + /** Progress workCompleted. */ + public workCompleted: (number|Long); - /** - * 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; + /** Progress workEstimated. */ + public workEstimated: (number|Long); - /** - * 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; + /** + * Creates a new Progress instance using the specified properties. + * @param [properties] Properties to set + * @returns Progress instance + */ + public static create(properties?: google.datastore.admin.v1.IProgress): google.datastore.admin.v1.Progress; - /** - * 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; + /** + * Encodes the specified Progress message. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Decodes a Progress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Progress; - /** - * 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; + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Progress; - /** - * 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 }; + /** + * Verifies a Progress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Progress + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Progress; - namespace MethodOptions { + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @param message Progress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } + /** + * Converts this Progress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { + /** Properties of an ExportEntitiesRequest. */ + interface IExportEntitiesRequest { - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + /** ExportEntitiesRequest projectId */ + projectId?: (string|null); - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); + /** ExportEntitiesRequest labels */ + labels?: ({ [k: string]: string }|null); - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); + /** ExportEntitiesRequest entityFilter */ + entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); + /** ExportEntitiesRequest outputUrlPrefix */ + outputUrlPrefix?: (string|null); + } - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); + /** Represents an ExportEntitiesRequest. */ + class ExportEntitiesRequest implements IExportEntitiesRequest { - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|string|null); + /** + * Constructs a new ExportEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IExportEntitiesRequest); - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } + /** ExportEntitiesRequest projectId. */ + public projectId: string; - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { + /** ExportEntitiesRequest labels. */ + public labels: { [k: string]: string }; - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); + /** ExportEntitiesRequest entityFilter. */ + public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; + /** ExportEntitiesRequest outputUrlPrefix. */ + public outputUrlPrefix: string; - /** UninterpretedOption identifierValue. */ - public identifierValue: string; + /** + * Creates a new ExportEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntitiesRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IExportEntitiesRequest): google.datastore.admin.v1.ExportEntitiesRequest; - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); + /** + * Encodes the specified ExportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. + * @param message ExportEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IExportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); + /** + * Encodes the specified ExportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. + * @param message ExportEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** UninterpretedOption doubleValue. */ - public doubleValue: number; + /** + * Decodes an ExportEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesRequest; - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|string); + /** + * Decodes an ExportEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesRequest; - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; + /** + * Verifies an ExportEntitiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * 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; + /** + * Creates an ExportEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesRequest; - /** - * 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; + /** + * Creates a plain object from an ExportEntitiesRequest message. Also converts values to other types if specified. + * @param message ExportEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ExportEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this ExportEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of an ImportEntitiesRequest. */ + interface IImportEntitiesRequest { - /** - * 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; + /** ImportEntitiesRequest projectId */ + projectId?: (string|null); - /** - * 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); + /** ImportEntitiesRequest labels */ + labels?: ({ [k: string]: 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; + /** ImportEntitiesRequest inputUrl */ + inputUrl?: (string|null); - /** - * 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 }; + /** ImportEntitiesRequest entityFilter */ + entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + } - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents an ImportEntitiesRequest. */ + class ImportEntitiesRequest implements IImportEntitiesRequest { - namespace UninterpretedOption { + /** + * Constructs a new ImportEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IImportEntitiesRequest); - /** Properties of a NamePart. */ - interface INamePart { + /** ImportEntitiesRequest projectId. */ + public projectId: string; - /** NamePart namePart */ - namePart: string; + /** ImportEntitiesRequest labels. */ + public labels: { [k: string]: string }; - /** NamePart isExtension */ - isExtension: boolean; - } + /** ImportEntitiesRequest inputUrl. */ + public inputUrl: string; - /** Represents a NamePart. */ - class NamePart implements INamePart { + /** ImportEntitiesRequest entityFilter. */ + public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + /** + * Creates a new ImportEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntitiesRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IImportEntitiesRequest): google.datastore.admin.v1.ImportEntitiesRequest; - /** NamePart namePart. */ - public namePart: string; + /** + * Encodes the specified ImportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. + * @param message ImportEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IImportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** NamePart isExtension. */ - public isExtension: boolean; + /** + * Encodes the specified ImportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. + * @param message ImportEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IImportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes an ImportEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ImportEntitiesRequest; - /** - * 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; + /** + * Decodes an ImportEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ImportEntitiesRequest; - /** - * 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; + /** + * Verifies an ImportEntitiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a 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; + /** + * Creates an ImportEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ImportEntitiesRequest; - /** - * 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; + /** + * Creates a plain object from an ImportEntitiesRequest message. Also converts values to other types if specified. + * @param message ImportEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ImportEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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); + /** + * Converts this ImportEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of an ExportEntitiesResponse. */ + interface IExportEntitiesResponse { - /** - * 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 }; + /** ExportEntitiesResponse outputUrl */ + outputUrl?: (string|null); + } - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** Represents an ExportEntitiesResponse. */ + class ExportEntitiesResponse implements IExportEntitiesResponse { - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { + /** + * Constructs a new ExportEntitiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IExportEntitiesResponse); - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } + /** ExportEntitiesResponse outputUrl. */ + public outputUrl: string; - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { + /** + * Creates a new ExportEntitiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntitiesResponse instance + */ + public static create(properties?: google.datastore.admin.v1.IExportEntitiesResponse): google.datastore.admin.v1.ExportEntitiesResponse; - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); + /** + * Encodes the specified ExportEntitiesResponse message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. + * @param message ExportEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IExportEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** + * Encodes the specified ExportEntitiesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. + * @param message ExportEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes an ExportEntitiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesResponse; - /** - * 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; + /** + * Decodes an ExportEntitiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesResponse; - /** - * 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; + /** + * Verifies an ExportEntitiesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a 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; + /** + * Creates an ExportEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntitiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesResponse; - /** - * 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; + /** + * Creates a plain object from an ExportEntitiesResponse message. Also converts values to other types if specified. + * @param message ExportEntitiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ExportEntitiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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); + /** + * Converts this ExportEntitiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of an ExportEntitiesMetadata. */ + interface IExportEntitiesMetadata { - /** - * 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 }; + /** ExportEntitiesMetadata common */ + common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ExportEntitiesMetadata progressEntities */ + progressEntities?: (google.datastore.admin.v1.IProgress|null); - namespace SourceCodeInfo { + /** ExportEntitiesMetadata progressBytes */ + progressBytes?: (google.datastore.admin.v1.IProgress|null); - /** Properties of a Location. */ - interface ILocation { + /** ExportEntitiesMetadata entityFilter */ + entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** Location path */ - path?: (number[]|null); + /** ExportEntitiesMetadata outputUrlPrefix */ + outputUrlPrefix?: (string|null); + } - /** Location span */ - span?: (number[]|null); + /** Represents an ExportEntitiesMetadata. */ + class ExportEntitiesMetadata implements IExportEntitiesMetadata { - /** Location leadingComments */ - leadingComments?: (string|null); + /** + * Constructs a new ExportEntitiesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IExportEntitiesMetadata); - /** Location trailingComments */ - trailingComments?: (string|null); + /** ExportEntitiesMetadata common. */ + public common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } + /** ExportEntitiesMetadata progressEntities. */ + public progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** Represents a Location. */ - class Location implements ILocation { + /** ExportEntitiesMetadata progressBytes. */ + public progressBytes?: (google.datastore.admin.v1.IProgress|null); - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + /** ExportEntitiesMetadata entityFilter. */ + public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** Location path. */ - public path: number[]; + /** ExportEntitiesMetadata outputUrlPrefix. */ + public outputUrlPrefix: string; - /** Location span. */ - public span: number[]; + /** + * Creates a new ExportEntitiesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntitiesMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.IExportEntitiesMetadata): google.datastore.admin.v1.ExportEntitiesMetadata; - /** Location leadingComments. */ - public leadingComments: string; + /** + * Encodes the specified ExportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. + * @param message ExportEntitiesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IExportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** Location trailingComments. */ - public trailingComments: string; + /** + * Encodes the specified ExportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. + * @param message ExportEntitiesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** + * Decodes an ExportEntitiesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesMetadata; - /** - * 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; + /** + * Decodes an ExportEntitiesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesMetadata; - /** - * 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; + /** + * Verifies an ExportEntitiesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates an ExportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntitiesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesMetadata; - /** - * 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; + /** + * Creates a plain object from an ExportEntitiesMetadata message. Also converts values to other types if specified. + * @param message ExportEntitiesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ExportEntitiesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + /** + * Converts this ExportEntitiesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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); + /** Properties of an ImportEntitiesMetadata. */ + interface IImportEntitiesMetadata { - /** - * 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; + /** ImportEntitiesMetadata common */ + common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ImportEntitiesMetadata progressEntities */ + progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** ImportEntitiesMetadata progressBytes */ + progressBytes?: (google.datastore.admin.v1.IProgress|null); - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { + /** ImportEntitiesMetadata entityFilter */ + entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } + /** ImportEntitiesMetadata inputUrl */ + inputUrl?: (string|null); + } - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + /** Represents an ImportEntitiesMetadata. */ + class ImportEntitiesMetadata implements IImportEntitiesMetadata { - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + /** + * Constructs a new ImportEntitiesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IImportEntitiesMetadata); - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** ImportEntitiesMetadata common. */ + public common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** - * 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; + /** ImportEntitiesMetadata progressEntities. */ + public progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** - * 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; + /** ImportEntitiesMetadata progressBytes. */ + public progressBytes?: (google.datastore.admin.v1.IProgress|null); - /** - * 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; + /** ImportEntitiesMetadata entityFilter. */ + public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** - * 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; + /** ImportEntitiesMetadata inputUrl. */ + public inputUrl: string; - /** - * 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; + /** + * Creates a new ImportEntitiesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntitiesMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.IImportEntitiesMetadata): google.datastore.admin.v1.ImportEntitiesMetadata; - /** - * 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); + /** + * Encodes the specified ImportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. + * @param message ImportEntitiesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IImportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Encodes the specified ImportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. + * @param message ImportEntitiesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IImportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportEntitiesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ImportEntitiesMetadata; - /** - * 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 }; + /** + * Decodes an ImportEntitiesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ImportEntitiesMetadata; - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies an ImportEntitiesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - namespace GeneratedCodeInfo { + /** + * Creates an ImportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntitiesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ImportEntitiesMetadata; - /** Properties of an Annotation. */ - interface IAnnotation { + /** + * Creates a plain object from an ImportEntitiesMetadata message. Also converts values to other types if specified. + * @param message ImportEntitiesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ImportEntitiesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Annotation path */ - path?: (number[]|null); + /** + * Converts this ImportEntitiesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Annotation sourceFile */ - sourceFile?: (string|null); + /** Properties of an EntityFilter. */ + interface IEntityFilter { - /** Annotation begin */ - begin?: (number|null); + /** EntityFilter kinds */ + kinds?: (string[]|null); - /** Annotation end */ - end?: (number|null); - } + /** EntityFilter namespaceIds */ + namespaceIds?: (string[]|null); + } - /** Represents an Annotation. */ - class Annotation implements IAnnotation { + /** Represents an EntityFilter. */ + class EntityFilter implements IEntityFilter { - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + /** + * Constructs a new EntityFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IEntityFilter); - /** Annotation path. */ - public path: number[]; + /** EntityFilter kinds. */ + public kinds: string[]; - /** Annotation sourceFile. */ - public sourceFile: string; + /** EntityFilter namespaceIds. */ + public namespaceIds: string[]; - /** Annotation begin. */ - public begin: number; + /** + * Creates a new EntityFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityFilter instance + */ + public static create(properties?: google.datastore.admin.v1.IEntityFilter): google.datastore.admin.v1.EntityFilter; - /** Annotation end. */ - public end: number; + /** + * Encodes the specified EntityFilter message. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. + * @param message EntityFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IEntityFilter, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 EntityFilter message, length delimited. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. + * @param message EntityFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IEntityFilter, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes an EntityFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.EntityFilter; - /** - * 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 EntityFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.EntityFilter; - /** - * 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; + /** + * Verifies an EntityFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes 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; + /** + * Creates an EntityFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityFilter + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.EntityFilter; - /** - * 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 a plain object from an EntityFilter message. Also converts values to other types if specified. + * @param message EntityFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.EntityFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this EntityFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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 }; + /** Properties of a CreateIndexRequest. */ + interface ICreateIndexRequest { - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** CreateIndexRequest projectId */ + projectId?: (string|null); - /** Properties of an Any. */ - interface IAny { + /** CreateIndexRequest index */ + index?: (google.datastore.admin.v1.IIndex|null); + } - /** Any type_url */ - type_url?: (string|null); + /** Represents a CreateIndexRequest. */ + class CreateIndexRequest implements ICreateIndexRequest { - /** Any value */ - value?: (Uint8Array|string|null); - } + /** + * Constructs a new CreateIndexRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.ICreateIndexRequest); - /** Represents an Any. */ - class Any implements IAny { + /** CreateIndexRequest projectId. */ + public projectId: string; - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); + /** CreateIndexRequest index. */ + public index?: (google.datastore.admin.v1.IIndex|null); - /** Any type_url. */ - public type_url: string; + /** + * Creates a new CreateIndexRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateIndexRequest instance + */ + public static create(properties?: google.datastore.admin.v1.ICreateIndexRequest): google.datastore.admin.v1.CreateIndexRequest; + + /** + * Encodes the specified CreateIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. + * @param message CreateIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.ICreateIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Any value. */ - public value: (Uint8Array|string); + /** + * Encodes the specified CreateIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. + * @param message CreateIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.ICreateIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a CreateIndexRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.CreateIndexRequest; - /** - * 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; + /** + * Decodes a CreateIndexRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.CreateIndexRequest; - /** - * 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; + /** + * Verifies a CreateIndexRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes 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; + /** + * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateIndexRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.CreateIndexRequest; - /** - * 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; + /** + * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. + * @param message CreateIndexRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.CreateIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: 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); + /** + * Converts this CreateIndexRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a DeleteIndexRequest. */ + interface IDeleteIndexRequest { - /** - * 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 }; + /** DeleteIndexRequest projectId */ + projectId?: (string|null); - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** DeleteIndexRequest indexId */ + indexId?: (string|null); + } - /** Properties of a Duration. */ - interface IDuration { + /** Represents a DeleteIndexRequest. */ + class DeleteIndexRequest implements IDeleteIndexRequest { - /** Duration seconds */ - seconds?: (number|Long|string|null); + /** + * Constructs a new DeleteIndexRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IDeleteIndexRequest); - /** Duration nanos */ - nanos?: (number|null); - } + /** DeleteIndexRequest projectId. */ + public projectId: string; - /** Represents a Duration. */ - class Duration implements IDuration { + /** DeleteIndexRequest indexId. */ + public indexId: string; - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); + /** + * Creates a new DeleteIndexRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteIndexRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IDeleteIndexRequest): google.datastore.admin.v1.DeleteIndexRequest; - /** Duration seconds. */ - public seconds: (number|Long|string); + /** + * Encodes the specified DeleteIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. + * @param message DeleteIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IDeleteIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Duration nanos. */ - public nanos: number; + /** + * Encodes the specified DeleteIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. + * @param message DeleteIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IDeleteIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a DeleteIndexRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.DeleteIndexRequest; - /** - * 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; + /** + * Decodes a DeleteIndexRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.DeleteIndexRequest; - /** - * 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; + /** + * Verifies a DeleteIndexRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a 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; + /** + * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteIndexRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.DeleteIndexRequest; - /** - * 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; + /** + * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. + * @param message DeleteIndexRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.DeleteIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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); + /** + * Converts this DeleteIndexRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a GetIndexRequest. */ + interface IGetIndexRequest { - /** - * 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 }; + /** GetIndexRequest projectId */ + projectId?: (string|null); - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** GetIndexRequest indexId */ + indexId?: (string|null); + } - /** Properties of an Empty. */ - interface IEmpty { - } + /** Represents a GetIndexRequest. */ + class GetIndexRequest implements IGetIndexRequest { - /** Represents an Empty. */ - class Empty implements IEmpty { + /** + * Constructs a new GetIndexRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IGetIndexRequest); - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); + /** GetIndexRequest projectId. */ + public projectId: string; - /** - * 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; + /** GetIndexRequest indexId. */ + public indexId: string; - /** - * 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; + /** + * Creates a new GetIndexRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIndexRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IGetIndexRequest): google.datastore.admin.v1.GetIndexRequest; - /** - * 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; + /** + * Encodes the specified GetIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. + * @param message GetIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IGetIndexRequest, 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; + /** + * Encodes the specified GetIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. + * @param message GetIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IGetIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a GetIndexRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.GetIndexRequest; - /** - * 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); + /** + * Decodes a GetIndexRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.GetIndexRequest; - /** - * 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; + /** + * Verifies a GetIndexRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from an 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 }; + /** + * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIndexRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.GetIndexRequest; - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. + * @param message GetIndexRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.GetIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a Timestamp. */ - interface ITimestamp { + /** + * Converts this GetIndexRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Timestamp seconds */ - seconds?: (number|Long|string|null); + /** Properties of a ListIndexesRequest. */ + interface IListIndexesRequest { - /** Timestamp nanos */ - nanos?: (number|null); - } + /** ListIndexesRequest projectId */ + projectId?: (string|null); - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** ListIndexesRequest filter */ + filter?: (string|null); - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); + /** ListIndexesRequest pageSize */ + pageSize?: (number|null); - /** Timestamp seconds. */ - public seconds: (number|Long|string); + /** ListIndexesRequest pageToken */ + pageToken?: (string|null); + } - /** Timestamp nanos. */ - public nanos: number; + /** Represents a ListIndexesRequest. */ + class ListIndexesRequest implements IListIndexesRequest { - /** - * 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; + /** + * Constructs a new ListIndexesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IListIndexesRequest); - /** - * 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; + /** ListIndexesRequest projectId. */ + public projectId: string; - /** - * 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; + /** ListIndexesRequest filter. */ + public filter: string; - /** - * 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; + /** ListIndexesRequest pageSize. */ + public pageSize: number; - /** - * 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; + /** ListIndexesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListIndexesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIndexesRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IListIndexesRequest): google.datastore.admin.v1.ListIndexesRequest; - /** - * 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); + /** + * Encodes the specified ListIndexesRequest message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. + * @param message ListIndexesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IListIndexesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Encodes the specified ListIndexesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. + * @param message ListIndexesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IListIndexesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 }; + /** + * Decodes a ListIndexesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIndexesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ListIndexesRequest; - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ListIndexesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIndexesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ListIndexesRequest; - /** Properties of a Struct. */ - interface IStruct { + /** + * Verifies a ListIndexesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } + /** + * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIndexesRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ListIndexesRequest; - /** Represents a Struct. */ - class Struct implements IStruct { + /** + * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. + * @param message ListIndexesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ListIndexesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); + /** + * Converts this ListIndexesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; + /** Properties of a ListIndexesResponse. */ + interface IListIndexesResponse { - /** - * 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; + /** ListIndexesResponse indexes */ + indexes?: (google.datastore.admin.v1.IIndex[]|null); - /** - * 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; + /** ListIndexesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * 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; + /** Represents a ListIndexesResponse. */ + class ListIndexesResponse implements IListIndexesResponse { - /** - * 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; + /** + * Constructs a new ListIndexesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IListIndexesResponse); - /** - * 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; + /** ListIndexesResponse indexes. */ + public indexes: google.datastore.admin.v1.IIndex[]; - /** - * 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); + /** ListIndexesResponse nextPageToken. */ + public nextPageToken: string; - /** - * 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 new ListIndexesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIndexesResponse instance + */ + public static create(properties?: google.datastore.admin.v1.IListIndexesResponse): google.datastore.admin.v1.ListIndexesResponse; - /** - * 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 }; + /** + * Encodes the specified ListIndexesResponse message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. + * @param message ListIndexesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IListIndexesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified ListIndexesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. + * @param message ListIndexesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IListIndexesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a Value. */ - interface IValue { + /** + * Decodes a ListIndexesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIndexesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ListIndexesResponse; - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + /** + * Decodes a ListIndexesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIndexesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ListIndexesResponse; - /** Value numberValue */ - numberValue?: (number|null); + /** + * Verifies a ListIndexesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Value stringValue */ - stringValue?: (string|null); + /** + * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIndexesResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ListIndexesResponse; - /** Value boolValue */ - boolValue?: (boolean|null); + /** + * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. + * @param message ListIndexesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ListIndexesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); + /** + * Converts this ListIndexesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } + /** Properties of an IndexOperationMetadata. */ + interface IIndexOperationMetadata { - /** Represents a Value. */ - class Value implements IValue { + /** IndexOperationMetadata common */ + common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); + /** IndexOperationMetadata progressEntities */ + progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); + /** IndexOperationMetadata indexId */ + indexId?: (string|null); + } - /** Value numberValue. */ - public numberValue?: (number|null); + /** Represents an IndexOperationMetadata. */ + class IndexOperationMetadata implements IIndexOperationMetadata { - /** Value stringValue. */ - public stringValue?: (string|null); + /** + * Constructs a new IndexOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IIndexOperationMetadata); - /** Value boolValue. */ - public boolValue?: (boolean|null); + /** IndexOperationMetadata common. */ + public common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); + /** IndexOperationMetadata progressEntities. */ + public progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); + /** IndexOperationMetadata indexId. */ + public indexId: string; - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + /** + * Creates a new IndexOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexOperationMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.IIndexOperationMetadata): google.datastore.admin.v1.IndexOperationMetadata; - /** - * 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 IndexOperationMetadata message. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. + * @param message IndexOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IIndexOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 IndexOperationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. + * @param message IndexOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IIndexOperationMetadata, 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 an IndexOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.IndexOperationMetadata; - /** - * 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 an IndexOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.IndexOperationMetadata; - /** - * 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 an IndexOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a 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 an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.IndexOperationMetadata; - /** - * 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 an IndexOperationMetadata message. Also converts values to other types if specified. + * @param message IndexOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.IndexOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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 IndexOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a DatastoreFirestoreMigrationMetadata. */ + interface IDatastoreFirestoreMigrationMetadata { - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } + /** DatastoreFirestoreMigrationMetadata migrationState */ + migrationState?: (google.datastore.admin.v1.MigrationState|null); - /** Properties of a ListValue. */ - interface IListValue { + /** DatastoreFirestoreMigrationMetadata migrationStep */ + migrationStep?: (google.datastore.admin.v1.MigrationStep|null); + } - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } + /** Represents a DatastoreFirestoreMigrationMetadata. */ + class DatastoreFirestoreMigrationMetadata implements IDatastoreFirestoreMigrationMetadata { - /** Represents a ListValue. */ - class ListValue implements IListValue { + /** + * Constructs a new DatastoreFirestoreMigrationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata); - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); + /** DatastoreFirestoreMigrationMetadata migrationState. */ + public migrationState: google.datastore.admin.v1.MigrationState; - /** ListValue values. */ - public values: google.protobuf.IValue[]; + /** DatastoreFirestoreMigrationMetadata migrationStep. */ + public migrationStep: google.datastore.admin.v1.MigrationStep; - /** - * 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; + /** + * Creates a new DatastoreFirestoreMigrationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DatastoreFirestoreMigrationMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; - /** - * 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 DatastoreFirestoreMigrationMetadata message. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. + * @param message DatastoreFirestoreMigrationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata, 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; + /** + * Encodes the specified DatastoreFirestoreMigrationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. + * @param message DatastoreFirestoreMigrationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata, 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 DatastoreFirestoreMigrationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatastoreFirestoreMigrationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; + + /** + * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatastoreFirestoreMigrationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; - /** - * 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 DatastoreFirestoreMigrationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a 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 DatastoreFirestoreMigrationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatastoreFirestoreMigrationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; - /** - * 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 DatastoreFirestoreMigrationMetadata message. Also converts values to other types if specified. + * @param message DatastoreFirestoreMigrationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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 DatastoreFirestoreMigrationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + EXPORT_ENTITIES = 1, + IMPORT_ENTITIES = 2, + CREATE_INDEX = 3, + DELETE_INDEX = 4 + } - /** Properties of a DoubleValue. */ - interface IDoubleValue { + /** Properties of an Index. */ + interface IIndex { - /** DoubleValue value */ - value?: (number|null); - } + /** Index projectId */ + projectId?: (string|null); - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { + /** Index indexId */ + indexId?: (string|null); - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); + /** Index kind */ + kind?: (string|null); - /** DoubleValue value. */ - public value: number; + /** Index ancestor */ + ancestor?: (google.datastore.admin.v1.Index.AncestorMode|null); - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + /** Index properties */ + properties?: (google.datastore.admin.v1.Index.IIndexedProperty[]|null); - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** Index state */ + state?: (google.datastore.admin.v1.Index.State|null); + } - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an Index. */ + class Index implements IIndex { - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + /** + * Constructs a new Index. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IIndex); - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + /** Index projectId. */ + public projectId: string; - /** - * Verifies a DoubleValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Index indexId. */ + public indexId: string; - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + /** Index kind. */ + public kind: string; - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Index ancestor. */ + public ancestor: google.datastore.admin.v1.Index.AncestorMode; - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Index properties. */ + public properties: google.datastore.admin.v1.Index.IIndexedProperty[]; - /** Properties of a FloatValue. */ - interface IFloatValue { + /** Index state. */ + public state: google.datastore.admin.v1.Index.State; - /** FloatValue value */ - value?: (number|null); - } + /** + * Creates a new Index instance using the specified properties. + * @param [properties] Properties to set + * @returns Index instance + */ + public static create(properties?: google.datastore.admin.v1.IIndex): google.datastore.admin.v1.Index; - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { + /** + * Encodes the specified Index message. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. + * @param message Index message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IIndex, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); + /** + * Encodes the specified Index message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. + * @param message Index message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IIndex, writer?: $protobuf.Writer): $protobuf.Writer; - /** FloatValue value. */ - public value: number; + /** + * Decodes an Index message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Index + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Index; - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + /** + * Decodes an Index message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Index + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Index; - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an Index message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Index message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Index + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Index; - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from an Index message. Also converts values to other types if specified. + * @param message Index + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.Index, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + /** + * Converts this Index to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + namespace Index { - /** - * Verifies a FloatValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** AncestorMode enum. */ + enum AncestorMode { + ANCESTOR_MODE_UNSPECIFIED = 0, + NONE = 1, + ALL_ANCESTORS = 2 + } - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + ASCENDING = 1, + DESCENDING = 2 + } - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of an IndexedProperty. */ + interface IIndexedProperty { - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** IndexedProperty name */ + name?: (string|null); - /** Properties of an Int64Value. */ - interface IInt64Value { + /** IndexedProperty direction */ + direction?: (google.datastore.admin.v1.Index.Direction|null); + } - /** Int64Value value */ - value?: (number|Long|string|null); - } + /** Represents an IndexedProperty. */ + class IndexedProperty implements IIndexedProperty { - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { + /** + * Constructs a new IndexedProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.Index.IIndexedProperty); - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); + /** IndexedProperty name. */ + public name: string; - /** Int64Value value. */ - public value: (number|Long|string); + /** IndexedProperty direction. */ + public direction: google.datastore.admin.v1.Index.Direction; - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + /** + * Creates a new IndexedProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexedProperty instance + */ + public static create(properties?: google.datastore.admin.v1.Index.IIndexedProperty): google.datastore.admin.v1.Index.IndexedProperty; - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified IndexedProperty message. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. + * @param message IndexedProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.Index.IIndexedProperty, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified IndexedProperty message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. + * @param message IndexedProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.Index.IIndexedProperty, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + /** + * Decodes an IndexedProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexedProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Index.IndexedProperty; - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + /** + * Decodes an IndexedProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexedProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Index.IndexedProperty; - /** - * Verifies an Int64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies an IndexedProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + /** + * Creates an IndexedProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexedProperty + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Index.IndexedProperty; - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an IndexedProperty message. Also converts values to other types if specified. + * @param message IndexedProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.Index.IndexedProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this IndexedProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 3, + ERROR = 4 + } + } + } } + } - /** Properties of a UInt64Value. */ - interface IUInt64Value { + /** Namespace type. */ + namespace type { - /** UInt64Value value */ - value?: (number|Long|string|null); + /** Properties of a LatLng. */ + interface ILatLng { + + /** LatLng latitude */ + latitude?: (number|null); + + /** LatLng longitude */ + longitude?: (number|null); } - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { + /** Represents a LatLng. */ + class LatLng implements ILatLng { /** - * Constructs a new UInt64Value. + * Constructs a new LatLng. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IUInt64Value); + constructor(properties?: google.type.ILatLng); - /** UInt64Value value. */ - public value: (number|Long|string); + /** LatLng latitude. */ + public latitude: number; + + /** LatLng longitude. */ + public longitude: number; /** - * Creates a new UInt64Value instance using the specified properties. + * Creates a new LatLng instance using the specified properties. * @param [properties] Properties to set - * @returns UInt64Value instance + * @returns LatLng instance */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + public static create(properties?: google.type.ILatLng): google.type.LatLng; /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UInt64Value message from the specified reader or buffer. + * Decodes a LatLng message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UInt64Value + * @returns LatLng * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.LatLng; /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * Decodes a LatLng message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UInt64Value + * @returns LatLng * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.LatLng; /** - * Verifies a UInt64Value message. + * Verifies a LatLng message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UInt64Value + * @returns LatLng */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + public static fromObject(object: { [k: string]: any }): google.type.LatLng; /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UInt64Value to JSON. + * Converts this LatLng to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of an Int32Value. */ - interface IInt32Value { + /** Namespace api. */ + namespace api { - /** Int32Value value */ - value?: (number|null); + /** 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 } - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { + /** 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 Int32Value. + * Constructs a new Http. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IInt32Value); + constructor(properties?: google.api.IHttp); - /** Int32Value value. */ - public value: number; + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; /** - * Creates a new Int32Value instance using the specified properties. + * Creates a new Http instance using the specified properties. * @param [properties] Properties to set - * @returns Int32Value instance + * @returns Http instance */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + public static create(properties?: google.api.IHttp): google.api.Http; /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Int32Value message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Int32Value + * @returns Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Int32Value + * @returns Http * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; /** - * Verifies an Int32Value message. + * Verifies a Http message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Int32Value + * @returns Http */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + public static fromObject(object: { [k: string]: any }): google.api.Http; /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Int32Value to JSON. + * Converts this Http to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a UInt32Value. */ - interface IUInt32Value { + /** Properties of a HttpRule. */ + interface IHttpRule { - /** UInt32Value value */ - value?: (number|null); + /** 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 UInt32Value. */ - class UInt32Value implements IUInt32Value { + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { /** - * Constructs a new UInt32Value. + * Constructs a new HttpRule. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IUInt32Value); + constructor(properties?: google.api.IHttpRule); - /** UInt32Value value. */ - public value: number; + /** 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 UInt32Value instance using the specified properties. + * Creates a new HttpRule instance using the specified properties. * @param [properties] Properties to set - * @returns UInt32Value instance + * @returns HttpRule instance */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a UInt32Value message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UInt32Value + * @returns HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UInt32Value + * @returns HttpRule * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; /** - * Verifies a UInt32Value message. + * Verifies a HttpRule message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UInt32Value + * @returns HttpRule */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UInt32Value to JSON. + * Converts this HttpRule to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BoolValue. */ - interface IBoolValue { + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** BoolValue value */ - value?: (boolean|null); + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); } - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { /** - * Constructs a new BoolValue. + * Constructs a new CustomHttpPattern. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IBoolValue); + constructor(properties?: google.api.ICustomHttpPattern); - /** BoolValue value. */ - public value: boolean; + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; /** - * Creates a new BoolValue instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @param [properties] Properties to set - * @returns BoolValue instance + * @returns CustomHttpPattern instance */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BoolValue message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BoolValue + * @returns CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BoolValue + * @returns CustomHttpPattern * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; /** - * Verifies a BoolValue message. + * Verifies a CustomHttpPattern message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BoolValue + * @returns CustomHttpPattern */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BoolValue to JSON. + * Converts this CustomHttpPattern to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a StringValue. */ - interface IStringValue { + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { - /** StringValue value */ - value?: (string|null); + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } - /** Represents a StringValue. */ - class StringValue implements IStringValue { + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { /** - * Constructs a new StringValue. + * Constructs a new ResourceDescriptor. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IStringValue); + constructor(properties?: google.api.IResourceDescriptor); - /** StringValue value. */ - public value: string; + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: google.api.ResourceDescriptor.History; + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; /** - * Creates a new StringValue instance using the specified properties. + * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set - * @returns StringValue instance + * @returns ResourceDescriptor instance */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StringValue message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StringValue + * @returns ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StringValue + * @returns ResourceDescriptor * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; /** - * Verifies a StringValue message. + * Verifies a ResourceDescriptor message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StringValue + * @returns ResourceDescriptor */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StringValue to JSON. + * Converts this ResourceDescriptor to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BytesValue. */ - interface IBytesValue { + namespace ResourceDescriptor { - /** BytesValue value */ - value?: (Uint8Array|string|null); + /** 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 + } } - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { + /** 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 BytesValue. + * Constructs a new ResourceReference. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IBytesValue); + constructor(properties?: google.api.IResourceReference); - /** BytesValue value. */ - public value: (Uint8Array|string); + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; /** - * Creates a new BytesValue instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @param [properties] Properties to set - * @returns BytesValue instance + * @returns ResourceReference instance */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BytesValue message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BytesValue + * @returns ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BytesValue + * @returns ResourceReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; /** - * Verifies a BytesValue message. + * Verifies a ResourceReference message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BytesValue + * @returns ResourceReference */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BytesValue to JSON. + * Converts this ResourceReference to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -12519,104 +13626,307 @@ export namespace google { public toJSON(): { [k: string]: any }; } } +} - /** Namespace type. */ - namespace type { - - /** Properties of a LatLng. */ - interface ILatLng { - - /** LatLng latitude */ - latitude?: (number|null); +/** Properties of a Reference. */ +export interface IReference { - /** LatLng longitude */ - longitude?: (number|null); - } + /** Reference app */ + app: string; - /** Represents a LatLng. */ - class LatLng implements ILatLng { + /** Reference namespace */ + namespace?: (string|null); - /** - * Constructs a new LatLng. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ILatLng); + /** Reference path */ + path: IPath; - /** LatLng latitude. */ - public latitude: number; + /** Reference databaseId */ + databaseId?: (string|null); +} - /** LatLng longitude. */ - public longitude: number; +/** Represents a Reference. */ +export class Reference implements IReference { + + /** + * Constructs a new Reference. + * @param [properties] Properties to set + */ + constructor(properties?: IReference); + + /** Reference app. */ + public app: string; + + /** Reference namespace. */ + public namespace: string; + + /** Reference path. */ + public path: IPath; + + /** Reference databaseId. */ + public databaseId: string; + + /** + * Creates a new Reference instance using the specified properties. + * @param [properties] Properties to set + * @returns Reference instance + */ + public static create(properties?: IReference): Reference; + + /** + * Encodes the specified Reference message. Does not implicitly {@link Reference.verify|verify} messages. + * @param message Reference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link Reference.verify|verify} messages. + * @param message Reference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Reference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Reference; + + /** + * Decodes a Reference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Reference; + + /** + * Verifies a Reference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Reference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Reference + */ + public static fromObject(object: { [k: string]: any }): Reference; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @param message Reference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Reference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Reference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} - /** - * Creates a new LatLng instance using the specified properties. - * @param [properties] Properties to set - * @returns LatLng instance - */ - public static create(properties?: google.type.ILatLng): google.type.LatLng; +/** Properties of a Path. */ +export interface IPath { - /** - * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. - * @param message LatLng message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + /** Path element */ + element?: (Path.IElement[]|null); +} - /** - * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. - * @param message LatLng message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; +/** Represents a Path. */ +export class Path implements IPath { + + /** + * Constructs a new Path. + * @param [properties] Properties to set + */ + constructor(properties?: IPath); + + /** Path element. */ + public element: Path.IElement[]; + + /** + * Creates a new Path instance using the specified properties. + * @param [properties] Properties to set + * @returns Path instance + */ + public static create(properties?: IPath): Path; + + /** + * Encodes the specified Path message. Does not implicitly {@link Path.verify|verify} messages. + * @param message Path message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: IPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Path message, length delimited. Does not implicitly {@link Path.verify|verify} messages. + * @param message Path message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: IPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Path message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Path + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Path; + + /** + * Decodes a Path message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Path + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Path; + + /** + * Verifies a Path message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Path message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Path + */ + public static fromObject(object: { [k: string]: any }): Path; + + /** + * Creates a plain object from a Path message. Also converts values to other types if specified. + * @param message Path + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Path, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Path to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; +} - /** - * Decodes a LatLng message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LatLng - * @throws {Error} If the payload is not 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.LatLng; +export namespace Path { - /** - * Decodes a LatLng message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LatLng - * @throws {Error} If the payload 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.LatLng; + /** Properties of an Element. */ + interface IElement { - /** - * Verifies a LatLng message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Element type */ + type: string; - /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LatLng - */ - public static fromObject(object: { [k: string]: any }): google.type.LatLng; + /** Element id */ + id?: (number|Long|null); - /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. - * @param message LatLng - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Element name */ + name?: (string|null); + } - /** - * Converts this LatLng to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents an Element. */ + class Element implements IElement { + + /** + * Constructs a new Element. + * @param [properties] Properties to set + */ + constructor(properties?: Path.IElement); + + /** Element type. */ + public type: string; + + /** Element id. */ + public id: (number|Long); + + /** Element name. */ + public name: string; + + /** + * Creates a new Element instance using the specified properties. + * @param [properties] Properties to set + * @returns Element instance + */ + public static create(properties?: Path.IElement): Path.Element; + + /** + * Encodes the specified Element message. Does not implicitly {@link Path.Element.verify|verify} messages. + * @param message Element message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: Path.IElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Element message, length delimited. Does not implicitly {@link Path.Element.verify|verify} messages. + * @param message Element message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: Path.IElement, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Element message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Element + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Path.Element; + + /** + * Decodes an Element message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Element + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Path.Element; + + /** + * Verifies an Element message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Element message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Element + */ + public static fromObject(object: { [k: string]: any }): Path.Element; + + /** + * Creates a plain object from an Element message. Also converts values to other types if specified. + * @param message Element + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: Path.Element, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Element to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } } diff --git a/protos/protos.js b/protos/protos.js index 58051ce19..db72d5d00 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -1,17 +1,3 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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 */ @@ -19,7 +5,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax").protobufMinimal); + module.exports = factory(require("protobufjs/minimal")); })(this, function($protobuf) { "use strict"; @@ -28,7 +14,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_datastore_protos || ($protobuf.roots._google_cloud_datastore_protos = {}); + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); $root.google = (function() { @@ -39,7894 +25,8556 @@ */ var google = {}; - google.datastore = (function() { + google.protobuf = (function() { /** - * Namespace datastore. + * Namespace protobuf. * @memberof google * @namespace */ - var datastore = {}; + var protobuf = {}; - datastore.admin = (function() { + protobuf.Struct = (function() { /** - * Namespace admin. - * @memberof google.datastore - * @namespace + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields */ - var admin = {}; - admin.v1 = (function() { + /** + * 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]]; + } - /** - * Namespace v1. - * @memberof google.datastore.admin - * @namespace - */ - var v1 = {}; + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; - v1.DatastoreAdmin = (function() { + /** + * 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); + }; - /** - * Constructs a new DatastoreAdmin service. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a DatastoreAdmin - * @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 DatastoreAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + /** + * 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; + }; - (DatastoreAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatastoreAdmin; + /** + * 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(); + }; - /** - * Creates new DatastoreAdmin service using the specified rpc implementation. - * @function create - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @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 {DatastoreAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - DatastoreAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * 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) { + 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(); + 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; + }; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#exportEntities}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef ExportEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * 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()); + }; - /** - * Calls ExportEntities. - * @function exportEntities - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IExportEntitiesRequest} request ExportEntitiesRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.ExportEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.exportEntities = function exportEntities(request, callback) { - return this.rpcCall(exportEntities, $root.google.datastore.admin.v1.ExportEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportEntities" }); + /** + * 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; + }; - /** - * Calls ExportEntities. - * @function exportEntities - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IExportEntitiesRequest} request ExportEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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; + }; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#importEntities}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef ImportEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * 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; + }; - /** - * Calls ImportEntities. - * @function importEntities - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IImportEntitiesRequest} request ImportEntitiesRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.ImportEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.importEntities = function importEntities(request, callback) { - return this.rpcCall(importEntities, $root.google.datastore.admin.v1.ImportEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportEntities" }); + /** + * 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); + }; - /** - * Calls ImportEntities. - * @function importEntities - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IImportEntitiesRequest} request ImportEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return Struct; + })(); - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#createIndex}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef CreateIndexCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + protobuf.Value = (function() { - /** - * Calls CreateIndex. - * @function createIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.ICreateIndexRequest} request CreateIndexRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.CreateIndexCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.createIndex = function createIndex(request, callback) { - return this.rpcCall(createIndex, $root.google.datastore.admin.v1.CreateIndexRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateIndex" }); + /** + * 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 + */ - /** - * Calls CreateIndex. - * @function createIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.ICreateIndexRequest} request CreateIndexRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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]]; + } - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#deleteIndex}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef DeleteIndexCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; - /** - * Calls DeleteIndex. - * @function deleteIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IDeleteIndexRequest} request DeleteIndexRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.DeleteIndexCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.deleteIndex = function deleteIndex(request, callback) { - return this.rpcCall(deleteIndex, $root.google.datastore.admin.v1.DeleteIndexRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteIndex" }); + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; - /** - * Calls DeleteIndex. - * @function deleteIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IDeleteIndexRequest} request DeleteIndexRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#getIndex}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef GetIndexCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.admin.v1.Index} [response] Index - */ + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; - /** - * Calls GetIndex. - * @function getIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IGetIndexRequest} request GetIndexRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.GetIndexCallback} callback Node-style callback called with the error, if any, and Index - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.getIndex = function getIndex(request, callback) { - return this.rpcCall(getIndex, $root.google.datastore.admin.v1.GetIndexRequest, $root.google.datastore.admin.v1.Index, request, callback); - }, "name", { value: "GetIndex" }); + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; - /** - * Calls GetIndex. - * @function getIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IGetIndexRequest} request GetIndexRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#listIndexes}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef ListIndexesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.admin.v1.ListIndexesResponse} [response] ListIndexesResponse - */ + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Calls ListIndexes. - * @function listIndexes - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IListIndexesRequest} request ListIndexesRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.ListIndexesCallback} callback Node-style callback called with the error, if any, and ListIndexesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.listIndexes = function listIndexes(request, callback) { - return this.rpcCall(listIndexes, $root.google.datastore.admin.v1.ListIndexesRequest, $root.google.datastore.admin.v1.ListIndexesResponse, request, callback); - }, "name", { value: "ListIndexes" }); + /** + * 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) + }); - /** - * Calls ListIndexes. - * @function listIndexes - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IListIndexesRequest} request ListIndexesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return DatastoreAdmin; - })(); + /** + * 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); + }; - v1.CommonMetadata = (function() { + /** + * 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; + }; - /** - * Properties of a CommonMetadata. - * @memberof google.datastore.admin.v1 - * @interface ICommonMetadata - * @property {google.protobuf.ITimestamp|null} [startTime] CommonMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] CommonMetadata endTime - * @property {google.datastore.admin.v1.OperationType|null} [operationType] CommonMetadata operationType - * @property {Object.|null} [labels] CommonMetadata labels - * @property {google.datastore.admin.v1.CommonMetadata.State|null} [state] CommonMetadata state - */ + /** + * 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(); + }; - /** - * Constructs a new CommonMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a CommonMetadata. - * @implements ICommonMetadata - * @constructor - * @param {google.datastore.admin.v1.ICommonMetadata=} [properties] Properties to set - */ - function CommonMetadata(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]]; + /** + * 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) { + 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(); + 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; + }; - /** - * CommonMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.startTime = null; - - /** - * CommonMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.endTime = null; - - /** - * CommonMetadata operationType. - * @member {google.datastore.admin.v1.OperationType} operationType - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.operationType = 0; - - /** - * CommonMetadata labels. - * @member {Object.} labels - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.labels = $util.emptyObject; - - /** - * CommonMetadata state. - * @member {google.datastore.admin.v1.CommonMetadata.State} state - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.state = 0; + /** + * 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()); + }; - /** - * Creates a new CommonMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {google.datastore.admin.v1.ICommonMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata instance - */ - CommonMetadata.create = function create(properties) { - return new CommonMetadata(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified CommonMetadata message. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {google.datastore.admin.v1.ICommonMetadata} message CommonMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonMetadata.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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operationType); - 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(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - return writer; - }; + /** + * 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) { + 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; + }; - /** - * Encodes the specified CommonMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {google.datastore.admin.v1.ICommonMetadata} message CommonMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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] : 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; + }; - /** - * Decodes a CommonMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.CommonMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.operationType = reader.int32(); - 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; - case 5: - message.state = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes a CommonMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return Value; + })(); - /** - * Verifies a CommonMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonMetadata.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.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - switch (message.operationType) { - default: - return "operationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - 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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - return null; - }; + /** + * 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; + })(); - /** - * Creates a CommonMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata - */ - CommonMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.CommonMetadata) - return object; - var message = new $root.google.datastore.admin.v1.CommonMetadata(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.datastore.admin.v1.CommonMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.datastore.admin.v1.CommonMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - switch (object.operationType) { - case "OPERATION_TYPE_UNSPECIFIED": - case 0: - message.operationType = 0; - break; - case "EXPORT_ENTITIES": - case 1: - message.operationType = 1; - break; - case "IMPORT_ENTITIES": - case 2: - message.operationType = 2; - break; - case "CREATE_INDEX": - case 3: - message.operationType = 3; - break; - case "DELETE_INDEX": - case 4: - message.operationType = 4; - break; - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.datastore.admin.v1.CommonMetadata.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.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "INITIALIZING": - case 1: - message.state = 1; - break; - case "PROCESSING": - case 2: - message.state = 2; - break; - case "CANCELLING": - case 3: - message.state = 3; - break; - case "FINALIZING": - case 4: - message.state = 4; - break; - case "SUCCESSFUL": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - return message; - }; + protobuf.ListValue = (function() { - /** - * Creates a plain object from a CommonMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {google.datastore.admin.v1.CommonMetadata} message CommonMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.operationType = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.datastore.admin.v1.OperationType[message.operationType] : message.operationType; - 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.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.CommonMetadata.State[message.state] : message.state; - return object; - }; + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ - /** - * Converts this CommonMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - * @returns {Object.} JSON object - */ - CommonMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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]]; + } - /** - * State enum. - * @name google.datastore.admin.v1.CommonMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} INITIALIZING=1 INITIALIZING value - * @property {number} PROCESSING=2 PROCESSING value - * @property {number} CANCELLING=3 CANCELLING value - * @property {number} FINALIZING=4 FINALIZING value - * @property {number} SUCCESSFUL=5 SUCCESSFUL value - * @property {number} FAILED=6 FAILED value - * @property {number} CANCELLED=7 CANCELLED value - */ - CommonMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INITIALIZING"] = 1; - values[valuesById[2] = "PROCESSING"] = 2; - values[valuesById[3] = "CANCELLING"] = 3; - values[valuesById[4] = "FINALIZING"] = 4; - values[valuesById[5] = "SUCCESSFUL"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "CANCELLED"] = 7; - return values; - })(); + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; - return CommonMetadata; - })(); + /** + * 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); + }; - v1.Progress = (function() { + /** + * 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; + }; - /** - * Properties of a Progress. - * @memberof google.datastore.admin.v1 - * @interface IProgress - * @property {number|Long|null} [workCompleted] Progress workCompleted - * @property {number|Long|null} [workEstimated] Progress workEstimated - */ + /** + * 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(); + }; - /** - * Constructs a new Progress. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a Progress. - * @implements IProgress - * @constructor - * @param {google.datastore.admin.v1.IProgress=} [properties] Properties to set - */ - function Progress(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * 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) { + 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(); + 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; + }; - /** - * Progress workCompleted. - * @member {number|Long} workCompleted - * @memberof google.datastore.admin.v1.Progress - * @instance - */ - Progress.prototype.workCompleted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Progress workEstimated. - * @member {number|Long} workEstimated - * @memberof google.datastore.admin.v1.Progress - * @instance - */ - Progress.prototype.workEstimated = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * 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()); + }; - /** - * Creates a new Progress instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {google.datastore.admin.v1.IProgress=} [properties] Properties to set - * @returns {google.datastore.admin.v1.Progress} Progress instance - */ - Progress.create = function create(properties) { - return new Progress(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified Progress message. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {google.datastore.admin.v1.IProgress} message Progress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Progress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.workCompleted != null && Object.hasOwnProperty.call(message, "workCompleted")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.workCompleted); - if (message.workEstimated != null && Object.hasOwnProperty.call(message, "workEstimated")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.workEstimated); - return writer; - }; + /** + * 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; + }; - /** - * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {google.datastore.admin.v1.IProgress} message Progress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Progress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + }; - /** - * Decodes a Progress message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.Progress} Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Progress.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Progress(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.workCompleted = reader.int64(); - break; - case 2: - message.workEstimated = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes a Progress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.Progress} Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Progress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return ListValue; + })(); - /** - * Verifies a Progress message. - * @function verify - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Progress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.workCompleted != null && message.hasOwnProperty("workCompleted")) - if (!$util.isInteger(message.workCompleted) && !(message.workCompleted && $util.isInteger(message.workCompleted.low) && $util.isInteger(message.workCompleted.high))) - return "workCompleted: integer|Long expected"; - if (message.workEstimated != null && message.hasOwnProperty("workEstimated")) - if (!$util.isInteger(message.workEstimated) && !(message.workEstimated && $util.isInteger(message.workEstimated.low) && $util.isInteger(message.workEstimated.high))) - return "workEstimated: integer|Long expected"; - return null; - }; + protobuf.Timestamp = (function() { - /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.Progress} Progress - */ - Progress.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.Progress) - return object; - var message = new $root.google.datastore.admin.v1.Progress(); - if (object.workCompleted != null) - if ($util.Long) - (message.workCompleted = $util.Long.fromValue(object.workCompleted)).unsigned = false; - else if (typeof object.workCompleted === "string") - message.workCompleted = parseInt(object.workCompleted, 10); - else if (typeof object.workCompleted === "number") - message.workCompleted = object.workCompleted; - else if (typeof object.workCompleted === "object") - message.workCompleted = new $util.LongBits(object.workCompleted.low >>> 0, object.workCompleted.high >>> 0).toNumber(); - if (object.workEstimated != null) - if ($util.Long) - (message.workEstimated = $util.Long.fromValue(object.workEstimated)).unsigned = false; - else if (typeof object.workEstimated === "string") - message.workEstimated = parseInt(object.workEstimated, 10); - else if (typeof object.workEstimated === "number") - message.workEstimated = object.workEstimated; - else if (typeof object.workEstimated === "object") - message.workEstimated = new $util.LongBits(object.workEstimated.low >>> 0, object.workEstimated.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {google.datastore.admin.v1.Progress} message Progress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Progress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.workCompleted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.workCompleted = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.workEstimated = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.workEstimated = options.longs === String ? "0" : 0; - } - if (message.workCompleted != null && message.hasOwnProperty("workCompleted")) - if (typeof message.workCompleted === "number") - object.workCompleted = options.longs === String ? String(message.workCompleted) : message.workCompleted; - else - object.workCompleted = options.longs === String ? $util.Long.prototype.toString.call(message.workCompleted) : options.longs === Number ? new $util.LongBits(message.workCompleted.low >>> 0, message.workCompleted.high >>> 0).toNumber() : message.workCompleted; - if (message.workEstimated != null && message.hasOwnProperty("workEstimated")) - if (typeof message.workEstimated === "number") - object.workEstimated = options.longs === String ? String(message.workEstimated) : message.workEstimated; - else - object.workEstimated = options.longs === String ? $util.Long.prototype.toString.call(message.workEstimated) : options.longs === Number ? new $util.LongBits(message.workEstimated.low >>> 0, message.workEstimated.high >>> 0).toNumber() : message.workEstimated; - return object; - }; - - /** - * Converts this Progress to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.Progress - * @instance - * @returns {Object.} JSON object - */ - Progress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ - return Progress; - })(); + /** + * 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]]; + } - v1.ExportEntitiesRequest = (function() { + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Properties of an ExportEntitiesRequest. - * @memberof google.datastore.admin.v1 - * @interface IExportEntitiesRequest - * @property {string|null} [projectId] ExportEntitiesRequest projectId - * @property {Object.|null} [labels] ExportEntitiesRequest labels - * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ExportEntitiesRequest entityFilter - * @property {string|null} [outputUrlPrefix] ExportEntitiesRequest outputUrlPrefix - */ + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; - /** - * Constructs a new ExportEntitiesRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ExportEntitiesRequest. - * @implements IExportEntitiesRequest - * @constructor - * @param {google.datastore.admin.v1.IExportEntitiesRequest=} [properties] Properties to set - */ - function ExportEntitiesRequest(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]]; - } + /** + * 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); + }; - /** - * ExportEntitiesRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - */ - ExportEntitiesRequest.prototype.projectId = ""; + /** + * 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; + }; - /** - * ExportEntitiesRequest labels. - * @member {Object.} labels - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - */ - ExportEntitiesRequest.prototype.labels = $util.emptyObject; + /** + * 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(); + }; - /** - * ExportEntitiesRequest entityFilter. - * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - */ - ExportEntitiesRequest.prototype.entityFilter = null; + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ExportEntitiesRequest outputUrlPrefix. - * @member {string} outputUrlPrefix - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - */ - ExportEntitiesRequest.prototype.outputUrlPrefix = ""; + /** + * 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()); + }; - /** - * Creates a new ExportEntitiesRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IExportEntitiesRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest instance - */ - ExportEntitiesRequest.create = function create(properties) { - return new ExportEntitiesRequest(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified ExportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IExportEntitiesRequest} message ExportEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesRequest.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.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.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) - $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputUrlPrefix != null && Object.hasOwnProperty.call(message, "outputUrlPrefix")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputUrlPrefix); - return writer; - }; + /** + * 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; + }; - /** - * Encodes the specified ExportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IExportEntitiesRequest} message ExportEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + }; - /** - * Decodes an ExportEntitiesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = 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.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); - break; - case 4: - message.outputUrlPrefix = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes an ExportEntitiesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return Timestamp; + })(); - /** - * Verifies an ExportEntitiesRequest message. - * @function verify - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportEntitiesRequest.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.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.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); - if (error) - return "entityFilter." + error; - } - if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) - if (!$util.isString(message.outputUrlPrefix)) - return "outputUrlPrefix: string expected"; - return null; - }; + protobuf.FileDescriptorSet = (function() { - /** - * Creates an ExportEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest - */ - ExportEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesRequest) - return object; - var message = new $root.google.datastore.admin.v1.ExportEntitiesRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesRequest.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.entityFilter != null) { - if (typeof object.entityFilter !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesRequest.entityFilter: object expected"); - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); - } - if (object.outputUrlPrefix != null) - message.outputUrlPrefix = String(object.outputUrlPrefix); - return message; - }; + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ - /** - * Creates a plain object from an ExportEntitiesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.ExportEntitiesRequest} message ExportEntitiesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportEntitiesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.projectId = ""; - object.entityFilter = null; - object.outputUrlPrefix = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - 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.entityFilter != null && message.hasOwnProperty("entityFilter")) - object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); - if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) - object.outputUrlPrefix = message.outputUrlPrefix; - return object; - }; + /** + * 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]]; + } - /** - * Converts this ExportEntitiesRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - * @returns {Object.} JSON object - */ - ExportEntitiesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; - return ExportEntitiesRequest; - })(); + /** + * 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); + }; - v1.ImportEntitiesRequest = (function() { + /** + * 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; + }; - /** - * Properties of an ImportEntitiesRequest. - * @memberof google.datastore.admin.v1 - * @interface IImportEntitiesRequest - * @property {string|null} [projectId] ImportEntitiesRequest projectId - * @property {Object.|null} [labels] ImportEntitiesRequest labels - * @property {string|null} [inputUrl] ImportEntitiesRequest inputUrl - * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ImportEntitiesRequest entityFilter - */ + /** + * 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(); + }; - /** - * Constructs a new ImportEntitiesRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ImportEntitiesRequest. - * @implements IImportEntitiesRequest - * @constructor - * @param {google.datastore.admin.v1.IImportEntitiesRequest=} [properties] Properties to set - */ - function ImportEntitiesRequest(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]]; + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * ImportEntitiesRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - */ - ImportEntitiesRequest.prototype.projectId = ""; - - /** - * ImportEntitiesRequest labels. - * @member {Object.} labels - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - */ - ImportEntitiesRequest.prototype.labels = $util.emptyObject; - - /** - * ImportEntitiesRequest inputUrl. - * @member {string} inputUrl - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - */ - ImportEntitiesRequest.prototype.inputUrl = ""; - - /** - * ImportEntitiesRequest entityFilter. - * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - */ - ImportEntitiesRequest.prototype.entityFilter = null; + /** + * 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()); + }; - /** - * Creates a new ImportEntitiesRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IImportEntitiesRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest instance - */ - ImportEntitiesRequest.create = function create(properties) { - return new ImportEntitiesRequest(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified ImportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IImportEntitiesRequest} message ImportEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEntitiesRequest.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.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.inputUrl != null && Object.hasOwnProperty.call(message, "inputUrl")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.inputUrl); - if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) - $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * 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; + }; - /** - * Encodes the specified ImportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IImportEntitiesRequest} message ImportEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + }; - /** - * Decodes an ImportEntitiesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEntitiesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ImportEntitiesRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = 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.inputUrl = reader.string(); - break; - case 4: - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes an ImportEntitiesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return FileDescriptorSet; + })(); - /** - * Verifies an ImportEntitiesRequest message. - * @function verify - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportEntitiesRequest.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.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.inputUrl != null && message.hasOwnProperty("inputUrl")) - if (!$util.isString(message.inputUrl)) - return "inputUrl: string expected"; - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); - if (error) - return "entityFilter." + error; - } - return null; - }; + protobuf.FileDescriptorProto = (function() { - /** - * Creates an ImportEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest - */ - ImportEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesRequest) - return object; - var message = new $root.google.datastore.admin.v1.ImportEntitiesRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesRequest.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.inputUrl != null) - message.inputUrl = String(object.inputUrl); - if (object.entityFilter != null) { - if (typeof object.entityFilter !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesRequest.entityFilter: object expected"); - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); - } - return message; - }; + /** + * 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 + */ - /** - * Creates a plain object from an ImportEntitiesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.ImportEntitiesRequest} message ImportEntitiesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportEntitiesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.projectId = ""; - object.inputUrl = ""; - object.entityFilter = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - 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.inputUrl != null && message.hasOwnProperty("inputUrl")) - object.inputUrl = message.inputUrl; - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) - object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); - return object; - }; + /** + * 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]]; + } - /** - * Converts this ImportEntitiesRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - * @returns {Object.} JSON object - */ - ImportEntitiesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; - return ImportEntitiesRequest; - })(); + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; - v1.ExportEntitiesResponse = (function() { + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; - /** - * Properties of an ExportEntitiesResponse. - * @memberof google.datastore.admin.v1 - * @interface IExportEntitiesResponse - * @property {string|null} [outputUrl] ExportEntitiesResponse outputUrl - */ + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - /** - * Constructs a new ExportEntitiesResponse. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ExportEntitiesResponse. - * @implements IExportEntitiesResponse - * @constructor - * @param {google.datastore.admin.v1.IExportEntitiesResponse=} [properties] Properties to set - */ - function ExportEntitiesResponse(properties) { - if (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 weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - /** - * ExportEntitiesResponse outputUrl. - * @member {string} outputUrl - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @instance - */ - ExportEntitiesResponse.prototype.outputUrl = ""; + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; - /** - * Creates a new ExportEntitiesResponse instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {google.datastore.admin.v1.IExportEntitiesResponse=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse instance - */ - ExportEntitiesResponse.create = function create(properties) { - return new ExportEntitiesResponse(properties); - }; + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; - /** - * Encodes the specified ExportEntitiesResponse message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {google.datastore.admin.v1.IExportEntitiesResponse} message ExportEntitiesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.outputUrl != null && Object.hasOwnProperty.call(message, "outputUrl")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUrl); - return writer; - }; + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; - /** - * Encodes the specified ExportEntitiesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {google.datastore.admin.v1.IExportEntitiesResponse} message ExportEntitiesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; - /** - * Decodes an ExportEntitiesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.outputUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; - /** - * Decodes an ExportEntitiesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; - /** - * Verifies an ExportEntitiesResponse message. - * @function verify - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportEntitiesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.outputUrl != null && message.hasOwnProperty("outputUrl")) - if (!$util.isString(message.outputUrl)) - return "outputUrl: string expected"; - return null; - }; - - /** - * Creates an ExportEntitiesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse - */ - ExportEntitiesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesResponse) - return object; - var message = new $root.google.datastore.admin.v1.ExportEntitiesResponse(); - if (object.outputUrl != null) - message.outputUrl = String(object.outputUrl); - return message; - }; - - /** - * Creates a plain object from an ExportEntitiesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {google.datastore.admin.v1.ExportEntitiesResponse} message ExportEntitiesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportEntitiesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.outputUrl = ""; - if (message.outputUrl != null && message.hasOwnProperty("outputUrl")) - object.outputUrl = message.outputUrl; - return object; - }; - - /** - * Converts this ExportEntitiesResponse to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @instance - * @returns {Object.} JSON object - */ - ExportEntitiesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; - return ExportEntitiesResponse; - })(); + /** + * 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); + }; - v1.ExportEntitiesMetadata = (function() { + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; - /** - * Properties of an ExportEntitiesMetadata. - * @memberof google.datastore.admin.v1 - * @interface IExportEntitiesMetadata - * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] ExportEntitiesMetadata common - * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] ExportEntitiesMetadata progressEntities - * @property {google.datastore.admin.v1.IProgress|null} [progressBytes] ExportEntitiesMetadata progressBytes - * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ExportEntitiesMetadata entityFilter - * @property {string|null} [outputUrlPrefix] ExportEntitiesMetadata outputUrlPrefix - */ + /** + * 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(); + }; - /** - * Constructs a new ExportEntitiesMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ExportEntitiesMetadata. - * @implements IExportEntitiesMetadata - * @constructor - * @param {google.datastore.admin.v1.IExportEntitiesMetadata=} [properties] Properties to set - */ - function ExportEntitiesMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * ExportEntitiesMetadata common. - * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.common = null; - - /** - * ExportEntitiesMetadata progressEntities. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.progressEntities = null; - - /** - * ExportEntitiesMetadata progressBytes. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressBytes - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.progressBytes = null; - - /** - * ExportEntitiesMetadata entityFilter. - * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.entityFilter = null; - - /** - * ExportEntitiesMetadata outputUrlPrefix. - * @member {string} outputUrlPrefix - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.outputUrlPrefix = ""; - - /** - * Creates a new ExportEntitiesMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IExportEntitiesMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata instance - */ - ExportEntitiesMetadata.create = function create(properties) { - return new ExportEntitiesMetadata(properties); - }; - - /** - * Encodes the specified ExportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IExportEntitiesMetadata} message ExportEntitiesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) - $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.progressBytes != null && Object.hasOwnProperty.call(message, "progressBytes")) - $root.google.datastore.admin.v1.Progress.encode(message.progressBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) - $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.outputUrlPrefix != null && Object.hasOwnProperty.call(message, "outputUrlPrefix")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.outputUrlPrefix); - return writer; - }; - - /** - * Encodes the specified ExportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IExportEntitiesMetadata} message ExportEntitiesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExportEntitiesMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); - break; - case 2: - message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 3: - message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 4: - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); - break; - case 5: - message.outputUrlPrefix = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExportEntitiesMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExportEntitiesMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportEntitiesMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); - if (error) - return "common." + error; - } - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); - if (error) - return "progressEntities." + error; - } - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes); - if (error) - return "progressBytes." + error; - } - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); - if (error) - return "entityFilter." + error; - } - if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) - if (!$util.isString(message.outputUrlPrefix)) - return "outputUrlPrefix: string expected"; - return null; - }; - - /** - * Creates an ExportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata - */ - ExportEntitiesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesMetadata) - return object; - var message = new $root.google.datastore.admin.v1.ExportEntitiesMetadata(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.common: object expected"); - message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); - } - if (object.progressEntities != null) { - if (typeof object.progressEntities !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.progressEntities: object expected"); - message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); - } - if (object.progressBytes != null) { - if (typeof object.progressBytes !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.progressBytes: object expected"); - message.progressBytes = $root.google.datastore.admin.v1.Progress.fromObject(object.progressBytes); - } - if (object.entityFilter != null) { - if (typeof object.entityFilter !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.entityFilter: object expected"); - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); - } - if (object.outputUrlPrefix != null) - message.outputUrlPrefix = String(object.outputUrlPrefix); - return message; - }; - - /** - * Creates a plain object from an ExportEntitiesMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.ExportEntitiesMetadata} message ExportEntitiesMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportEntitiesMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.common = null; - object.progressEntities = null; - object.progressBytes = null; - object.entityFilter = null; - object.outputUrlPrefix = ""; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) - object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) - object.progressBytes = $root.google.datastore.admin.v1.Progress.toObject(message.progressBytes, options); - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) - object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); - if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) - object.outputUrlPrefix = message.outputUrlPrefix; - return object; - }; - - /** - * Converts this ExportEntitiesMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - * @returns {Object.} JSON object - */ - ExportEntitiesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExportEntitiesMetadata; - })(); - - v1.ImportEntitiesMetadata = (function() { - - /** - * Properties of an ImportEntitiesMetadata. - * @memberof google.datastore.admin.v1 - * @interface IImportEntitiesMetadata - * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] ImportEntitiesMetadata common - * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] ImportEntitiesMetadata progressEntities - * @property {google.datastore.admin.v1.IProgress|null} [progressBytes] ImportEntitiesMetadata progressBytes - * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ImportEntitiesMetadata entityFilter - * @property {string|null} [inputUrl] ImportEntitiesMetadata inputUrl - */ - - /** - * Constructs a new ImportEntitiesMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ImportEntitiesMetadata. - * @implements IImportEntitiesMetadata - * @constructor - * @param {google.datastore.admin.v1.IImportEntitiesMetadata=} [properties] Properties to set - */ - function ImportEntitiesMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ImportEntitiesMetadata common. - * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.common = null; - - /** - * ImportEntitiesMetadata progressEntities. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.progressEntities = null; - - /** - * ImportEntitiesMetadata progressBytes. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressBytes - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.progressBytes = null; - - /** - * ImportEntitiesMetadata entityFilter. - * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.entityFilter = null; - - /** - * ImportEntitiesMetadata inputUrl. - * @member {string} inputUrl - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.inputUrl = ""; - - /** - * Creates a new ImportEntitiesMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IImportEntitiesMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata instance - */ - ImportEntitiesMetadata.create = function create(properties) { - return new ImportEntitiesMetadata(properties); - }; - - /** - * Encodes the specified ImportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IImportEntitiesMetadata} message ImportEntitiesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEntitiesMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) - $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.progressBytes != null && Object.hasOwnProperty.call(message, "progressBytes")) - $root.google.datastore.admin.v1.Progress.encode(message.progressBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) - $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputUrl != null && Object.hasOwnProperty.call(message, "inputUrl")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.inputUrl); - return writer; - }; - - /** - * Encodes the specified ImportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IImportEntitiesMetadata} message ImportEntitiesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEntitiesMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ImportEntitiesMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEntitiesMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ImportEntitiesMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); - break; - case 2: - message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 3: - message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 4: - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); - break; - case 5: - message.inputUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ImportEntitiesMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEntitiesMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ImportEntitiesMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportEntitiesMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); - if (error) - return "common." + error; - } - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); - if (error) - return "progressEntities." + error; - } - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes); - if (error) - return "progressBytes." + error; - } - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); - if (error) - return "entityFilter." + error; - } - if (message.inputUrl != null && message.hasOwnProperty("inputUrl")) - if (!$util.isString(message.inputUrl)) - return "inputUrl: string expected"; - return null; - }; - - /** - * Creates an ImportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata - */ - ImportEntitiesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesMetadata) - return object; - var message = new $root.google.datastore.admin.v1.ImportEntitiesMetadata(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.common: object expected"); - message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); - } - if (object.progressEntities != null) { - if (typeof object.progressEntities !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.progressEntities: object expected"); - message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); - } - if (object.progressBytes != null) { - if (typeof object.progressBytes !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.progressBytes: object expected"); - message.progressBytes = $root.google.datastore.admin.v1.Progress.fromObject(object.progressBytes); - } - if (object.entityFilter != null) { - if (typeof object.entityFilter !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.entityFilter: object expected"); - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); - } - if (object.inputUrl != null) - message.inputUrl = String(object.inputUrl); - return message; - }; - - /** - * Creates a plain object from an ImportEntitiesMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.ImportEntitiesMetadata} message ImportEntitiesMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportEntitiesMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.common = null; - object.progressEntities = null; - object.progressBytes = null; - object.entityFilter = null; - object.inputUrl = ""; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) - object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) - object.progressBytes = $root.google.datastore.admin.v1.Progress.toObject(message.progressBytes, options); - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) - object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); - if (message.inputUrl != null && message.hasOwnProperty("inputUrl")) - object.inputUrl = message.inputUrl; - return object; - }; - - /** - * Converts this ImportEntitiesMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - * @returns {Object.} JSON object - */ - ImportEntitiesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ImportEntitiesMetadata; - })(); - - v1.EntityFilter = (function() { + /** + * 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()); + }; - /** - * Properties of an EntityFilter. - * @memberof google.datastore.admin.v1 - * @interface IEntityFilter - * @property {Array.|null} [kinds] EntityFilter kinds - * @property {Array.|null} [namespaceIds] EntityFilter namespaceIds - */ + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; - /** - * Constructs a new EntityFilter. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an EntityFilter. - * @implements IEntityFilter - * @constructor - * @param {google.datastore.admin.v1.IEntityFilter=} [properties] Properties to set - */ - function EntityFilter(properties) { - this.kinds = []; - this.namespaceIds = []; - if (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 FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; - /** - * EntityFilter kinds. - * @member {Array.} kinds - * @memberof google.datastore.admin.v1.EntityFilter - * @instance - */ - EntityFilter.prototype.kinds = $util.emptyArray; - - /** - * EntityFilter namespaceIds. - * @member {Array.} namespaceIds - * @memberof google.datastore.admin.v1.EntityFilter - * @instance - */ - EntityFilter.prototype.namespaceIds = $util.emptyArray; - - /** - * Creates a new EntityFilter instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {google.datastore.admin.v1.IEntityFilter=} [properties] Properties to set - * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter instance - */ - EntityFilter.create = function create(properties) { - return new EntityFilter(properties); - }; - - /** - * Encodes the specified EntityFilter message. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {google.datastore.admin.v1.IEntityFilter} message EntityFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kinds != null && message.kinds.length) - for (var i = 0; i < message.kinds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kinds[i]); - if (message.namespaceIds != null && message.namespaceIds.length) - for (var i = 0; i < message.namespaceIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.namespaceIds[i]); - return writer; - }; - - /** - * Encodes the specified EntityFilter message, length delimited. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {google.datastore.admin.v1.IEntityFilter} message EntityFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntityFilter message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityFilter.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.EntityFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.kinds && message.kinds.length)) - message.kinds = []; - message.kinds.push(reader.string()); - break; - case 2: - if (!(message.namespaceIds && message.namespaceIds.length)) - message.namespaceIds = []; - message.namespaceIds.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - 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 = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; - /** - * Decodes an EntityFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies an EntityFilter message. - * @function verify - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kinds != null && message.hasOwnProperty("kinds")) { - if (!Array.isArray(message.kinds)) - return "kinds: array expected"; - for (var i = 0; i < message.kinds.length; ++i) - if (!$util.isString(message.kinds[i])) - return "kinds: string[] expected"; - } - if (message.namespaceIds != null && message.hasOwnProperty("namespaceIds")) { - if (!Array.isArray(message.namespaceIds)) - return "namespaceIds: array expected"; - for (var i = 0; i < message.namespaceIds.length; ++i) - if (!$util.isString(message.namespaceIds[i])) - return "namespaceIds: string[] expected"; - } - return null; - }; + return FileDescriptorProto; + })(); - /** - * Creates an EntityFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter - */ - EntityFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.EntityFilter) - return object; - var message = new $root.google.datastore.admin.v1.EntityFilter(); - if (object.kinds) { - if (!Array.isArray(object.kinds)) - throw TypeError(".google.datastore.admin.v1.EntityFilter.kinds: array expected"); - message.kinds = []; - for (var i = 0; i < object.kinds.length; ++i) - message.kinds[i] = String(object.kinds[i]); - } - if (object.namespaceIds) { - if (!Array.isArray(object.namespaceIds)) - throw TypeError(".google.datastore.admin.v1.EntityFilter.namespaceIds: array expected"); - message.namespaceIds = []; - for (var i = 0; i < object.namespaceIds.length; ++i) - message.namespaceIds[i] = String(object.namespaceIds[i]); - } - return message; - }; + protobuf.DescriptorProto = (function() { - /** - * Creates a plain object from an EntityFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {google.datastore.admin.v1.EntityFilter} message EntityFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.kinds = []; - object.namespaceIds = []; - } - if (message.kinds && message.kinds.length) { - object.kinds = []; - for (var j = 0; j < message.kinds.length; ++j) - object.kinds[j] = message.kinds[j]; - } - if (message.namespaceIds && message.namespaceIds.length) { - object.namespaceIds = []; - for (var j = 0; j < message.namespaceIds.length; ++j) - object.namespaceIds[j] = message.namespaceIds[j]; - } - return object; - }; + /** + * 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 + */ - /** - * Converts this EntityFilter to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.EntityFilter - * @instance - * @returns {Object.} JSON object - */ - EntityFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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]]; + } - return EntityFilter; - })(); + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; - v1.CreateIndexRequest = (function() { + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; - /** - * Properties of a CreateIndexRequest. - * @memberof google.datastore.admin.v1 - * @interface ICreateIndexRequest - * @property {string|null} [projectId] CreateIndexRequest projectId - * @property {google.datastore.admin.v1.IIndex|null} [index] CreateIndexRequest index - */ + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; - /** - * Constructs a new CreateIndexRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a CreateIndexRequest. - * @implements ICreateIndexRequest - * @constructor - * @param {google.datastore.admin.v1.ICreateIndexRequest=} [properties] Properties to set - */ - function CreateIndexRequest(properties) { - if (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 nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; - /** - * CreateIndexRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @instance - */ - CreateIndexRequest.prototype.projectId = ""; + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; - /** - * CreateIndexRequest index. - * @member {google.datastore.admin.v1.IIndex|null|undefined} index - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @instance - */ - CreateIndexRequest.prototype.index = null; + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; - /** - * Creates a new CreateIndexRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {google.datastore.admin.v1.ICreateIndexRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest instance - */ - CreateIndexRequest.create = function create(properties) { - return new CreateIndexRequest(properties); - }; + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; - /** - * Encodes the specified CreateIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {google.datastore.admin.v1.ICreateIndexRequest} message CreateIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateIndexRequest.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.index != null && Object.hasOwnProperty.call(message, "index")) - $root.google.datastore.admin.v1.Index.encode(message.index, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; - /** - * Encodes the specified CreateIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {google.datastore.admin.v1.ICreateIndexRequest} message CreateIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; - /** - * Decodes a CreateIndexRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateIndexRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.CreateIndexRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; - case 3: - message.index = $root.google.datastore.admin.v1.Index.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; - /** - * Decodes a CreateIndexRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateIndexRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies a CreateIndexRequest message. - * @function verify - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateIndexRequest.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.index != null && message.hasOwnProperty("index")) { - var error = $root.google.datastore.admin.v1.Index.verify(message.index); - if (error) - return "index." + error; - } - return null; - }; + /** + * 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; + }; - /** - * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest - */ - CreateIndexRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.CreateIndexRequest) - return object; - var message = new $root.google.datastore.admin.v1.CreateIndexRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.index != null) { - if (typeof object.index !== "object") - throw TypeError(".google.datastore.admin.v1.CreateIndexRequest.index: object expected"); - message.index = $root.google.datastore.admin.v1.Index.fromObject(object.index); - } - return message; - }; + /** + * 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(); + }; - /** - * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {google.datastore.admin.v1.CreateIndexRequest} message CreateIndexRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateIndexRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.index = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.index != null && message.hasOwnProperty("index")) - object.index = $root.google.datastore.admin.v1.Index.toObject(message.index, options); - return object; - }; + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this CreateIndexRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @instance - * @returns {Object.} JSON object - */ - CreateIndexRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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()); + }; - return CreateIndexRequest; - })(); + /** + * 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; + }; - v1.DeleteIndexRequest = (function() { + /** + * 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; + }; - /** - * Properties of a DeleteIndexRequest. - * @memberof google.datastore.admin.v1 - * @interface IDeleteIndexRequest - * @property {string|null} [projectId] DeleteIndexRequest projectId - * @property {string|null} [indexId] DeleteIndexRequest indexId - */ + /** + * 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; + }; - /** - * Constructs a new DeleteIndexRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a DeleteIndexRequest. - * @implements IDeleteIndexRequest - * @constructor - * @param {google.datastore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set - */ - function DeleteIndexRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * 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); + }; - /** - * DeleteIndexRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @instance - */ - DeleteIndexRequest.prototype.projectId = ""; + DescriptorProto.ExtensionRange = (function() { - /** - * DeleteIndexRequest indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @instance - */ - DeleteIndexRequest.prototype.indexId = ""; + /** + * 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 + */ - /** - * Creates a new DeleteIndexRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {google.datastore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest instance - */ - DeleteIndexRequest.create = function create(properties) { - return new DeleteIndexRequest(properties); - }; + /** + * 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]]; + } - /** - * Encodes the specified DeleteIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {google.datastore.admin.v1.IDeleteIndexRequest} message DeleteIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteIndexRequest.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); - return writer; - }; + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; - /** - * Encodes the specified DeleteIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {google.datastore.admin.v1.IDeleteIndexRequest} message DeleteIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; - /** - * Decodes a DeleteIndexRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteIndexRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.DeleteIndexRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; - case 3: - message.indexId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; - /** - * Decodes a DeleteIndexRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteIndexRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies a DeleteIndexRequest message. - * @function verify - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteIndexRequest.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.indexId != null && message.hasOwnProperty("indexId")) - if (!$util.isString(message.indexId)) - return "indexId: string expected"; - return null; - }; + /** + * 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; + }; - /** - * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest - */ - DeleteIndexRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.DeleteIndexRequest) - return object; - var message = new $root.google.datastore.admin.v1.DeleteIndexRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.indexId != null) - message.indexId = String(object.indexId); - return message; - }; + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {google.datastore.admin.v1.DeleteIndexRequest} message DeleteIndexRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteIndexRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.indexId = ""; + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.indexId != null && message.hasOwnProperty("indexId")) - object.indexId = message.indexId; - return object; - }; - - /** - * Converts this DeleteIndexRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteIndexRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + } + return message; + }; - return DeleteIndexRequest; - })(); + /** + * 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()); + }; - v1.GetIndexRequest = (function() { + /** + * 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; + }; - /** - * Properties of a GetIndexRequest. - * @memberof google.datastore.admin.v1 - * @interface IGetIndexRequest - * @property {string|null} [projectId] GetIndexRequest projectId - * @property {string|null} [indexId] GetIndexRequest indexId - */ + /** + * 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; + }; - /** - * Constructs a new GetIndexRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a GetIndexRequest. - * @implements IGetIndexRequest - * @constructor - * @param {google.datastore.admin.v1.IGetIndexRequest=} [properties] Properties to set - */ - function GetIndexRequest(properties) { - if (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 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; + }; - /** - * GetIndexRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.GetIndexRequest - * @instance - */ - GetIndexRequest.prototype.projectId = ""; - - /** - * GetIndexRequest indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.GetIndexRequest - * @instance - */ - GetIndexRequest.prototype.indexId = ""; + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new GetIndexRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {google.datastore.admin.v1.IGetIndexRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest instance - */ - GetIndexRequest.create = function create(properties) { - return new GetIndexRequest(properties); - }; + return ExtensionRange; + })(); - /** - * Encodes the specified GetIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {google.datastore.admin.v1.IGetIndexRequest} message GetIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIndexRequest.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); - return writer; - }; + DescriptorProto.ReservedRange = (function() { - /** - * Encodes the specified GetIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {google.datastore.admin.v1.IGetIndexRequest} message GetIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ - /** - * Decodes a GetIndexRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIndexRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.GetIndexRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; - case 3: - message.indexId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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]]; + } - /** - * Decodes a GetIndexRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIndexRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; - /** - * Verifies a GetIndexRequest message. - * @function verify - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIndexRequest.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.indexId != null && message.hasOwnProperty("indexId")) - if (!$util.isString(message.indexId)) - return "indexId: string expected"; - return null; - }; + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; - /** - * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest - */ - GetIndexRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.GetIndexRequest) - return object; - var message = new $root.google.datastore.admin.v1.GetIndexRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.indexId != null) - message.indexId = String(object.indexId); - return message; - }; + /** + * 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); + }; - /** - * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {google.datastore.admin.v1.GetIndexRequest} message GetIndexRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIndexRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.indexId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.indexId != null && message.hasOwnProperty("indexId")) - object.indexId = message.indexId; - return object; - }; + /** + * 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; + }; - /** - * Converts this GetIndexRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.GetIndexRequest - * @instance - * @returns {Object.} JSON object - */ - GetIndexRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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(); + }; - return GetIndexRequest; - })(); + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - v1.ListIndexesRequest = (function() { + /** + * 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()); + }; - /** - * Properties of a ListIndexesRequest. - * @memberof google.datastore.admin.v1 - * @interface IListIndexesRequest - * @property {string|null} [projectId] ListIndexesRequest projectId - * @property {string|null} [filter] ListIndexesRequest filter - * @property {number|null} [pageSize] ListIndexesRequest pageSize - * @property {string|null} [pageToken] ListIndexesRequest pageToken - */ + /** + * 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; + }; - /** - * Constructs a new ListIndexesRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a ListIndexesRequest. - * @implements IListIndexesRequest - * @constructor - * @param {google.datastore.admin.v1.IListIndexesRequest=} [properties] Properties to set - */ - function ListIndexesRequest(properties) { - if (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 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; + }; - /** - * ListIndexesRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.projectId = ""; + /** + * 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; + }; - /** - * ListIndexesRequest filter. - * @member {string} filter - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.filter = ""; + /** + * 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); + }; - /** - * ListIndexesRequest pageSize. - * @member {number} pageSize - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.pageSize = 0; + return ReservedRange; + })(); - /** - * ListIndexesRequest pageToken. - * @member {string} pageToken - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.pageToken = ""; + return DescriptorProto; + })(); - /** - * Creates a new ListIndexesRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {google.datastore.admin.v1.IListIndexesRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest instance - */ - ListIndexesRequest.create = function create(properties) { - return new ListIndexesRequest(properties); - }; + protobuf.ExtensionRangeOptions = (function() { - /** - * Encodes the specified ListIndexesRequest message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {google.datastore.admin.v1.IListIndexesRequest} message ListIndexesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIndexesRequest.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 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; - }; + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ - /** - * Encodes the specified ListIndexesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {google.datastore.admin.v1.IListIndexesRequest} message ListIndexesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIndexesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a ListIndexesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIndexesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ListIndexesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = 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; - }; + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Decodes a ListIndexesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIndexesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies a ListIndexesRequest message. - * @function verify - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListIndexesRequest.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.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; - }; + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest - */ - ListIndexesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ListIndexesRequest) - return object; - var message = new $root.google.datastore.admin.v1.ListIndexesRequest(); - 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; - }; + /** + * 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(); + }; - /** - * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {google.datastore.admin.v1.ListIndexesRequest} message ListIndexesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListIndexesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - 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; - }; + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this ListIndexesRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - * @returns {Object.} JSON object - */ - ListIndexesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - return ListIndexesRequest; - })(); + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - v1.ListIndexesResponse = (function() { + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * Properties of a ListIndexesResponse. - * @memberof google.datastore.admin.v1 - * @interface IListIndexesResponse - * @property {Array.|null} [indexes] ListIndexesResponse indexes - * @property {string|null} [nextPageToken] ListIndexesResponse nextPageToken - */ + /** + * 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); + }; - /** - * Constructs a new ListIndexesResponse. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a ListIndexesResponse. - * @implements IListIndexesResponse - * @constructor - * @param {google.datastore.admin.v1.IListIndexesResponse=} [properties] Properties to set - */ - function ListIndexesResponse(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]]; - } + return ExtensionRangeOptions; + })(); - /** - * ListIndexesResponse indexes. - * @member {Array.} indexes - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @instance - */ - ListIndexesResponse.prototype.indexes = $util.emptyArray; + protobuf.FieldDescriptorProto = (function() { - /** - * ListIndexesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @instance - */ - ListIndexesResponse.prototype.nextPageToken = ""; + /** + * 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 + */ - /** - * Creates a new ListIndexesResponse instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {google.datastore.admin.v1.IListIndexesResponse=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse instance - */ - ListIndexesResponse.create = function create(properties) { - return new ListIndexesResponse(properties); - }; + /** + * 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]]; + } - /** - * Encodes the specified ListIndexesResponse message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {google.datastore.admin.v1.IListIndexesResponse} message ListIndexesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIndexesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.indexes != null && message.indexes.length) - for (var i = 0; i < message.indexes.length; ++i) - $root.google.datastore.admin.v1.Index.encode(message.indexes[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; - }; + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; - /** - * Encodes the specified ListIndexesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {google.datastore.admin.v1.IListIndexesResponse} message ListIndexesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIndexesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; - /** - * Decodes a ListIndexesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIndexesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ListIndexesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.indexes && message.indexes.length)) - message.indexes = []; - message.indexes.push($root.google.datastore.admin.v1.Index.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; - /** - * Decodes a ListIndexesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIndexesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 = ""; - /** - * Verifies a ListIndexesResponse message. - * @function verify - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListIndexesResponse.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) { - var error = $root.google.datastore.admin.v1.Index.verify(message.indexes[i]); - if (error) - return "indexes." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; - /** - * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse - */ - ListIndexesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ListIndexesResponse) - return object; - var message = new $root.google.datastore.admin.v1.ListIndexesResponse(); - if (object.indexes) { - if (!Array.isArray(object.indexes)) - throw TypeError(".google.datastore.admin.v1.ListIndexesResponse.indexes: array expected"); - message.indexes = []; - for (var i = 0; i < object.indexes.length; ++i) { - if (typeof object.indexes[i] !== "object") - throw TypeError(".google.datastore.admin.v1.ListIndexesResponse.indexes: object expected"); - message.indexes[i] = $root.google.datastore.admin.v1.Index.fromObject(object.indexes[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; - /** - * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {google.datastore.admin.v1.ListIndexesResponse} message ListIndexesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListIndexesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexes = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.indexes && message.indexes.length) { - object.indexes = []; - for (var j = 0; j < message.indexes.length; ++j) - object.indexes[j] = $root.google.datastore.admin.v1.Index.toObject(message.indexes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; - /** - * Converts this ListIndexesResponse to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @instance - * @returns {Object.} JSON object - */ - ListIndexesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; - return ListIndexesResponse; - })(); + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; - v1.IndexOperationMetadata = (function() { + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; - /** - * Properties of an IndexOperationMetadata. - * @memberof google.datastore.admin.v1 - * @interface IIndexOperationMetadata - * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] IndexOperationMetadata common - * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] IndexOperationMetadata progressEntities - * @property {string|null} [indexId] IndexOperationMetadata indexId - */ + /** + * 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); + }; - /** - * Constructs a new IndexOperationMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an IndexOperationMetadata. - * @implements IIndexOperationMetadata - * @constructor - * @param {google.datastore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set - */ - function IndexOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * IndexOperationMetadata common. - * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.common = null; - - /** - * IndexOperationMetadata progressEntities. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.progressEntities = null; - - /** - * IndexOperationMetadata indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.indexId = ""; - - /** - * Creates a new IndexOperationMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {google.datastore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata instance - */ - IndexOperationMetadata.create = function create(properties) { - return new IndexOperationMetadata(properties); - }; + /** + * 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()); + }; - /** - * Encodes the specified IndexOperationMetadata message. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {google.datastore.admin.v1.IIndexOperationMetadata} message IndexOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) - $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.indexId != null && Object.hasOwnProperty.call(message, "indexId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); - return writer; - }; + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; - /** - * Encodes the specified IndexOperationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {google.datastore.admin.v1.IIndexOperationMetadata} message IndexOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; - /** - * Decodes an IndexOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexOperationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.IndexOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); - break; - case 2: - message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 3: - message.indexId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; - /** - * Decodes an IndexOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies an IndexOperationMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndexOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); - if (error) - return "common." + error; - } - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); - if (error) - return "progressEntities." + error; - } - if (message.indexId != null && message.hasOwnProperty("indexId")) - if (!$util.isString(message.indexId)) - return "indexId: string expected"; - return null; - }; + /** + * 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; + })(); - /** - * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata - */ - IndexOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.IndexOperationMetadata) - return object; - var message = new $root.google.datastore.admin.v1.IndexOperationMetadata(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.datastore.admin.v1.IndexOperationMetadata.common: object expected"); - message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); - } - if (object.progressEntities != null) { - if (typeof object.progressEntities !== "object") - throw TypeError(".google.datastore.admin.v1.IndexOperationMetadata.progressEntities: object expected"); - message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); - } - if (object.indexId != null) - message.indexId = String(object.indexId); - return message; - }; + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); - /** - * Creates a plain object from an IndexOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {google.datastore.admin.v1.IndexOperationMetadata} message IndexOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndexOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.common = null; - object.progressEntities = null; - object.indexId = ""; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) - object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); - if (message.indexId != null && message.hasOwnProperty("indexId")) - object.indexId = message.indexId; - return object; - }; + return FieldDescriptorProto; + })(); - /** - * Converts this IndexOperationMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - IndexOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + protobuf.OneofDescriptorProto = (function() { - return IndexOperationMetadata; - })(); + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ - v1.DatastoreFirestoreMigrationMetadata = (function() { + /** + * 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]]; + } - /** - * Properties of a DatastoreFirestoreMigrationMetadata. - * @memberof google.datastore.admin.v1 - * @interface IDatastoreFirestoreMigrationMetadata - * @property {google.datastore.admin.v1.MigrationState|null} [migrationState] DatastoreFirestoreMigrationMetadata migrationState - * @property {google.datastore.admin.v1.MigrationStep|null} [migrationStep] DatastoreFirestoreMigrationMetadata migrationStep - */ + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; - /** - * Constructs a new DatastoreFirestoreMigrationMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a DatastoreFirestoreMigrationMetadata. - * @implements IDatastoreFirestoreMigrationMetadata - * @constructor - * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata=} [properties] Properties to set - */ - function DatastoreFirestoreMigrationMetadata(properties) { - if (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 options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; - /** - * DatastoreFirestoreMigrationMetadata migrationState. - * @member {google.datastore.admin.v1.MigrationState} migrationState - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @instance - */ - DatastoreFirestoreMigrationMetadata.prototype.migrationState = 0; + /** + * 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); + }; - /** - * DatastoreFirestoreMigrationMetadata migrationStep. - * @member {google.datastore.admin.v1.MigrationStep} migrationStep - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @instance - */ - DatastoreFirestoreMigrationMetadata.prototype.migrationStep = 0; + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Creates a new DatastoreFirestoreMigrationMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata instance - */ - DatastoreFirestoreMigrationMetadata.create = function create(properties) { - return new DatastoreFirestoreMigrationMetadata(properties); - }; + /** + * 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(); + }; - /** - * Encodes the specified DatastoreFirestoreMigrationMetadata message. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatastoreFirestoreMigrationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.migrationState != null && Object.hasOwnProperty.call(message, "migrationState")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.migrationState); - if (message.migrationStep != null && Object.hasOwnProperty.call(message, "migrationStep")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.migrationStep); - return writer; - }; + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; - /** - * Encodes the specified DatastoreFirestoreMigrationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatastoreFirestoreMigrationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + }; - /** - * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatastoreFirestoreMigrationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.migrationState = reader.int32(); - break; - case 2: - message.migrationStep = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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; + }; - /** - * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatastoreFirestoreMigrationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies a DatastoreFirestoreMigrationMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DatastoreFirestoreMigrationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.migrationState != null && message.hasOwnProperty("migrationState")) - switch (message.migrationState) { - default: - return "migrationState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) - switch (message.migrationStep) { - default: - return "migrationStep: enum value expected"; - case 0: - case 6: - case 1: - case 7: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; + return OneofDescriptorProto; + })(); - /** - * Creates a DatastoreFirestoreMigrationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata - */ - DatastoreFirestoreMigrationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) - return object; - var message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); - switch (object.migrationState) { - case "MIGRATION_STATE_UNSPECIFIED": - case 0: - message.migrationState = 0; - break; - case "RUNNING": - case 1: - message.migrationState = 1; - break; - case "PAUSED": - case 2: - message.migrationState = 2; - break; - case "COMPLETE": - case 3: - message.migrationState = 3; - break; - } - switch (object.migrationStep) { - case "MIGRATION_STEP_UNSPECIFIED": - case 0: - message.migrationStep = 0; - break; - case "PREPARE": - case 6: - message.migrationStep = 6; - break; - case "START": - case 1: - message.migrationStep = 1; - break; - case "APPLY_WRITES_SYNCHRONOUSLY": - case 7: - message.migrationStep = 7; - break; - case "COPY_AND_VERIFY": - case 2: - message.migrationStep = 2; - break; - case "REDIRECT_EVENTUALLY_CONSISTENT_READS": - case 3: - message.migrationStep = 3; - break; - case "REDIRECT_STRONGLY_CONSISTENT_READS": - case 4: - message.migrationStep = 4; - break; - case "REDIRECT_WRITES": - case 5: - message.migrationStep = 5; - break; - } - return message; - }; + protobuf.EnumDescriptorProto = (function() { - /** - * Creates a plain object from a DatastoreFirestoreMigrationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DatastoreFirestoreMigrationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.migrationState = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; - object.migrationStep = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; - } - if (message.migrationState != null && message.hasOwnProperty("migrationState")) - object.migrationState = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.migrationState] : message.migrationState; - if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) - object.migrationStep = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] : message.migrationStep; - return object; - }; + /** + * 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]]; + } - /** - * Converts this DatastoreFirestoreMigrationMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @instance - * @returns {Object.} JSON object - */ - DatastoreFirestoreMigrationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; - return DatastoreFirestoreMigrationMetadata; - })(); + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; - /** - * OperationType enum. - * @name google.datastore.admin.v1.OperationType - * @enum {number} - * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value - * @property {number} EXPORT_ENTITIES=1 EXPORT_ENTITIES value - * @property {number} IMPORT_ENTITIES=2 IMPORT_ENTITIES value - * @property {number} CREATE_INDEX=3 CREATE_INDEX value - * @property {number} DELETE_INDEX=4 DELETE_INDEX value - */ - v1.OperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXPORT_ENTITIES"] = 1; - values[valuesById[2] = "IMPORT_ENTITIES"] = 2; - values[valuesById[3] = "CREATE_INDEX"] = 3; - values[valuesById[4] = "DELETE_INDEX"] = 4; - return values; - })(); + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; - v1.Index = (function() { + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - /** - * Properties of an Index. - * @memberof google.datastore.admin.v1 - * @interface IIndex - * @property {string|null} [projectId] Index projectId - * @property {string|null} [indexId] Index indexId - * @property {string|null} [kind] Index kind - * @property {google.datastore.admin.v1.Index.AncestorMode|null} [ancestor] Index ancestor - * @property {Array.|null} [properties] Index properties - * @property {google.datastore.admin.v1.Index.State|null} [state] Index state - */ + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - /** - * Constructs a new Index. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an Index. - * @implements IIndex - * @constructor - * @param {google.datastore.admin.v1.IIndex=} [properties] Properties to set - */ - function Index(properties) { - this.properties = []; - if (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 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); + }; - /** - * Index projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.projectId = ""; + /** + * 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; + }; - /** - * Index indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.indexId = ""; + /** + * 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(); + }; - /** - * Index kind. - * @member {string} kind - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.kind = ""; + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Index ancestor. - * @member {google.datastore.admin.v1.Index.AncestorMode} ancestor - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.ancestor = 0; + /** + * 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()); + }; - /** - * Index properties. - * @member {Array.} properties - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.properties = $util.emptyArray; + /** + * 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; + }; - /** - * Index state. - * @member {google.datastore.admin.v1.Index.State} state - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.state = 0; + /** + * 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 new Index instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.Index - * @static - * @param {google.datastore.admin.v1.IIndex=} [properties] Properties to set - * @returns {google.datastore.admin.v1.Index} Index instance - */ - Index.create = function create(properties) { - return new Index(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified Index message. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.Index - * @static - * @param {google.datastore.admin.v1.IIndex} message Index message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Index.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.kind); - if (message.ancestor != null && Object.hasOwnProperty.call(message, "ancestor")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ancestor); - if (message.properties != null && message.properties.length) - for (var i = 0; i < message.properties.length; ++i) - $root.google.datastore.admin.v1.Index.IndexedProperty.encode(message.properties[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - return writer; - }; + /** + * 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); + }; - /** - * Encodes the specified Index message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.Index - * @static - * @param {google.datastore.admin.v1.IIndex} message Index message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Index.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + EnumDescriptorProto.EnumReservedRange = (function() { - /** - * Decodes an Index message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.Index - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.Index} Index - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Index.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Index(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; - case 3: - message.indexId = reader.string(); - break; - case 4: - message.kind = reader.string(); - break; - case 5: - message.ancestor = reader.int32(); - break; - case 6: - if (!(message.properties && message.properties.length)) - message.properties = []; - message.properties.push($root.google.datastore.admin.v1.Index.IndexedProperty.decode(reader, reader.uint32())); - break; - case 7: - message.state = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ - /** - * Decodes an Index message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.Index - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.Index} Index - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Index.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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]]; + } - /** - * Verifies an Index message. - * @function verify - * @memberof google.datastore.admin.v1.Index - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Index.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.indexId != null && message.hasOwnProperty("indexId")) - if (!$util.isString(message.indexId)) - return "indexId: string expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.ancestor != null && message.hasOwnProperty("ancestor")) - switch (message.ancestor) { - default: - return "ancestor: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!Array.isArray(message.properties)) - return "properties: array expected"; - for (var i = 0; i < message.properties.length; ++i) { - var error = $root.google.datastore.admin.v1.Index.IndexedProperty.verify(message.properties[i]); - if (error) - return "properties." + error; - } - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; - /** - * Creates an Index message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.Index - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.Index} Index - */ - Index.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.Index) - return object; - var message = new $root.google.datastore.admin.v1.Index(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.indexId != null) - message.indexId = String(object.indexId); - if (object.kind != null) - message.kind = String(object.kind); - switch (object.ancestor) { - case "ANCESTOR_MODE_UNSPECIFIED": - case 0: - message.ancestor = 0; - break; - case "NONE": - case 1: - message.ancestor = 1; - break; - case "ALL_ANCESTORS": - case 2: - message.ancestor = 2; - break; - } - if (object.properties) { - if (!Array.isArray(object.properties)) - throw TypeError(".google.datastore.admin.v1.Index.properties: array expected"); - message.properties = []; - for (var i = 0; i < object.properties.length; ++i) { - if (typeof object.properties[i] !== "object") - throw TypeError(".google.datastore.admin.v1.Index.properties: object expected"); - message.properties[i] = $root.google.datastore.admin.v1.Index.IndexedProperty.fromObject(object.properties[i]); - } - } - switch (object.state) { - 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 "DELETING": - case 3: - message.state = 3; - break; - case "ERROR": - case 4: - message.state = 4; - break; - } - return message; - }; + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; - /** - * Creates a plain object from an Index message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.Index - * @static - * @param {google.datastore.admin.v1.Index} message Index - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Index.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.properties = []; - if (options.defaults) { - object.projectId = ""; - object.indexId = ""; - object.kind = ""; - object.ancestor = options.enums === String ? "ANCESTOR_MODE_UNSPECIFIED" : 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.indexId != null && message.hasOwnProperty("indexId")) - object.indexId = message.indexId; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.ancestor != null && message.hasOwnProperty("ancestor")) - object.ancestor = options.enums === String ? $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] : message.ancestor; - if (message.properties && message.properties.length) { - object.properties = []; - for (var j = 0; j < message.properties.length; ++j) - object.properties[j] = $root.google.datastore.admin.v1.Index.IndexedProperty.toObject(message.properties[j], options); + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.Index.State[message.state] : message.state; + } + 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; + }; - /** - * Converts this Index to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.Index - * @instance - * @returns {Object.} JSON object - */ - Index.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - /** - * AncestorMode enum. - * @name google.datastore.admin.v1.Index.AncestorMode - * @enum {number} - * @property {number} ANCESTOR_MODE_UNSPECIFIED=0 ANCESTOR_MODE_UNSPECIFIED value - * @property {number} NONE=1 NONE value - * @property {number} ALL_ANCESTORS=2 ALL_ANCESTORS value - */ - Index.AncestorMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ANCESTOR_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NONE"] = 1; - values[valuesById[2] = "ALL_ANCESTORS"] = 2; - return values; - })(); + /** + * 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); + }; - /** - * Direction enum. - * @name google.datastore.admin.v1.Index.Direction - * @enum {number} - * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value - * @property {number} ASCENDING=1 ASCENDING value - * @property {number} DESCENDING=2 DESCENDING value - */ - Index.Direction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ASCENDING"] = 1; - values[valuesById[2] = "DESCENDING"] = 2; - return values; - })(); + return EnumReservedRange; + })(); - Index.IndexedProperty = (function() { + return EnumDescriptorProto; + })(); - /** - * Properties of an IndexedProperty. - * @memberof google.datastore.admin.v1.Index - * @interface IIndexedProperty - * @property {string|null} [name] IndexedProperty name - * @property {google.datastore.admin.v1.Index.Direction|null} [direction] IndexedProperty direction - */ + protobuf.EnumValueDescriptorProto = (function() { - /** - * Constructs a new IndexedProperty. - * @memberof google.datastore.admin.v1.Index - * @classdesc Represents an IndexedProperty. - * @implements IIndexedProperty - * @constructor - * @param {google.datastore.admin.v1.Index.IIndexedProperty=} [properties] Properties to set - */ - function IndexedProperty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an 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 + */ - /** - * IndexedProperty name. - * @member {string} name - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @instance - */ - IndexedProperty.prototype.name = ""; + /** + * 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]]; + } - /** - * IndexedProperty direction. - * @member {google.datastore.admin.v1.Index.Direction} direction - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @instance - */ - IndexedProperty.prototype.direction = 0; + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; - /** - * Creates a new IndexedProperty instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {google.datastore.admin.v1.Index.IIndexedProperty=} [properties] Properties to set - * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty instance - */ - IndexedProperty.create = function create(properties) { - return new IndexedProperty(properties); - }; + /** + * 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 IndexedProperty message. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {google.datastore.admin.v1.Index.IIndexedProperty} message IndexedProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexedProperty.encode = function encode(message, writer) { - 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.direction != null && Object.hasOwnProperty.call(message, "direction")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); - 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(); + }; - /** - * Encodes the specified IndexedProperty message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {google.datastore.admin.v1.Index.IIndexedProperty} message IndexedProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexedProperty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an IndexedProperty message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexedProperty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Index.IndexedProperty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.direction = reader.int32(); - 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()); + }; - /** - * Decodes an IndexedProperty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexedProperty.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; + }; - /** - * Verifies an IndexedProperty message. - * @function verify - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndexedProperty.verify = function verify(message) { - if (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.direction != null && message.hasOwnProperty("direction")) - switch (message.direction) { - default: - return "direction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - 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 an IndexedProperty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty - */ - IndexedProperty.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.Index.IndexedProperty) - return object; - var message = new $root.google.datastore.admin.v1.Index.IndexedProperty(); - if (object.name != null) - message.name = String(object.name); - switch (object.direction) { - case "DIRECTION_UNSPECIFIED": - case 0: - message.direction = 0; - break; - case "ASCENDING": - case 1: - message.direction = 1; - break; - case "DESCENDING": - case 2: - message.direction = 2; - break; - } - 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; + }; - /** - * Creates a plain object from an IndexedProperty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {google.datastore.admin.v1.Index.IndexedProperty} message IndexedProperty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndexedProperty.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.datastore.admin.v1.Index.Direction[message.direction] : message.direction; - 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); + }; - /** - * Converts this IndexedProperty to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @instance - * @returns {Object.} JSON object - */ - IndexedProperty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return EnumValueDescriptorProto; + })(); - return IndexedProperty; - })(); + protobuf.ServiceDescriptorProto = (function() { - /** - * State enum. - * @name google.datastore.admin.v1.Index.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} DELETING=3 DELETING value - * @property {number} ERROR=4 ERROR value - */ - Index.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] = "DELETING"] = 3; - values[valuesById[4] = "ERROR"] = 4; - return values; - })(); + /** + * 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 + */ - return Index; - })(); + /** + * 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]]; + } - v1.MigrationStateEvent = (function() { + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; - /** - * Properties of a MigrationStateEvent. - * @memberof google.datastore.admin.v1 - * @interface IMigrationStateEvent - * @property {google.datastore.admin.v1.MigrationState|null} [state] MigrationStateEvent state - */ + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; - /** - * Constructs a new MigrationStateEvent. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a MigrationStateEvent. - * @implements IMigrationStateEvent - * @constructor - * @param {google.datastore.admin.v1.IMigrationStateEvent=} [properties] Properties to set - */ - function MigrationStateEvent(properties) { - if (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 options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; - /** - * MigrationStateEvent state. - * @member {google.datastore.admin.v1.MigrationState} state - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @instance - */ - MigrationStateEvent.prototype.state = 0; + /** + * 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); + }; - /** - * Creates a new MigrationStateEvent instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {google.datastore.admin.v1.IMigrationStateEvent=} [properties] Properties to set - * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent instance - */ - MigrationStateEvent.create = function create(properties) { - return new MigrationStateEvent(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 MigrationStateEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {google.datastore.admin.v1.IMigrationStateEvent} message MigrationStateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationStateEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - 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(); + }; - /** - * Encodes the specified MigrationStateEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {google.datastore.admin.v1.IMigrationStateEvent} message MigrationStateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationStateEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a MigrationStateEvent message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationStateEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationStateEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - 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()); + }; - /** - * Decodes a MigrationStateEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationStateEvent.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; + }; - /** - * Verifies a MigrationStateEvent message. - * @function verify - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MigrationStateEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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; - } - 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 MigrationStateEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent - */ - MigrationStateEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.MigrationStateEvent) - return object; - var message = new $root.google.datastore.admin.v1.MigrationStateEvent(); - switch (object.state) { - case "MIGRATION_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RUNNING": - case 1: - message.state = 1; - break; - case "PAUSED": - case 2: - message.state = 2; - break; - case "COMPLETE": - case 3: - message.state = 3; - break; - } - 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; + }; - /** - * Creates a plain object from a MigrationStateEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {google.datastore.admin.v1.MigrationStateEvent} message MigrationStateEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MigrationStateEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.state = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.state] : message.state; - 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); + }; - /** - * Converts this MigrationStateEvent to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @instance - * @returns {Object.} JSON object - */ - MigrationStateEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return ServiceDescriptorProto; + })(); - return MigrationStateEvent; - })(); + protobuf.MethodDescriptorProto = (function() { - v1.MigrationProgressEvent = (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 + */ - /** - * Properties of a MigrationProgressEvent. - * @memberof google.datastore.admin.v1 - * @interface IMigrationProgressEvent - * @property {google.datastore.admin.v1.MigrationStep|null} [step] MigrationProgressEvent step - * @property {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null} [prepareStepDetails] MigrationProgressEvent prepareStepDetails - * @property {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null} [redirectWritesStepDetails] MigrationProgressEvent redirectWritesStepDetails - */ + /** + * 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]]; + } - /** - * Constructs a new MigrationProgressEvent. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a MigrationProgressEvent. - * @implements IMigrationProgressEvent - * @constructor - * @param {google.datastore.admin.v1.IMigrationProgressEvent=} [properties] Properties to set - */ - function MigrationProgressEvent(properties) { - if (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 = ""; - /** - * MigrationProgressEvent step. - * @member {google.datastore.admin.v1.MigrationStep} step - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - */ - MigrationProgressEvent.prototype.step = 0; + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; - /** - * MigrationProgressEvent prepareStepDetails. - * @member {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null|undefined} prepareStepDetails - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - */ - MigrationProgressEvent.prototype.prepareStepDetails = null; + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; - /** - * MigrationProgressEvent redirectWritesStepDetails. - * @member {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null|undefined} redirectWritesStepDetails - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - */ - MigrationProgressEvent.prototype.redirectWritesStepDetails = null; + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; - /** - * MigrationProgressEvent stepDetails. - * @member {"prepareStepDetails"|"redirectWritesStepDetails"|undefined} stepDetails - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - */ - Object.defineProperty(MigrationProgressEvent.prototype, "stepDetails", { - get: $util.oneOfGetter($oneOfFields = ["prepareStepDetails", "redirectWritesStepDetails"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; - /** - * Creates a new MigrationProgressEvent instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {google.datastore.admin.v1.IMigrationProgressEvent=} [properties] Properties to set - * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent instance - */ - MigrationProgressEvent.create = function create(properties) { - return new MigrationProgressEvent(properties); - }; + /** + * 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 MigrationProgressEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {google.datastore.admin.v1.IMigrationProgressEvent} message MigrationProgressEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationProgressEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.step != null && Object.hasOwnProperty.call(message, "step")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.step); - if (message.prepareStepDetails != null && Object.hasOwnProperty.call(message, "prepareStepDetails")) - $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.encode(message.prepareStepDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.redirectWritesStepDetails != null && Object.hasOwnProperty.call(message, "redirectWritesStepDetails")) - $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.encode(message.redirectWritesStepDetails, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * 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 MigrationProgressEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {google.datastore.admin.v1.IMigrationProgressEvent} message MigrationProgressEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationProgressEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a MigrationProgressEvent message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationProgressEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.step = reader.int32(); - break; - case 2: - message.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.decode(reader, reader.uint32()); - break; - case 3: - message.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.decode(reader, reader.uint32()); - 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()); + }; - /** - * Decodes a MigrationProgressEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationProgressEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; - /** - * Verifies a MigrationProgressEvent message. - * @function verify - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MigrationProgressEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.step != null && message.hasOwnProperty("step")) - switch (message.step) { - default: - return "step: enum value expected"; - case 0: - case 6: - case 1: - case 7: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { - properties.stepDetails = 1; - { - var error = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify(message.prepareStepDetails); - if (error) - return "prepareStepDetails." + error; - } - } - if (message.redirectWritesStepDetails != null && message.hasOwnProperty("redirectWritesStepDetails")) { - if (properties.stepDetails === 1) - return "stepDetails: multiple values"; - properties.stepDetails = 1; - { - var error = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify(message.redirectWritesStepDetails); - if (error) - return "redirectWritesStepDetails." + error; - } - } - 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 MigrationProgressEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent - */ - MigrationProgressEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent) - return object; - var message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); - switch (object.step) { - case "MIGRATION_STEP_UNSPECIFIED": - case 0: - message.step = 0; - break; - case "PREPARE": - case 6: - message.step = 6; - break; - case "START": - case 1: - message.step = 1; - break; - case "APPLY_WRITES_SYNCHRONOUSLY": - case 7: - message.step = 7; - break; - case "COPY_AND_VERIFY": - case 2: - message.step = 2; - break; - case "REDIRECT_EVENTUALLY_CONSISTENT_READS": - case 3: - message.step = 3; - break; - case "REDIRECT_STRONGLY_CONSISTENT_READS": - case 4: - message.step = 4; - break; - case "REDIRECT_WRITES": - case 5: - message.step = 5; - break; - } - if (object.prepareStepDetails != null) { - if (typeof object.prepareStepDetails !== "object") - throw TypeError(".google.datastore.admin.v1.MigrationProgressEvent.prepareStepDetails: object expected"); - message.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.fromObject(object.prepareStepDetails); - } - if (object.redirectWritesStepDetails != null) { - if (typeof object.redirectWritesStepDetails !== "object") - throw TypeError(".google.datastore.admin.v1.MigrationProgressEvent.redirectWritesStepDetails: object expected"); - message.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.fromObject(object.redirectWritesStepDetails); - } - 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; + }; - /** - * Creates a plain object from a MigrationProgressEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent} message MigrationProgressEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MigrationProgressEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.step = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; - if (message.step != null && message.hasOwnProperty("step")) - object.step = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.step] : message.step; - if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { - object.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.toObject(message.prepareStepDetails, options); - if (options.oneofs) - object.stepDetails = "prepareStepDetails"; - } - if (message.redirectWritesStepDetails != null && message.hasOwnProperty("redirectWritesStepDetails")) { - object.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.toObject(message.redirectWritesStepDetails, options); - if (options.oneofs) - object.stepDetails = "redirectWritesStepDetails"; - } - 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); + }; - /** - * Converts this MigrationProgressEvent to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - * @returns {Object.} JSON object - */ - MigrationProgressEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return MethodDescriptorProto; + })(); - /** - * ConcurrencyMode enum. - * @name google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode - * @enum {number} - * @property {number} CONCURRENCY_MODE_UNSPECIFIED=0 CONCURRENCY_MODE_UNSPECIFIED value - * @property {number} PESSIMISTIC=1 PESSIMISTIC value - * @property {number} OPTIMISTIC=2 OPTIMISTIC value - * @property {number} OPTIMISTIC_WITH_ENTITY_GROUPS=3 OPTIMISTIC_WITH_ENTITY_GROUPS value - */ - MigrationProgressEvent.ConcurrencyMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONCURRENCY_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PESSIMISTIC"] = 1; - values[valuesById[2] = "OPTIMISTIC"] = 2; - values[valuesById[3] = "OPTIMISTIC_WITH_ENTITY_GROUPS"] = 3; - return values; - })(); + protobuf.FileOptions = (function() { - MigrationProgressEvent.PrepareStepDetails = (function() { + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ - /** - * Properties of a PrepareStepDetails. - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @interface IPrepareStepDetails - * @property {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null} [concurrencyMode] PrepareStepDetails concurrencyMode - */ + /** + * 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]]; + } - /** - * Constructs a new PrepareStepDetails. - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @classdesc Represents a PrepareStepDetails. - * @implements IPrepareStepDetails - * @constructor - * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails=} [properties] Properties to set - */ - function PrepareStepDetails(properties) { - if (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 = ""; - /** - * PrepareStepDetails concurrencyMode. - * @member {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} concurrencyMode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @instance - */ - PrepareStepDetails.prototype.concurrencyMode = 0; + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; - /** - * Creates a new PrepareStepDetails instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails=} [properties] Properties to set - * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails instance - */ - PrepareStepDetails.create = function create(properties) { - return new PrepareStepDetails(properties); - }; + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; - /** - * Encodes the specified PrepareStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails} message PrepareStepDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrepareStepDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.concurrencyMode != null && Object.hasOwnProperty.call(message, "concurrencyMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.concurrencyMode); - return writer; - }; + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; - /** - * Encodes the specified PrepareStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails} message PrepareStepDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrepareStepDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 = ""; - /** - * Decodes a PrepareStepDetails message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrepareStepDetails.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.concurrencyMode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; - /** - * Decodes a PrepareStepDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrepareStepDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; - /** - * Verifies a PrepareStepDetails message. - * @function verify - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PrepareStepDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - switch (message.concurrencyMode) { - default: - return "concurrencyMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; - /** - * Creates a PrepareStepDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails - */ - PrepareStepDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) - return object; - var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); - switch (object.concurrencyMode) { - case "CONCURRENCY_MODE_UNSPECIFIED": - case 0: - message.concurrencyMode = 0; - break; - case "PESSIMISTIC": - case 1: - message.concurrencyMode = 1; - break; - case "OPTIMISTIC": - case 2: - message.concurrencyMode = 2; - break; - case "OPTIMISTIC_WITH_ENTITY_GROUPS": - case 3: - message.concurrencyMode = 3; - break; - } - return message; - }; + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; - /** - * Creates a plain object from a PrepareStepDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} message PrepareStepDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PrepareStepDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; - if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; - return object; - }; + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; - /** - * Converts this PrepareStepDetails to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @instance - * @returns {Object.} JSON object - */ - PrepareStepDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; - return PrepareStepDetails; - })(); + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; - MigrationProgressEvent.RedirectWritesStepDetails = (function() { + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; - /** - * Properties of a RedirectWritesStepDetails. - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @interface IRedirectWritesStepDetails - * @property {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null} [concurrencyMode] RedirectWritesStepDetails concurrencyMode - */ + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; - /** - * Constructs a new RedirectWritesStepDetails. - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @classdesc Represents a RedirectWritesStepDetails. - * @implements IRedirectWritesStepDetails - * @constructor - * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails=} [properties] Properties to set - */ - function RedirectWritesStepDetails(properties) { - if (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 phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; - /** - * RedirectWritesStepDetails concurrencyMode. - * @member {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} concurrencyMode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @instance - */ - RedirectWritesStepDetails.prototype.concurrencyMode = 0; + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; - /** - * Creates a new RedirectWritesStepDetails instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails=} [properties] Properties to set - * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails instance - */ - RedirectWritesStepDetails.create = function create(properties) { - return new RedirectWritesStepDetails(properties); - }; + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; - /** - * Encodes the specified RedirectWritesStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails} message RedirectWritesStepDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedirectWritesStepDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.concurrencyMode != null && Object.hasOwnProperty.call(message, "concurrencyMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.concurrencyMode); - return writer; - }; + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; - /** - * Encodes the specified RedirectWritesStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails} message RedirectWritesStepDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedirectWritesStepDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Decodes a RedirectWritesStepDetails message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedirectWritesStepDetails.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.concurrencyMode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; - /** - * Decodes a RedirectWritesStepDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedirectWritesStepDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies a RedirectWritesStepDetails message. - * @function verify - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RedirectWritesStepDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - switch (message.concurrencyMode) { - default: - return "concurrencyMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + /** + * 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; - /** - * Creates a RedirectWritesStepDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails - */ - RedirectWritesStepDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) - return object; - var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); - switch (object.concurrencyMode) { - case "CONCURRENCY_MODE_UNSPECIFIED": - case 0: - message.concurrencyMode = 0; - break; - case "PESSIMISTIC": - case 1: - message.concurrencyMode = 1; - break; - case "OPTIMISTIC": - case 2: - message.concurrencyMode = 2; - break; - case "OPTIMISTIC_WITH_ENTITY_GROUPS": - case 3: - message.concurrencyMode = 3; - break; - } - return message; - }; + /** + * 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(); + }; - /** - * Creates a plain object from a RedirectWritesStepDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} message RedirectWritesStepDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RedirectWritesStepDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; - if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; - return object; - }; + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this RedirectWritesStepDetails to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @instance - * @returns {Object.} JSON object - */ - RedirectWritesStepDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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()); + }; - return RedirectWritesStepDetails; - })(); + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; - return MigrationProgressEvent; - })(); + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; - /** - * MigrationState enum. - * @name google.datastore.admin.v1.MigrationState - * @enum {number} - * @property {number} MIGRATION_STATE_UNSPECIFIED=0 MIGRATION_STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} PAUSED=2 PAUSED value - * @property {number} COMPLETE=3 COMPLETE value - */ - v1.MigrationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MIGRATION_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "PAUSED"] = 2; - values[valuesById[3] = "COMPLETE"] = 3; - return values; - })(); + /** + * 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.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; - /** - * MigrationStep enum. - * @name google.datastore.admin.v1.MigrationStep - * @enum {number} - * @property {number} MIGRATION_STEP_UNSPECIFIED=0 MIGRATION_STEP_UNSPECIFIED value - * @property {number} PREPARE=6 PREPARE value - * @property {number} START=1 START value - * @property {number} APPLY_WRITES_SYNCHRONOUSLY=7 APPLY_WRITES_SYNCHRONOUSLY value - * @property {number} COPY_AND_VERIFY=2 COPY_AND_VERIFY value - * @property {number} REDIRECT_EVENTUALLY_CONSISTENT_READS=3 REDIRECT_EVENTUALLY_CONSISTENT_READS value - * @property {number} REDIRECT_STRONGLY_CONSISTENT_READS=4 REDIRECT_STRONGLY_CONSISTENT_READS value - * @property {number} REDIRECT_WRITES=5 REDIRECT_WRITES value - */ - v1.MigrationStep = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MIGRATION_STEP_UNSPECIFIED"] = 0; - values[valuesById[6] = "PREPARE"] = 6; - values[valuesById[1] = "START"] = 1; - values[valuesById[7] = "APPLY_WRITES_SYNCHRONOUSLY"] = 7; - values[valuesById[2] = "COPY_AND_VERIFY"] = 2; - values[valuesById[3] = "REDIRECT_EVENTUALLY_CONSISTENT_READS"] = 3; - values[valuesById[4] = "REDIRECT_STRONGLY_CONSISTENT_READS"] = 4; - values[valuesById[5] = "REDIRECT_WRITES"] = 5; - return values; - })(); + /** + * 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); + }; - return v1; + /** + * 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 admin; + return FileOptions; })(); - datastore.v1 = (function() { + protobuf.MessageOptions = (function() { /** - * Namespace v1. - * @memberof google.datastore - * @namespace + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource */ - var v1 = {}; - - v1.Datastore = (function() { - - /** - * Constructs a new Datastore service. - * @memberof google.datastore.v1 - * @classdesc Represents a Datastore - * @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 Datastore(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - (Datastore.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Datastore; + /** + * 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]]; + } - /** - * Creates new Datastore service using the specified rpc implementation. - * @function create - * @memberof google.datastore.v1.Datastore - * @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 {Datastore} RPC service. Useful where requests and/or responses are streamed. - */ - Datastore.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; - /** - * Callback as used by {@link google.datastore.v1.Datastore#lookup}. - * @memberof google.datastore.v1.Datastore - * @typedef LookupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.LookupResponse} [response] LookupResponse - */ + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; - /** - * Calls Lookup. - * @function lookup - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.ILookupRequest} request LookupRequest message or plain object - * @param {google.datastore.v1.Datastore.LookupCallback} callback Node-style callback called with the error, if any, and LookupResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Datastore.prototype.lookup = function lookup(request, callback) { - return this.rpcCall(lookup, $root.google.datastore.v1.LookupRequest, $root.google.datastore.v1.LookupResponse, request, callback); - }, "name", { value: "Lookup" }); + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; - /** - * Calls Lookup. - * @function lookup - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.ILookupRequest} request LookupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; - /** - * Callback as used by {@link google.datastore.v1.Datastore#runQuery}. - * @memberof google.datastore.v1.Datastore - * @typedef RunQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.RunQueryResponse} [response] RunQueryResponse - */ + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Calls RunQuery. - * @function runQuery - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IRunQueryRequest} request RunQueryRequest message or plain object - * @param {google.datastore.v1.Datastore.RunQueryCallback} callback Node-style callback called with the error, if any, and RunQueryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Datastore.prototype.runQuery = function runQuery(request, callback) { - return this.rpcCall(runQuery, $root.google.datastore.v1.RunQueryRequest, $root.google.datastore.v1.RunQueryResponse, request, callback); - }, "name", { value: "RunQuery" }); + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; - /** - * Calls RunQuery. - * @function runQuery - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IRunQueryRequest} request RunQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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); + }; - /** - * Callback as used by {@link google.datastore.v1.Datastore#beginTransaction}. - * @memberof google.datastore.v1.Datastore - * @typedef BeginTransactionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.BeginTransactionResponse} [response] BeginTransactionResponse - */ + /** + * 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.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; + }; - /** - * Calls BeginTransaction. - * @function beginTransaction - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object - * @param {google.datastore.v1.Datastore.BeginTransactionCallback} callback Node-style callback called with the error, if any, and BeginTransactionResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Datastore.prototype.beginTransaction = function beginTransaction(request, callback) { - return this.rpcCall(beginTransaction, $root.google.datastore.v1.BeginTransactionRequest, $root.google.datastore.v1.BeginTransactionResponse, request, callback); - }, "name", { value: "BeginTransaction" }); + /** + * 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(); + }; - /** - * Calls BeginTransaction. - * @function beginTransaction - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1053: + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.datastore.v1.Datastore#commit}. - * @memberof google.datastore.v1.Datastore - * @typedef CommitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.CommitResponse} [response] CommitResponse - */ + /** + * 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()); + }; - /** - * Calls Commit. - * @function commit - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.ICommitRequest} request CommitRequest message or plain object - * @param {google.datastore.v1.Datastore.CommitCallback} callback Node-style callback called with the error, if any, and CommitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Datastore.prototype.commit = function commit(request, callback) { - return this.rpcCall(commit, $root.google.datastore.v1.CommitRequest, $root.google.datastore.v1.CommitResponse, request, callback); - }, "name", { value: "Commit" }); + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; - /** - * Calls Commit. - * @function commit - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.ICommitRequest} request CommitRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; - /** - * Callback as used by {@link google.datastore.v1.Datastore#rollback}. - * @memberof google.datastore.v1.Datastore - * @typedef RollbackCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.RollbackResponse} [response] RollbackResponse - */ + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; - /** - * Calls Rollback. - * @function rollback - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IRollbackRequest} request RollbackRequest message or plain object - * @param {google.datastore.v1.Datastore.RollbackCallback} callback Node-style callback called with the error, if any, and RollbackResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Datastore.prototype.rollback = function rollback(request, callback) { - return this.rpcCall(rollback, $root.google.datastore.v1.RollbackRequest, $root.google.datastore.v1.RollbackResponse, request, callback); - }, "name", { value: "Rollback" }); + /** + * 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); + }; - /** - * Calls Rollback. - * @function rollback - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IRollbackRequest} request RollbackRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return MessageOptions; + })(); - /** - * Callback as used by {@link google.datastore.v1.Datastore#allocateIds}. - * @memberof google.datastore.v1.Datastore - * @typedef AllocateIdsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.AllocateIdsResponse} [response] AllocateIdsResponse - */ + protobuf.FieldOptions = (function() { - /** - * Calls AllocateIds. - * @function allocateIds - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IAllocateIdsRequest} request AllocateIdsRequest message or plain object - * @param {google.datastore.v1.Datastore.AllocateIdsCallback} callback Node-style callback called with the error, if any, and AllocateIdsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Datastore.prototype.allocateIds = function allocateIds(request, callback) { - return this.rpcCall(allocateIds, $root.google.datastore.v1.AllocateIdsRequest, $root.google.datastore.v1.AllocateIdsResponse, request, callback); - }, "name", { value: "AllocateIds" }); + /** + * 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 {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 + */ - /** - * Calls AllocateIds. - * @function allocateIds - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IAllocateIdsRequest} request AllocateIdsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Callback as used by {@link google.datastore.v1.Datastore#reserveIds}. - * @memberof google.datastore.v1.Datastore - * @typedef ReserveIdsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.ReserveIdsResponse} [response] ReserveIdsResponse - */ + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; - /** - * Calls ReserveIds. - * @function reserveIds - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IReserveIdsRequest} request ReserveIdsRequest message or plain object - * @param {google.datastore.v1.Datastore.ReserveIdsCallback} callback Node-style callback called with the error, if any, and ReserveIdsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Datastore.prototype.reserveIds = function reserveIds(request, callback) { - return this.rpcCall(reserveIds, $root.google.datastore.v1.ReserveIdsRequest, $root.google.datastore.v1.ReserveIdsResponse, request, callback); - }, "name", { value: "ReserveIds" }); + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; - /** - * Calls ReserveIds. - * @function reserveIds - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IReserveIdsRequest} request ReserveIdsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; - return Datastore; - })(); + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; - v1.LookupRequest = (function() { + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; - /** - * Properties of a LookupRequest. - * @memberof google.datastore.v1 - * @interface ILookupRequest - * @property {string|null} [projectId] LookupRequest projectId - * @property {google.datastore.v1.IReadOptions|null} [readOptions] LookupRequest readOptions - * @property {Array.|null} [keys] LookupRequest keys - */ + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; - /** - * Constructs a new LookupRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a LookupRequest. - * @implements ILookupRequest - * @constructor - * @param {google.datastore.v1.ILookupRequest=} [properties] Properties to set - */ - function LookupRequest(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]]; - } + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; - /** - * LookupRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.LookupRequest - * @instance - */ - LookupRequest.prototype.projectId = ""; + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * LookupRequest readOptions. - * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions - * @memberof google.datastore.v1.LookupRequest - * @instance - */ - LookupRequest.prototype.readOptions = null; + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - /** - * LookupRequest keys. - * @member {Array.} keys - * @memberof google.datastore.v1.LookupRequest - * @instance - */ - LookupRequest.prototype.keys = $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 LookupRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.LookupRequest - * @static - * @param {google.datastore.v1.ILookupRequest=} [properties] Properties to set - * @returns {google.datastore.v1.LookupRequest} LookupRequest instance - */ - LookupRequest.create = function create(properties) { - return new LookupRequest(properties); - }; + /** + * 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 LookupRequest message. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.LookupRequest - * @static - * @param {google.datastore.v1.ILookupRequest} message LookupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) - $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - return writer; - }; + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified LookupRequest message, length delimited. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.LookupRequest - * @static - * @param {google.datastore.v1.ILookupRequest} message LookupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 LookupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.LookupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.LookupRequest} LookupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 1: - message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 15: + message.unverifiedLazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + case 1055: + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a LookupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.LookupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.LookupRequest} LookupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 LookupRequest message. - * @function verify - * @memberof google.datastore.v1.LookupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LookupRequest.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.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); - if (error) - return "readOptions." + error; + /** + * 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.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.datastore.v1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; } - return null; - }; - - /** - * Creates a LookupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.LookupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.LookupRequest} LookupRequest - */ - LookupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.LookupRequest) - return object; - var message = new $root.google.datastore.v1.LookupRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.readOptions != null) { - if (typeof object.readOptions !== "object") - throw TypeError(".google.datastore.v1.LookupRequest.readOptions: object expected"); - message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); + 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.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 (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.datastore.v1.LookupRequest.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.datastore.v1.LookupRequest.keys: object expected"); - message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); + } + 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: + break; } - } - return message; - }; + } + 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 plain object from a LookupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.LookupRequest - * @static - * @param {google.datastore.v1.LookupRequest} message LookupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LookupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) { - object.readOptions = null; - object.projectId = ""; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) - object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.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.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 (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - return object; - }; - - /** - * Converts this LookupRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.LookupRequest - * @instance - * @returns {Object.} JSON object - */ - LookupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return LookupRequest; - })(); - - v1.LookupResponse = (function() { - - /** - * Properties of a LookupResponse. - * @memberof google.datastore.v1 - * @interface ILookupResponse - * @property {Array.|null} [found] LookupResponse found - * @property {Array.|null} [missing] LookupResponse missing - * @property {Array.|null} [deferred] LookupResponse deferred - * @property {google.protobuf.ITimestamp|null} [readTime] LookupResponse readTime - */ - - /** - * Constructs a new LookupResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a LookupResponse. - * @implements ILookupResponse - * @constructor - * @param {google.datastore.v1.ILookupResponse=} [properties] Properties to set - */ - function LookupResponse(properties) { - this.found = []; - this.missing = []; - this.deferred = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + 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; + }; - /** - * LookupResponse found. - * @member {Array.} found - * @memberof google.datastore.v1.LookupResponse - * @instance - */ - LookupResponse.prototype.found = $util.emptyArray; - - /** - * LookupResponse missing. - * @member {Array.} missing - * @memberof google.datastore.v1.LookupResponse - * @instance - */ - LookupResponse.prototype.missing = $util.emptyArray; - - /** - * LookupResponse deferred. - * @member {Array.} deferred - * @memberof google.datastore.v1.LookupResponse - * @instance - */ - LookupResponse.prototype.deferred = $util.emptyArray; - - /** - * LookupResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.LookupResponse - * @instance - */ - LookupResponse.prototype.readTime = null; + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; - /** - * Creates a new LookupResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.LookupResponse - * @static - * @param {google.datastore.v1.ILookupResponse=} [properties] Properties to set - * @returns {google.datastore.v1.LookupResponse} LookupResponse instance - */ - LookupResponse.create = function create(properties) { - return new LookupResponse(properties); - }; + /** + * 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); + }; - /** - * Encodes the specified LookupResponse message. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.LookupResponse - * @static - * @param {google.datastore.v1.ILookupResponse} message LookupResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.found != null && message.found.length) - for (var i = 0; i < message.found.length; ++i) - $root.google.datastore.v1.EntityResult.encode(message.found[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.missing != null && message.missing.length) - for (var i = 0; i < message.missing.length; ++i) - $root.google.datastore.v1.EntityResult.encode(message.missing[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deferred != null && message.deferred.length) - for (var i = 0; i < message.deferred.length; ++i) - $root.google.datastore.v1.Key.encode(message.deferred[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; + /** + * 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; + })(); - /** - * Encodes the specified LookupResponse message, length delimited. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.LookupResponse - * @static - * @param {google.datastore.v1.ILookupResponse} message LookupResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LookupResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + })(); - /** - * Decodes a LookupResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.LookupResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.LookupResponse} LookupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.found && message.found.length)) - message.found = []; - message.found.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.missing && message.missing.length)) - message.missing = []; - message.missing.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.deferred && message.deferred.length)) - message.deferred = []; - message.deferred.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); - break; - case 7: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return FieldOptions; + })(); - /** - * Decodes a LookupResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.LookupResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.LookupResponse} LookupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LookupResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + protobuf.OneofOptions = (function() { - /** - * Verifies a LookupResponse message. - * @function verify - * @memberof google.datastore.v1.LookupResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LookupResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.found != null && message.hasOwnProperty("found")) { - if (!Array.isArray(message.found)) - return "found: array expected"; - for (var i = 0; i < message.found.length; ++i) { - var error = $root.google.datastore.v1.EntityResult.verify(message.found[i]); - if (error) - return "found." + error; - } - } - if (message.missing != null && message.hasOwnProperty("missing")) { - if (!Array.isArray(message.missing)) - return "missing: array expected"; - for (var i = 0; i < message.missing.length; ++i) { - var error = $root.google.datastore.v1.EntityResult.verify(message.missing[i]); - if (error) - return "missing." + error; - } - } - if (message.deferred != null && message.hasOwnProperty("deferred")) { - if (!Array.isArray(message.deferred)) - return "deferred: array expected"; - for (var i = 0; i < message.deferred.length; ++i) { - var error = $root.google.datastore.v1.Key.verify(message.deferred[i]); - if (error) - return "deferred." + error; - } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - return null; - }; + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ - /** - * Creates a LookupResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.LookupResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.LookupResponse} LookupResponse - */ - LookupResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.LookupResponse) - return object; - var message = new $root.google.datastore.v1.LookupResponse(); - if (object.found) { - if (!Array.isArray(object.found)) - throw TypeError(".google.datastore.v1.LookupResponse.found: array expected"); - message.found = []; - for (var i = 0; i < object.found.length; ++i) { - if (typeof object.found[i] !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.found: object expected"); - message.found[i] = $root.google.datastore.v1.EntityResult.fromObject(object.found[i]); - } - } - if (object.missing) { - if (!Array.isArray(object.missing)) - throw TypeError(".google.datastore.v1.LookupResponse.missing: array expected"); - message.missing = []; - for (var i = 0; i < object.missing.length; ++i) { - if (typeof object.missing[i] !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.missing: object expected"); - message.missing[i] = $root.google.datastore.v1.EntityResult.fromObject(object.missing[i]); - } - } - if (object.deferred) { - if (!Array.isArray(object.deferred)) - throw TypeError(".google.datastore.v1.LookupResponse.deferred: array expected"); - message.deferred = []; - for (var i = 0; i < object.deferred.length; ++i) { - if (typeof object.deferred[i] !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.deferred: object expected"); - message.deferred[i] = $root.google.datastore.v1.Key.fromObject(object.deferred[i]); - } - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - return message; - }; + /** + * 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]]; + } - /** - * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.LookupResponse - * @static - * @param {google.datastore.v1.LookupResponse} message LookupResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LookupResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.found = []; - object.missing = []; - object.deferred = []; - } - if (options.defaults) - object.readTime = null; - if (message.found && message.found.length) { - object.found = []; - for (var j = 0; j < message.found.length; ++j) - object.found[j] = $root.google.datastore.v1.EntityResult.toObject(message.found[j], options); - } - if (message.missing && message.missing.length) { - object.missing = []; - for (var j = 0; j < message.missing.length; ++j) - object.missing[j] = $root.google.datastore.v1.EntityResult.toObject(message.missing[j], options); - } - if (message.deferred && message.deferred.length) { - object.deferred = []; - for (var j = 0; j < message.deferred.length; ++j) - object.deferred[j] = $root.google.datastore.v1.Key.toObject(message.deferred[j], options); - } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - return object; - }; + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Converts this LookupResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.LookupResponse - * @instance - * @returns {Object.} JSON object - */ - LookupResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - return LookupResponse; - })(); + /** + * 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(); + }; - v1.RunQueryRequest = (function() { + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a RunQueryRequest. - * @memberof google.datastore.v1 - * @interface IRunQueryRequest - * @property {string|null} [projectId] RunQueryRequest projectId - * @property {google.datastore.v1.IPartitionId|null} [partitionId] RunQueryRequest partitionId - * @property {google.datastore.v1.IReadOptions|null} [readOptions] RunQueryRequest readOptions - * @property {google.datastore.v1.IQuery|null} [query] RunQueryRequest query - * @property {google.datastore.v1.IGqlQuery|null} [gqlQuery] RunQueryRequest gqlQuery - */ + /** + * 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()); + }; - /** - * Constructs a new RunQueryRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a RunQueryRequest. - * @implements IRunQueryRequest - * @constructor - * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set - */ - function RunQueryRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } } + return null; + }; - /** - * RunQueryRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.projectId = ""; + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * RunQueryRequest partitionId. - * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.partitionId = null; + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * RunQueryRequest readOptions. - * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.readOptions = null; + /** + * 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); + }; - /** - * RunQueryRequest query. - * @member {google.datastore.v1.IQuery|null|undefined} query - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.query = null; + return OneofOptions; + })(); - /** - * RunQueryRequest gqlQuery. - * @member {google.datastore.v1.IGqlQuery|null|undefined} gqlQuery - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.gqlQuery = null; + protobuf.EnumOptions = (function() { - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ - /** - * RunQueryRequest queryType. - * @member {"query"|"gqlQuery"|undefined} queryType - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - Object.defineProperty(RunQueryRequest.prototype, "queryType", { - get: $util.oneOfGetter($oneOfFields = ["query", "gqlQuery"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * 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]]; + } - /** - * Creates a new RunQueryRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest instance - */ - RunQueryRequest.create = function create(properties) { - return new RunQueryRequest(properties); - }; + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; - /** - * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunQueryRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) - $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) - $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.gqlQuery != null && Object.hasOwnProperty.call(message, "gqlQuery")) - $root.google.datastore.v1.GqlQuery.encode(message.gqlQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - return writer; - }; + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; - /** - * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Decodes a RunQueryRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunQueryRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 2: - message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); - break; - case 1: - message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); - break; - case 3: - message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); - break; - case 7: - message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; - /** - * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunQueryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Verifies a RunQueryRequest message. - * @function verify - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunQueryRequest.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.partitionId != null && message.hasOwnProperty("partitionId")) { - var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); - if (error) - return "partitionId." + error; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); - if (error) - return "readOptions." + error; - } - if (message.query != null && message.hasOwnProperty("query")) { - properties.queryType = 1; - { - var error = $root.google.datastore.v1.Query.verify(message.query); - if (error) - return "query." + error; - } - } - if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { - if (properties.queryType === 1) - return "queryType: multiple values"; - properties.queryType = 1; - { - var error = $root.google.datastore.v1.GqlQuery.verify(message.gqlQuery); - if (error) - return "gqlQuery." + error; - } - } - return null; - }; + /** + * 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(); + }; - /** - * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest - */ - RunQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RunQueryRequest) - return object; - var message = new $root.google.datastore.v1.RunQueryRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.partitionId != null) { - if (typeof object.partitionId !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.partitionId: object expected"); - message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); - } - if (object.readOptions != null) { - if (typeof object.readOptions !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.readOptions: object expected"); - message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.query: object expected"); - message.query = $root.google.datastore.v1.Query.fromObject(object.query); - } - if (object.gqlQuery != null) { - if (typeof object.gqlQuery !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.gqlQuery: object expected"); - message.gqlQuery = $root.google.datastore.v1.GqlQuery.fromObject(object.gqlQuery); + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {google.datastore.v1.RunQueryRequest} message RunQueryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunQueryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.readOptions = null; - object.partitionId = null; - object.projectId = ""; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) - object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); - if (message.partitionId != null && message.hasOwnProperty("partitionId")) - object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); - if (message.query != null && message.hasOwnProperty("query")) { - object.query = $root.google.datastore.v1.Query.toObject(message.query, options); - if (options.oneofs) - object.queryType = "query"; - } - if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { - object.gqlQuery = $root.google.datastore.v1.GqlQuery.toObject(message.gqlQuery, options); - if (options.oneofs) - object.queryType = "gqlQuery"; + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) return object; - }; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * Converts this RunQueryRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.RunQueryRequest - * @instance - * @returns {Object.} JSON object - */ - RunQueryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - return RunQueryRequest; - })(); + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * 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(); + }; - v1.RunQueryResponse = (function() { + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a RunQueryResponse. - * @memberof google.datastore.v1 - * @interface IRunQueryResponse - * @property {google.datastore.v1.IQueryResultBatch|null} [batch] RunQueryResponse batch - * @property {google.datastore.v1.IQuery|null} [query] RunQueryResponse query - */ + /** + * 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()); + }; - /** - * Constructs a new RunQueryResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a RunQueryResponse. - * @implements IRunQueryResponse - * @constructor - * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set - */ - function RunQueryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } } + return null; + }; - /** - * RunQueryResponse batch. - * @member {google.datastore.v1.IQueryResultBatch|null|undefined} batch - * @memberof google.datastore.v1.RunQueryResponse - * @instance - */ - RunQueryResponse.prototype.batch = null; + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * RunQueryResponse query. - * @member {google.datastore.v1.IQuery|null|undefined} query - * @memberof google.datastore.v1.RunQueryResponse - * @instance - */ - RunQueryResponse.prototype.query = null; + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * Creates a new RunQueryResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse instance - */ - RunQueryResponse.create = function create(properties) { - return new RunQueryResponse(properties); - }; + /** + * 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); + }; - /** - * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunQueryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) - $root.google.datastore.v1.QueryResultBatch.encode(message.batch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + return EnumValueOptions; + })(); - /** - * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + protobuf.ServiceOptions = (function() { - /** - * Decodes a RunQueryResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunQueryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.batch = $root.google.datastore.v1.QueryResultBatch.decode(reader, reader.uint32()); - break; - case 2: - message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ - /** - * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunQueryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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]]; + } - /** - * Verifies a RunQueryResponse message. - * @function verify - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunQueryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.batch != null && message.hasOwnProperty("batch")) { - var error = $root.google.datastore.v1.QueryResultBatch.verify(message.batch); - if (error) - return "batch." + error; - } - if (message.query != null && message.hasOwnProperty("query")) { - var error = $root.google.datastore.v1.Query.verify(message.query); - if (error) - return "query." + error; - } - return null; - }; + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; - /** - * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse - */ - RunQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RunQueryResponse) - return object; - var message = new $root.google.datastore.v1.RunQueryResponse(); - if (object.batch != null) { - if (typeof object.batch !== "object") - throw TypeError(".google.datastore.v1.RunQueryResponse.batch: object expected"); - message.batch = $root.google.datastore.v1.QueryResultBatch.fromObject(object.batch); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.datastore.v1.RunQueryResponse.query: object expected"); - message.query = $root.google.datastore.v1.Query.fromObject(object.query); - } - return message; - }; + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {google.datastore.v1.RunQueryResponse} message RunQueryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunQueryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.batch = null; - object.query = null; - } - if (message.batch != null && message.hasOwnProperty("batch")) - object.batch = $root.google.datastore.v1.QueryResultBatch.toObject(message.batch, options); - if (message.query != null && message.hasOwnProperty("query")) - object.query = $root.google.datastore.v1.Query.toObject(message.query, options); - return object; - }; + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; - /** - * Converts this RunQueryResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.RunQueryResponse - * @instance - * @returns {Object.} JSON object - */ - RunQueryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - return RunQueryResponse; - })(); + /** + * 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); + }; - v1.BeginTransactionRequest = (function() { + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; - /** - * Properties of a BeginTransactionRequest. - * @memberof google.datastore.v1 - * @interface IBeginTransactionRequest - * @property {string|null} [projectId] BeginTransactionRequest projectId - * @property {google.datastore.v1.ITransactionOptions|null} [transactionOptions] BeginTransactionRequest transactionOptions - */ + /** + * 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(); + }; - /** - * Constructs a new BeginTransactionRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a BeginTransactionRequest. - * @implements IBeginTransactionRequest - * @constructor - * @param {google.datastore.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]]; + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * BeginTransactionRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.projectId = ""; + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; - /** - * BeginTransactionRequest transactionOptions. - * @member {google.datastore.v1.ITransactionOptions|null|undefined} transactionOptions - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.transactionOptions = null; + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; - /** - * Creates a new BeginTransactionRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.v1.IBeginTransactionRequest=} [properties] Properties to set - * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest instance - */ - BeginTransactionRequest.create = function create(properties) { - return new BeginTransactionRequest(properties); - }; + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; - /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.transactionOptions != null && Object.hasOwnProperty.call(message, "transactionOptions")) - $root.google.datastore.v1.TransactionOptions.encode(message.transactionOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; + /** + * 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); + }; - /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.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(); - }; + return ServiceOptions; + })(); - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 10: - message.transactionOptions = $root.google.datastore.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + protobuf.MethodOptions = (function() { - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ - /** - * Verifies a BeginTransactionRequest message. - * @function verify - * @memberof google.datastore.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.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.transactionOptions != null && message.hasOwnProperty("transactionOptions")) { - var error = $root.google.datastore.v1.TransactionOptions.verify(message.transactionOptions); - if (error) - return "transactionOptions." + error; - } - return null; - }; + /** + * 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]]; + } - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest - */ - BeginTransactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.BeginTransactionRequest) - return object; - var message = new $root.google.datastore.v1.BeginTransactionRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.transactionOptions != null) { - if (typeof object.transactionOptions !== "object") - throw TypeError(".google.datastore.v1.BeginTransactionRequest.transactionOptions: object expected"); - message.transactionOptions = $root.google.datastore.v1.TransactionOptions.fromObject(object.transactionOptions); - } - return message; - }; + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.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.projectId = ""; - object.transactionOptions = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.transactionOptions != null && message.hasOwnProperty("transactionOptions")) - object.transactionOptions = $root.google.datastore.v1.TransactionOptions.toObject(message.transactionOptions, options); - return object; - }; + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; - /** - * Converts this BeginTransactionRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - * @returns {Object.} JSON object - */ - BeginTransactionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - return BeginTransactionRequest; - })(); + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; - v1.BeginTransactionResponse = (function() { + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - /** - * Properties of a BeginTransactionResponse. - * @memberof google.datastore.v1 - * @interface IBeginTransactionResponse - * @property {Uint8Array|null} [transaction] BeginTransactionResponse transaction - */ + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - /** - * Constructs a new BeginTransactionResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a BeginTransactionResponse. - * @implements IBeginTransactionResponse - * @constructor - * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set - */ - function BeginTransactionResponse(properties) { - if (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 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); + }; - /** - * BeginTransactionResponse transaction. - * @member {Uint8Array} transaction - * @memberof google.datastore.v1.BeginTransactionResponse - * @instance - */ - BeginTransactionResponse.prototype.transaction = $util.newBuffer([]); + /** + * 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.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; + }; - /** - * Creates a new BeginTransactionResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse instance - */ - BeginTransactionResponse.create = function create(properties) { - return new BeginTransactionResponse(properties); - }; + /** + * 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(); + }; - /** - * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - return writer; - }; + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + case 1051: + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + case 1049: + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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()); + }; - /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.transaction = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * 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; } - return message; - }; + 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; + }; - /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + 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; + }; - /** - * Verifies a BeginTransactionResponse message. - * @function verify - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BeginTransactionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - return null; - }; + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.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] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.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); + }; + + /** + * 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; + })(); - /** - * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse - */ - BeginTransactionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.BeginTransactionResponse) - return object; - var message = new $root.google.datastore.v1.BeginTransactionResponse(); - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length) - message.transaction = object.transaction; - return message; - }; + return MethodOptions; + })(); - /** - * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.BeginTransactionResponse} message BeginTransactionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BeginTransactionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - return object; - }; + protobuf.UninterpretedOption = (function() { - /** - * Converts this BeginTransactionResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.BeginTransactionResponse - * @instance - * @returns {Object.} JSON object - */ - BeginTransactionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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 + */ - return BeginTransactionResponse; - })(); + /** + * 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]]; + } - v1.RollbackRequest = (function() { + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; - /** - * Properties of a RollbackRequest. - * @memberof google.datastore.v1 - * @interface IRollbackRequest - * @property {string|null} [projectId] RollbackRequest projectId - * @property {Uint8Array|null} [transaction] RollbackRequest transaction - */ + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; - /** - * Constructs a new RollbackRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a RollbackRequest. - * @implements IRollbackRequest - * @constructor - * @param {google.datastore.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]]; - } + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - /** - * RollbackRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.projectId = ""; + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * RollbackRequest transaction. - * @member {Uint8Array} transaction - * @memberof google.datastore.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.transaction = $util.newBuffer([]); + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; - /** - * Creates a new RollbackRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.v1.IRollbackRequest=} [properties] Properties to set - * @returns {google.datastore.v1.RollbackRequest} RollbackRequest instance - */ - RollbackRequest.create = function create(properties) { - return new RollbackRequest(properties); - }; + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - return writer; - }; + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; - /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.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(); - }; + /** + * 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; + }; - /** - * Decodes a RollbackRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 1: - message.transaction = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * 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 a RollbackRequest message. - * @function verify - * @memberof google.datastore.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.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - return null; - }; + /** + * 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 a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RollbackRequest} RollbackRequest - */ - RollbackRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RollbackRequest) - return object; - var message = new $root.google.datastore.v1.RollbackRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length) - message.transaction = object.transaction; - return message; - }; + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.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) { - if (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - object.projectId = ""; + /** + * 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); } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - return object; - }; - - /** - * Converts this RollbackRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.RollbackRequest - * @instance - * @returns {Object.} JSON object - */ - RollbackRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + 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; + }; - return RollbackRequest; - })(); + /** + * 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); + }; - v1.RollbackResponse = (function() { + UninterpretedOption.NamePart = (function() { /** - * Properties of a RollbackResponse. - * @memberof google.datastore.v1 - * @interface IRollbackResponse + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension */ /** - * Constructs a new RollbackResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a RollbackResponse. - * @implements IRollbackResponse + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart * @constructor - * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set */ - function RollbackResponse(properties) { + function NamePart(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7934,164 +8582,423 @@ } /** - * Creates a new RollbackResponse instance using the specified properties. + * 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.datastore.v1.RollbackResponse + * @memberof google.protobuf.UninterpretedOption.NamePart * @static - * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse instance + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance */ - RollbackResponse.create = function create(properties) { - return new RollbackResponse(properties); + NamePart.create = function create(properties) { + return new NamePart(properties); }; /** - * Encodes the specified RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.RollbackResponse + * @memberof google.protobuf.UninterpretedOption.NamePart * @static - * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode + * @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 */ - RollbackResponse.encode = function encode(message, 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 RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.RollbackResponse + * @memberof google.protobuf.UninterpretedOption.NamePart * @static - * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode + * @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 */ - RollbackResponse.encodeDelimited = function encodeDelimited(message, writer) { + NamePart.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RollbackResponse message from the specified reader or buffer. + * Decodes a NamePart message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.RollbackResponse + * @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.datastore.v1.RollbackResponse} RollbackResponse + * @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 */ - RollbackResponse.decode = function decode(reader, length) { + NamePart.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; default: reader.skipType(tag & 7); break; } } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); return message; }; /** - * Decodes a RollbackResponse message from the specified reader or buffer, length delimited. + * Decodes a NamePart message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.RollbackResponse + * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse + * @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 */ - RollbackResponse.decodeDelimited = function decodeDelimited(reader) { + NamePart.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RollbackResponse message. + * Verifies a NamePart message. * @function verify - * @memberof google.datastore.v1.RollbackResponse + * @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 */ - RollbackResponse.verify = function verify(message) { + 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 RollbackResponse message from a plain object. Also converts values to their respective internal types. + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.RollbackResponse + * @memberof google.protobuf.UninterpretedOption.NamePart * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart */ - RollbackResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RollbackResponse) + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) return object; - return new $root.google.datastore.v1.RollbackResponse(); + 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 RollbackResponse message. Also converts values to other types if specified. + * Creates a plain object from a NamePart message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.RollbackResponse + * @memberof google.protobuf.UninterpretedOption.NamePart * @static - * @param {google.datastore.v1.RollbackResponse} message RollbackResponse + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RollbackResponse.toObject = function toObject() { - return {}; + 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 RollbackResponse to JSON. + * Converts this NamePart to JSON. * @function toJSON - * @memberof google.datastore.v1.RollbackResponse + * @memberof google.protobuf.UninterpretedOption.NamePart * @instance * @returns {Object.} JSON object */ - RollbackResponse.prototype.toJSON = function toJSON() { + NamePart.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RollbackResponse; + return NamePart; })(); - v1.CommitRequest = (function() { + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { /** - * Properties of a CommitRequest. - * @memberof google.datastore.v1 - * @interface ICommitRequest - * @property {string|null} [projectId] CommitRequest projectId - * @property {google.datastore.v1.CommitRequest.Mode|null} [mode] CommitRequest mode - * @property {Uint8Array|null} [transaction] CommitRequest transaction - * @property {Array.|null} [mutations] CommitRequest mutations + * 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 CommitRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a CommitRequest. - * @implements ICommitRequest + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation * @constructor - * @param {google.datastore.v1.ICommitRequest=} [properties] Properties to set + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set */ - function CommitRequest(properties) { - this.mutations = []; + 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) @@ -8099,131 +9006,152 @@ } /** - * CommitRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.CommitRequest + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - CommitRequest.prototype.projectId = ""; + Location.prototype.path = $util.emptyArray; /** - * CommitRequest mode. - * @member {google.datastore.v1.CommitRequest.Mode} mode - * @memberof google.datastore.v1.CommitRequest + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - CommitRequest.prototype.mode = 0; + Location.prototype.span = $util.emptyArray; /** - * CommitRequest transaction. - * @member {Uint8Array|null|undefined} transaction - * @memberof google.datastore.v1.CommitRequest + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - CommitRequest.prototype.transaction = null; + Location.prototype.leadingComments = ""; /** - * CommitRequest mutations. - * @member {Array.} mutations - * @memberof google.datastore.v1.CommitRequest + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - CommitRequest.prototype.mutations = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Location.prototype.trailingComments = ""; /** - * CommitRequest transactionSelector. - * @member {"transaction"|undefined} transactionSelector - * @memberof google.datastore.v1.CommitRequest + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location * @instance */ - Object.defineProperty(CommitRequest.prototype, "transactionSelector", { - get: $util.oneOfGetter($oneOfFields = ["transaction"]), - set: $util.oneOfSetter($oneOfFields) - }); + Location.prototype.leadingDetachedComments = $util.emptyArray; /** - * Creates a new CommitRequest instance using the specified properties. + * Creates a new Location instance using the specified properties. * @function create - * @memberof google.datastore.v1.CommitRequest + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.datastore.v1.ICommitRequest=} [properties] Properties to set - * @returns {google.datastore.v1.CommitRequest} CommitRequest instance + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance */ - CommitRequest.create = function create(properties) { - return new CommitRequest(properties); + Location.create = function create(properties) { + return new Location(properties); }; /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.CommitRequest + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.datastore.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommitRequest.encode = function encode(message, writer) { + Location.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.mode); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.google.datastore.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + 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 CommitRequest message, length delimited. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.CommitRequest + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.datastore.v1.ICommitRequest} message CommitRequest message or plain object to encode + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { + Location.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CommitRequest message from the specified reader or buffer. + * Decodes a Location message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.CommitRequest + * @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.datastore.v1.CommitRequest} CommitRequest + * @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 */ - CommitRequest.decode = function decode(reader, length) { + Location.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); + 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 5: - message.mode = reader.int32(); + 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 1: - message.transaction = reader.bytes(); + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); break; case 6: - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.google.datastore.v1.Mutation.decode(reader, reader.uint32())); + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -8234,195 +9162,390 @@ }; /** - * Decodes a CommitRequest message from the specified reader or buffer, length delimited. + * Decodes a Location message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.CommitRequest + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.CommitRequest} CommitRequest + * @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 */ - CommitRequest.decodeDelimited = function decodeDelimited(reader) { + Location.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CommitRequest message. + * Verifies a Location message. * @function verify - * @memberof google.datastore.v1.CommitRequest + * @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 */ - CommitRequest.verify = function verify(message) { + Location.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.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - properties.transactionSelector = 1; - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer 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.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.datastore.v1.Mutation.verify(message.mutations[i]); - if (error) - return "mutations." + error; - } + 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 CommitRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Location message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.CommitRequest + * @memberof google.protobuf.SourceCodeInfo.Location * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.CommitRequest} CommitRequest + * @returns {google.protobuf.SourceCodeInfo.Location} Location */ - CommitRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.CommitRequest) + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) return object; - var message = new $root.google.datastore.v1.CommitRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - switch (object.mode) { - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "TRANSACTIONAL": - case 1: - message.mode = 1; - break; - case "NON_TRANSACTIONAL": - case 2: - message.mode = 2; - break; + 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.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length) - message.transaction = object.transaction; - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".google.datastore.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.datastore.v1.CommitRequest.mutations: object expected"); - message.mutations[i] = $root.google.datastore.v1.Mutation.fromObject(object.mutations[i]); - } + 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 CommitRequest message. Also converts values to other types if specified. + * Creates a plain object from a Location message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.CommitRequest + * @memberof google.protobuf.SourceCodeInfo.Location * @static - * @param {google.datastore.v1.CommitRequest} message CommitRequest + * @param {google.protobuf.SourceCodeInfo.Location} message Location * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CommitRequest.toObject = function toObject(message, options) { + Location.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.mutations = []; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } if (options.defaults) { - object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - object.projectId = ""; + object.leadingComments = ""; + object.trailingComments = ""; } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (options.oneofs) - object.transactionSelector = "transaction"; + 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.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.datastore.v1.CommitRequest.Mode[message.mode] : message.mode; - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.datastore.v1.Mutation.toObject(message.mutations[j], options); + 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]; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; return object; }; /** - * Converts this CommitRequest to JSON. + * Converts this Location to JSON. * @function toJSON - * @memberof google.datastore.v1.CommitRequest + * @memberof google.protobuf.SourceCodeInfo.Location * @instance * @returns {Object.} JSON object */ - CommitRequest.prototype.toJSON = function toJSON() { + Location.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Mode enum. - * @name google.datastore.v1.CommitRequest.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} TRANSACTIONAL=1 TRANSACTIONAL value - * @property {number} NON_TRANSACTIONAL=2 NON_TRANSACTIONAL value - */ - CommitRequest.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TRANSACTIONAL"] = 1; - values[valuesById[2] = "NON_TRANSACTIONAL"] = 2; - return values; - })(); + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; - return CommitRequest; - })(); + /** + * 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; + }; - v1.CommitResponse = (function() { + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { /** - * Properties of a CommitResponse. - * @memberof google.datastore.v1 - * @interface ICommitResponse - * @property {Array.|null} [mutationResults] CommitResponse mutationResults - * @property {number|null} [indexUpdates] CommitResponse indexUpdates - * @property {google.protobuf.ITimestamp|null} [commitTime] CommitResponse commitTime + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end */ /** - * Constructs a new CommitResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a CommitResponse. - * @implements ICommitResponse + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation * @constructor - * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set */ - function CommitResponse(properties) { - this.mutationResults = []; + function Annotation(properties) { + this.path = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8430,104 +9553,125 @@ } /** - * CommitResponse mutationResults. - * @member {Array.} mutationResults - * @memberof google.datastore.v1.CommitResponse + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - CommitResponse.prototype.mutationResults = $util.emptyArray; + Annotation.prototype.path = $util.emptyArray; /** - * CommitResponse indexUpdates. - * @member {number} indexUpdates - * @memberof google.datastore.v1.CommitResponse + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - CommitResponse.prototype.indexUpdates = 0; + Annotation.prototype.sourceFile = ""; /** - * CommitResponse commitTime. - * @member {google.protobuf.ITimestamp|null|undefined} commitTime - * @memberof google.datastore.v1.CommitResponse + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @instance */ - CommitResponse.prototype.commitTime = null; + Annotation.prototype.begin = 0; /** - * Creates a new CommitResponse instance using the specified properties. + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. * @function create - * @memberof google.datastore.v1.CommitResponse + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set - * @returns {google.datastore.v1.CommitResponse} CommitResponse instance + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance */ - CommitResponse.create = function create(properties) { - return new CommitResponse(properties); + Annotation.create = function create(properties) { + return new Annotation(properties); }; /** - * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.CommitResponse + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.datastore.v1.ICommitResponse} message CommitResponse message or plain object to encode + * @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 */ - CommitResponse.encode = function encode(message, writer) { + Annotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.mutationResults != null && message.mutationResults.length) - for (var i = 0; i < message.mutationResults.length; ++i) - $root.google.datastore.v1.MutationResult.encode(message.mutationResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.indexUpdates != null && Object.hasOwnProperty.call(message, "indexUpdates")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.indexUpdates); - if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) - $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; /** - * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.CommitResponse + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static - * @param {google.datastore.v1.ICommitResponse} message CommitResponse message or plain object to encode + * @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 */ - CommitResponse.encodeDelimited = function encodeDelimited(message, writer) { + Annotation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CommitResponse message from the specified reader or buffer. + * Decodes an Annotation message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.CommitResponse + * @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.datastore.v1.CommitResponse} CommitResponse + * @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 */ - CommitResponse.decode = function decode(reader, length) { + Annotation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; case 3: - if (!(message.mutationResults && message.mutationResults.length)) - message.mutationResults = []; - message.mutationResults.push($root.google.datastore.v1.MutationResult.decode(reader, reader.uint32())); + message.begin = reader.int32(); break; case 4: - message.indexUpdates = reader.int32(); - break; - case 8: - message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.end = reader.int32(); break; default: reader.skipType(tag & 7); @@ -8538,2589 +9682,2988 @@ }; /** - * Decodes a CommitResponse message from the specified reader or buffer, length delimited. + * Decodes an Annotation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.CommitResponse + * @memberof google.protobuf.GeneratedCodeInfo.Annotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.CommitResponse} CommitResponse + * @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 */ - CommitResponse.decodeDelimited = function decodeDelimited(reader) { + Annotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CommitResponse message. + * Verifies an Annotation message. * @function verify - * @memberof google.datastore.v1.CommitResponse + * @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 */ - CommitResponse.verify = function verify(message) { + Annotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.mutationResults != null && message.hasOwnProperty("mutationResults")) { - if (!Array.isArray(message.mutationResults)) - return "mutationResults: array expected"; - for (var i = 0; i < message.mutationResults.length; ++i) { - var error = $root.google.datastore.v1.MutationResult.verify(message.mutationResults[i]); - if (error) - return "mutationResults." + error; - } + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; } - if (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) - if (!$util.isInteger(message.indexUpdates)) - return "indexUpdates: integer expected"; - if (message.commitTime != null && message.hasOwnProperty("commitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTime); - if (error) - return "commitTime." + error; + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; } - return null; + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; }; /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.CommitResponse} CommitResponse + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object */ - CommitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.CommitResponse) - return object; - var message = new $root.google.datastore.v1.CommitResponse(); - if (object.mutationResults) { - if (!Array.isArray(object.mutationResults)) - throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: array expected"); - message.mutationResults = []; - for (var i = 0; i < object.mutationResults.length; ++i) { - if (typeof object.mutationResults[i] !== "object") - throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: object expected"); - message.mutationResults[i] = $root.google.datastore.v1.MutationResult.fromObject(object.mutationResults[i]); - } - } - if (object.indexUpdates != null) - message.indexUpdates = object.indexUpdates | 0; - if (object.commitTime != null) { - if (typeof object.commitTime !== "object") - throw TypeError(".google.datastore.v1.CommitResponse.commitTime: object expected"); - message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); - } - return message; + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {google.datastore.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.arrays || options.defaults) - object.mutationResults = []; - if (options.defaults) { - object.indexUpdates = 0; - object.commitTime = null; - } - if (message.mutationResults && message.mutationResults.length) { - object.mutationResults = []; - for (var j = 0; j < message.mutationResults.length; ++j) - object.mutationResults[j] = $root.google.datastore.v1.MutationResult.toObject(message.mutationResults[j], options); - } - if (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) - object.indexUpdates = message.indexUpdates; - if (message.commitTime != null && message.hasOwnProperty("commitTime")) - object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); - return object; - }; + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ - /** - * Converts this CommitResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.CommitResponse - * @instance - * @returns {Object.} JSON object - */ - CommitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return CommitResponse; - })(); + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; - v1.AllocateIdsRequest = (function() { + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; - /** - * Properties of an AllocateIdsRequest. - * @memberof google.datastore.v1 - * @interface IAllocateIdsRequest - * @property {string|null} [projectId] AllocateIdsRequest projectId - * @property {Array.|null} [keys] AllocateIdsRequest keys - */ + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; - /** - * Constructs a new AllocateIdsRequest. - * @memberof google.datastore.v1 - * @classdesc Represents an AllocateIdsRequest. - * @implements IAllocateIdsRequest - * @constructor - * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set - */ - function AllocateIdsRequest(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]]; + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * AllocateIdsRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - */ - AllocateIdsRequest.prototype.projectId = ""; + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * AllocateIdsRequest keys. - * @member {Array.} keys - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - */ - AllocateIdsRequest.prototype.keys = $util.emptyArray; + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; - /** - * Creates a new AllocateIdsRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest instance - */ - AllocateIdsRequest.create = function create(properties) { - return new AllocateIdsRequest(properties); - }; + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocateIdsRequest.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - return writer; - }; + return FloatValue; + })(); - /** - * Encodes the specified AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocateIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + protobuf.Int64Value = (function() { - /** - * Decodes an AllocateIdsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocateIdsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 1: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ - /** - * Decodes an AllocateIdsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocateIdsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies an AllocateIdsRequest message. - * @function verify - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllocateIdsRequest.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.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.datastore.v1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - return null; - }; + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates an AllocateIdsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest - */ - AllocateIdsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AllocateIdsRequest) - return object; - var message = new $root.google.datastore.v1.AllocateIdsRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.datastore.v1.AllocateIdsRequest.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.datastore.v1.AllocateIdsRequest.keys: object expected"); - message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); - } - } - return message; - }; + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; - /** - * Creates a plain object from an AllocateIdsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.AllocateIdsRequest} message AllocateIdsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllocateIdsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) - object.projectId = ""; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - return object; - }; + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this AllocateIdsRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - * @returns {Object.} JSON object - */ - AllocateIdsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return AllocateIdsRequest; - })(); + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; - v1.AllocateIdsResponse = (function() { + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; - /** - * Properties of an AllocateIdsResponse. - * @memberof google.datastore.v1 - * @interface IAllocateIdsResponse - * @property {Array.|null} [keys] AllocateIdsResponse keys - */ + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; - /** - * Constructs a new AllocateIdsResponse. - * @memberof google.datastore.v1 - * @classdesc Represents an AllocateIdsResponse. - * @implements IAllocateIdsResponse - * @constructor - * @param {google.datastore.v1.IAllocateIdsResponse=} [properties] Properties to set - */ - function AllocateIdsResponse(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]]; - } + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * AllocateIdsResponse keys. - * @member {Array.} keys - * @memberof google.datastore.v1.AllocateIdsResponse - * @instance - */ - AllocateIdsResponse.prototype.keys = $util.emptyArray; + return Int64Value; + })(); - /** - * Creates a new AllocateIdsResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.AllocateIdsResponse - * @static - * @param {google.datastore.v1.IAllocateIdsResponse=} [properties] Properties to set - * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse instance - */ - AllocateIdsResponse.create = function create(properties) { - return new AllocateIdsResponse(properties); - }; + protobuf.UInt64Value = (function() { - /** - * Encodes the specified AllocateIdsResponse message. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.AllocateIdsResponse - * @static - * @param {google.datastore.v1.IAllocateIdsResponse} message AllocateIdsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocateIdsResponse.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ - /** - * Encodes the specified AllocateIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.AllocateIdsResponse - * @static - * @param {google.datastore.v1.IAllocateIdsResponse} message AllocateIdsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocateIdsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes an AllocateIdsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.AllocateIdsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocateIdsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - /** - * Decodes an AllocateIdsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AllocateIdsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocateIdsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; - /** - * Verifies an AllocateIdsResponse message. - * @function verify - * @memberof google.datastore.v1.AllocateIdsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllocateIdsResponse.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.datastore.v1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - return null; - }; + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; - /** - * Creates an AllocateIdsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.AllocateIdsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse - */ - AllocateIdsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AllocateIdsResponse) - return object; - var message = new $root.google.datastore.v1.AllocateIdsResponse(); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.datastore.v1.AllocateIdsResponse.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.datastore.v1.AllocateIdsResponse.keys: object expected"); - message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); - } - } - return message; - }; + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from an AllocateIdsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.AllocateIdsResponse - * @static - * @param {google.datastore.v1.AllocateIdsResponse} message AllocateIdsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllocateIdsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; } - return object; - }; - - /** - * Converts this AllocateIdsResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.AllocateIdsResponse - * @instance - * @returns {Object.} JSON object - */ - AllocateIdsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + } + return message; + }; - return AllocateIdsResponse; - })(); + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - v1.ReserveIdsRequest = (function() { + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; - /** - * Properties of a ReserveIdsRequest. - * @memberof google.datastore.v1 - * @interface IReserveIdsRequest - * @property {string|null} [projectId] ReserveIdsRequest projectId - * @property {string|null} [databaseId] ReserveIdsRequest databaseId - * @property {Array.|null} [keys] ReserveIdsRequest keys - */ + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; - /** - * Constructs a new ReserveIdsRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a ReserveIdsRequest. - * @implements IReserveIdsRequest - * @constructor - * @param {google.datastore.v1.IReserveIdsRequest=} [properties] Properties to set - */ - function ReserveIdsRequest(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]]; - } + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; - /** - * ReserveIdsRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.ReserveIdsRequest - * @instance - */ - ReserveIdsRequest.prototype.projectId = ""; + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ReserveIdsRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.ReserveIdsRequest - * @instance - */ - ReserveIdsRequest.prototype.databaseId = ""; + return UInt64Value; + })(); - /** - * ReserveIdsRequest keys. - * @member {Array.} keys - * @memberof google.datastore.v1.ReserveIdsRequest - * @instance - */ - ReserveIdsRequest.prototype.keys = $util.emptyArray; + protobuf.Int32Value = (function() { - /** - * Creates a new ReserveIdsRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.ReserveIdsRequest - * @static - * @param {google.datastore.v1.IReserveIdsRequest=} [properties] Properties to set - * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest instance - */ - ReserveIdsRequest.create = function create(properties) { - return new ReserveIdsRequest(properties); - }; + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ - /** - * Encodes the specified ReserveIdsRequest message. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.ReserveIdsRequest - * @static - * @param {google.datastore.v1.IReserveIdsRequest} message ReserveIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReserveIdsRequest.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - return writer; - }; + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified ReserveIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.ReserveIdsRequest - * @static - * @param {google.datastore.v1.IReserveIdsRequest} message ReserveIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReserveIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; - /** - * Decodes a ReserveIdsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.ReserveIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReserveIdsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 9: - message.databaseId = reader.string(); - break; - case 1: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; - /** - * Decodes a ReserveIdsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.ReserveIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReserveIdsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; - /** - * Verifies a ReserveIdsRequest message. - * @function verify - * @memberof google.datastore.v1.ReserveIdsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReserveIdsRequest.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.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: 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.datastore.v1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } - return null; - }; + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a ReserveIdsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.ReserveIdsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest - */ - ReserveIdsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.ReserveIdsRequest) - return object; - var message = new $root.google.datastore.v1.ReserveIdsRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.datastore.v1.ReserveIdsRequest.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.datastore.v1.ReserveIdsRequest.keys: object expected"); - message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); - } + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a ReserveIdsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ReserveIdsRequest - * @static - * @param {google.datastore.v1.ReserveIdsRequest} message ReserveIdsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReserveIdsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) { - object.projectId = ""; - object.databaseId = ""; - } - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) return object; - }; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; - /** - * Converts this ReserveIdsRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.ReserveIdsRequest - * @instance - * @returns {Object.} JSON object - */ - ReserveIdsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; - return ReserveIdsRequest; - })(); + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v1.ReserveIdsResponse = (function() { + return Int32Value; + })(); - /** - * Properties of a ReserveIdsResponse. - * @memberof google.datastore.v1 - * @interface IReserveIdsResponse - */ + protobuf.UInt32Value = (function() { - /** - * Constructs a new ReserveIdsResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a ReserveIdsResponse. - * @implements IReserveIdsResponse - * @constructor - * @param {google.datastore.v1.IReserveIdsResponse=} [properties] Properties to set - */ - function ReserveIdsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ - /** - * Creates a new ReserveIdsResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {google.datastore.v1.IReserveIdsResponse=} [properties] Properties to set - * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse instance - */ - ReserveIdsResponse.create = function create(properties) { - return new ReserveIdsResponse(properties); - }; + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified ReserveIdsResponse message. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {google.datastore.v1.IReserveIdsResponse} message ReserveIdsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReserveIdsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; - /** - * Encodes the specified ReserveIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {google.datastore.v1.IReserveIdsResponse} message ReserveIdsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReserveIdsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ReserveIdsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReserveIdsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a ReserveIdsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReserveIdsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ReserveIdsResponse message. - * @function verify - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReserveIdsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; - /** - * Creates a ReserveIdsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse - */ - ReserveIdsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.ReserveIdsResponse) - return object; - return new $root.google.datastore.v1.ReserveIdsResponse(); - }; + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; - /** - * Creates a plain object from a ReserveIdsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {google.datastore.v1.ReserveIdsResponse} message ReserveIdsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReserveIdsResponse.toObject = function toObject() { - return {}; - }; + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; - /** - * Converts this ReserveIdsResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.ReserveIdsResponse - * @instance - * @returns {Object.} JSON object - */ - ReserveIdsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ReserveIdsResponse; - })(); + return UInt32Value; + })(); - v1.Mutation = (function() { + protobuf.BoolValue = (function() { - /** - * Properties of a Mutation. - * @memberof google.datastore.v1 - * @interface IMutation - * @property {google.datastore.v1.IEntity|null} [insert] Mutation insert - * @property {google.datastore.v1.IEntity|null} [update] Mutation update - * @property {google.datastore.v1.IEntity|null} [upsert] Mutation upsert - * @property {google.datastore.v1.IKey|null} ["delete"] Mutation delete - * @property {number|Long|null} [baseVersion] Mutation baseVersion - * @property {google.protobuf.ITimestamp|null} [updateTime] Mutation updateTime - */ + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ - /** - * Constructs a new Mutation. - * @memberof google.datastore.v1 - * @classdesc Represents a Mutation. - * @implements IMutation - * @constructor - * @param {google.datastore.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]]; - } + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; - /** - * Mutation insert. - * @member {google.datastore.v1.IEntity|null|undefined} insert - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.insert = null; + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; - /** - * Mutation update. - * @member {google.datastore.v1.IEntity|null|undefined} update - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.update = null; + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Mutation upsert. - * @member {google.datastore.v1.IEntity|null|undefined} upsert - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.upsert = null; + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Mutation delete. - * @member {google.datastore.v1.IKey|null|undefined} delete - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype["delete"] = null; + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Mutation baseVersion. - * @member {number|Long|null|undefined} baseVersion - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.baseVersion = null; + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; - /** - * Mutation updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.updateTime = null; + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; - /** - * Mutation operation. - * @member {"insert"|"update"|"upsert"|"delete"|undefined} operation - * @memberof google.datastore.v1.Mutation - * @instance - */ - Object.defineProperty(Mutation.prototype, "operation", { - get: $util.oneOfGetter($oneOfFields = ["insert", "update", "upsert", "delete"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Mutation conflictDetectionStrategy. - * @member {"baseVersion"|"updateTime"|undefined} conflictDetectionStrategy - * @memberof google.datastore.v1.Mutation - * @instance - */ - Object.defineProperty(Mutation.prototype, "conflictDetectionStrategy", { - get: $util.oneOfGetter($oneOfFields = ["baseVersion", "updateTime"]), - set: $util.oneOfSetter($oneOfFields) - }); + return BoolValue; + })(); - /** - * Creates a new Mutation instance using the specified properties. - * @function create - * @memberof google.datastore.v1.Mutation - * @static - * @param {google.datastore.v1.IMutation=} [properties] Properties to set - * @returns {google.datastore.v1.Mutation} Mutation instance - */ - Mutation.create = function create(properties) { - return new Mutation(properties); - }; + protobuf.StringValue = (function() { - /** - * Encodes the specified Mutation message. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.Mutation - * @static - * @param {google.datastore.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.datastore.v1.Entity.encode(message.insert, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.datastore.v1.Entity.encode(message.update, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.upsert != null && Object.hasOwnProperty.call(message, "upsert")) - $root.google.datastore.v1.Entity.encode(message.upsert, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - $root.google.datastore.v1.Key.encode(message["delete"], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.baseVersion != null && Object.hasOwnProperty.call(message, "baseVersion")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.baseVersion); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.Mutation - * @static - * @param {google.datastore.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(); - }; + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; - /** - * Decodes a Mutation message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.Mutation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Mutation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: - message.insert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); - break; - case 5: - message.update = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); - break; - case 6: - message.upsert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); - break; - case 7: - message["delete"] = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); - break; - case 8: - message.baseVersion = reader.int64(); - break; - case 11: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; - /** - * Decodes a Mutation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.Mutation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; - /** - * Verifies a Mutation message. - * @function verify - * @memberof google.datastore.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.datastore.v1.Entity.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.datastore.v1.Entity.verify(message.update); - if (error) - return "update." + error; - } - } - if (message.upsert != null && message.hasOwnProperty("upsert")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.datastore.v1.Entity.verify(message.upsert); - if (error) - return "upsert." + error; - } - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.datastore.v1.Key.verify(message["delete"]); - if (error) - return "delete." + error; - } - } - if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) { - properties.conflictDetectionStrategy = 1; - if (!$util.isInteger(message.baseVersion) && !(message.baseVersion && $util.isInteger(message.baseVersion.low) && $util.isInteger(message.baseVersion.high))) - return "baseVersion: integer|Long expected"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - if (properties.conflictDetectionStrategy === 1) - return "conflictDetectionStrategy: multiple values"; - properties.conflictDetectionStrategy = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - } - return null; - }; + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a Mutation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.Mutation - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.Mutation} Mutation - */ - Mutation.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Mutation) - return object; - var message = new $root.google.datastore.v1.Mutation(); - if (object.insert != null) { - if (typeof object.insert !== "object") - throw TypeError(".google.datastore.v1.Mutation.insert: object expected"); - message.insert = $root.google.datastore.v1.Entity.fromObject(object.insert); - } - if (object.update != null) { - if (typeof object.update !== "object") - throw TypeError(".google.datastore.v1.Mutation.update: object expected"); - message.update = $root.google.datastore.v1.Entity.fromObject(object.update); - } - if (object.upsert != null) { - if (typeof object.upsert !== "object") - throw TypeError(".google.datastore.v1.Mutation.upsert: object expected"); - message.upsert = $root.google.datastore.v1.Entity.fromObject(object.upsert); - } - if (object["delete"] != null) { - if (typeof object["delete"] !== "object") - throw TypeError(".google.datastore.v1.Mutation.delete: object expected"); - message["delete"] = $root.google.datastore.v1.Key.fromObject(object["delete"]); - } - if (object.baseVersion != null) - if ($util.Long) - (message.baseVersion = $util.Long.fromValue(object.baseVersion)).unsigned = false; - else if (typeof object.baseVersion === "string") - message.baseVersion = parseInt(object.baseVersion, 10); - else if (typeof object.baseVersion === "number") - message.baseVersion = object.baseVersion; - else if (typeof object.baseVersion === "object") - message.baseVersion = new $util.LongBits(object.baseVersion.low >>> 0, object.baseVersion.high >>> 0).toNumber(); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.datastore.v1.Mutation.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a Mutation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.Mutation - * @static - * @param {google.datastore.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.datastore.v1.Entity.toObject(message.insert, options); - if (options.oneofs) - object.operation = "insert"; - } - if (message.update != null && message.hasOwnProperty("update")) { - object.update = $root.google.datastore.v1.Entity.toObject(message.update, options); - if (options.oneofs) - object.operation = "update"; - } - if (message.upsert != null && message.hasOwnProperty("upsert")) { - object.upsert = $root.google.datastore.v1.Entity.toObject(message.upsert, options); - if (options.oneofs) - object.operation = "upsert"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = $root.google.datastore.v1.Key.toObject(message["delete"], options); - if (options.oneofs) - object.operation = "delete"; - } - if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) { - if (typeof message.baseVersion === "number") - object.baseVersion = options.longs === String ? String(message.baseVersion) : message.baseVersion; - else - object.baseVersion = options.longs === String ? $util.Long.prototype.toString.call(message.baseVersion) : options.longs === Number ? new $util.LongBits(message.baseVersion.low >>> 0, message.baseVersion.high >>> 0).toNumber() : message.baseVersion; - if (options.oneofs) - object.conflictDetectionStrategy = "baseVersion"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (options.oneofs) - object.conflictDetectionStrategy = "updateTime"; - } + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) return object; - }; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; - /** - * Converts this Mutation to JSON. - * @function toJSON - * @memberof google.datastore.v1.Mutation - * @instance - * @returns {Object.} JSON object - */ - Mutation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; - return Mutation; - })(); + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - v1.MutationResult = (function() { + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; - /** - * Properties of a MutationResult. - * @memberof google.datastore.v1 - * @interface IMutationResult - * @property {google.datastore.v1.IKey|null} [key] MutationResult key - * @property {number|Long|null} [version] MutationResult version - * @property {google.protobuf.ITimestamp|null} [updateTime] MutationResult updateTime - * @property {boolean|null} [conflictDetected] MutationResult conflictDetected - */ + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; - /** - * Constructs a new MutationResult. - * @memberof google.datastore.v1 - * @classdesc Represents a MutationResult. - * @implements IMutationResult - * @constructor - * @param {google.datastore.v1.IMutationResult=} [properties] Properties to set - */ - function MutationResult(properties) { - if (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 plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; - /** - * MutationResult key. - * @member {google.datastore.v1.IKey|null|undefined} key - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.key = null; + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * MutationResult version. - * @member {number|Long} version - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + return BytesValue; + })(); - /** - * MutationResult updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.updateTime = null; + protobuf.Any = (function() { - /** - * MutationResult conflictDetected. - * @member {boolean} conflictDetected - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.conflictDetected = false; + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ - /** - * Creates a new MutationResult instance using the specified properties. - * @function create - * @memberof google.datastore.v1.MutationResult - * @static - * @param {google.datastore.v1.IMutationResult=} [properties] Properties to set - * @returns {google.datastore.v1.MutationResult} MutationResult instance - */ - MutationResult.create = function create(properties) { - return new MutationResult(properties); - }; + /** + * 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]]; + } - /** - * Encodes the specified MutationResult message. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.MutationResult - * @static - * @param {google.datastore.v1.IMutationResult} message MutationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.datastore.v1.Key.encode(message.key, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.version); - if (message.conflictDetected != null && Object.hasOwnProperty.call(message, "conflictDetected")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.conflictDetected); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; - /** - * Encodes the specified MutationResult message, length delimited. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.MutationResult - * @static - * @param {google.datastore.v1.IMutationResult} message MutationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); - /** - * Decodes a MutationResult message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.MutationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.MutationResult} MutationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.MutationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); - break; - case 4: - message.version = reader.int64(); - break; - case 6: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.conflictDetected = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes a MutationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.MutationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.MutationResult} MutationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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; + }; - /** - * Verifies a MutationResult message. - * @function verify - * @memberof google.datastore.v1.MutationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MutationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.datastore.v1.Key.verify(message.key); - if (error) - return "key." + error; - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) - return "version: integer|Long expected"; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.conflictDetected != null && message.hasOwnProperty("conflictDetected")) - if (typeof message.conflictDetected !== "boolean") - return "conflictDetected: boolean expected"; - return null; - }; + /** + * 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(); + }; - /** - * Creates a MutationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.MutationResult - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.MutationResult} MutationResult - */ - MutationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.MutationResult) - return object; - var message = new $root.google.datastore.v1.MutationResult(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.datastore.v1.MutationResult.key: object expected"); - message.key = $root.google.datastore.v1.Key.fromObject(object.key); - } - if (object.version != null) - if ($util.Long) - (message.version = $util.Long.fromValue(object.version)).unsigned = false; - else if (typeof object.version === "string") - message.version = parseInt(object.version, 10); - else if (typeof object.version === "number") - message.version = object.version; - else if (typeof object.version === "object") - message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.datastore.v1.MutationResult.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + /** + * 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) { + 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(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; } - if (object.conflictDetected != null) - message.conflictDetected = Boolean(object.conflictDetected); - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a MutationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.MutationResult - * @static - * @param {google.datastore.v1.MutationResult} message MutationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MutationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.key = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.version = options.longs === String ? "0" : 0; - object.conflictDetected = false; - object.updateTime = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.datastore.v1.Key.toObject(message.key, options); - if (message.version != null && message.hasOwnProperty("version")) - if (typeof message.version === "number") - object.version = options.longs === String ? String(message.version) : message.version; - else - object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; - if (message.conflictDetected != null && message.hasOwnProperty("conflictDetected")) - object.conflictDetected = message.conflictDetected; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + /** + * 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) + 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 MutationResult to JSON. - * @function toJSON - * @memberof google.datastore.v1.MutationResult - * @instance - * @returns {Object.} JSON object - */ - MutationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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); + }; - return MutationResult; - })(); + return Any; + })(); - v1.ReadOptions = (function() { + protobuf.Duration = (function() { - /** - * Properties of a ReadOptions. - * @memberof google.datastore.v1 - * @interface IReadOptions - * @property {google.datastore.v1.ReadOptions.ReadConsistency|null} [readConsistency] ReadOptions readConsistency - * @property {Uint8Array|null} [transaction] ReadOptions transaction - * @property {google.protobuf.ITimestamp|null} [readTime] ReadOptions readTime - */ + /** + * 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 ReadOptions. - * @memberof google.datastore.v1 - * @classdesc Represents a ReadOptions. - * @implements IReadOptions - * @constructor - * @param {google.datastore.v1.IReadOptions=} [properties] Properties to set - */ - function ReadOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new 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]]; + } - /** - * ReadOptions readConsistency. - * @member {google.datastore.v1.ReadOptions.ReadConsistency|null|undefined} readConsistency - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - ReadOptions.prototype.readConsistency = null; + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * ReadOptions transaction. - * @member {Uint8Array|null|undefined} transaction - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - ReadOptions.prototype.transaction = null; + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; - /** - * ReadOptions readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - ReadOptions.prototype.readTime = null; + /** + * 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); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * 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; + }; - /** - * ReadOptions consistencyType. - * @member {"readConsistency"|"transaction"|"readTime"|undefined} consistencyType - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - Object.defineProperty(ReadOptions.prototype, "consistencyType", { - get: $util.oneOfGetter($oneOfFields = ["readConsistency", "transaction", "readTime"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Duration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Duration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Duration message. + * @function verify + * @memberof google.protobuf.Duration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Duration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Duration + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Duration} Duration + */ + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) + return object; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; - /** - * Creates a new ReadOptions instance using the specified properties. - * @function create - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {google.datastore.v1.IReadOptions=} [properties] Properties to set - * @returns {google.datastore.v1.ReadOptions} ReadOptions instance - */ - ReadOptions.create = function create(properties) { - return new ReadOptions(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified ReadOptions message. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {google.datastore.v1.IReadOptions} message ReadOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.readConsistency != null && Object.hasOwnProperty.call(message, "readConsistency")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.readConsistency); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transaction); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * 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); + }; - /** - * Encodes the specified ReadOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {google.datastore.v1.IReadOptions} message ReadOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return Duration; + })(); - /** - * Decodes a ReadOptions message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.ReadOptions} ReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReadOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.readConsistency = reader.int32(); - break; - case 2: - message.transaction = reader.bytes(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + protobuf.Empty = (function() { - /** - * Decodes a ReadOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ReadOptions} ReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ - /** - * Verifies a ReadOptions message. - * @function verify - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { - properties.consistencyType = 1; - switch (message.readConsistency) { - default: - return "readConsistency: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - if (properties.consistencyType === 1) - return "consistencyType: multiple values"; - properties.consistencyType = 1; - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - if (properties.consistencyType === 1) - return "consistencyType: multiple values"; - properties.consistencyType = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - } - return null; - }; + /** + * 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 ReadOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.ReadOptions} ReadOptions - */ - ReadOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.ReadOptions) - return object; - var message = new $root.google.datastore.v1.ReadOptions(); - switch (object.readConsistency) { - case "READ_CONSISTENCY_UNSPECIFIED": - case 0: - message.readConsistency = 0; - break; - case "STRONG": - case 1: - message.readConsistency = 1; - break; - case "EVENTUAL": - case 2: - message.readConsistency = 2; - break; - } - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length) - message.transaction = object.transaction; - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.ReadOptions.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - return message; - }; + /** + * 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; + }; - /** - * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {google.datastore.v1.ReadOptions} message ReadOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { - object.readConsistency = options.enums === String ? $root.google.datastore.v1.ReadOptions.ReadConsistency[message.readConsistency] : message.readConsistency; - if (options.oneofs) - object.consistencyType = "readConsistency"; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (options.oneofs) - object.consistencyType = "transaction"; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (options.oneofs) - object.consistencyType = "readTime"; - } - return object; - }; + /** + * 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(); + }; - /** - * Converts this ReadOptions to JSON. - * @function toJSON - * @memberof google.datastore.v1.ReadOptions - * @instance - * @returns {Object.} JSON object - */ - ReadOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ReadConsistency enum. - * @name google.datastore.v1.ReadOptions.ReadConsistency - * @enum {number} - * @property {number} READ_CONSISTENCY_UNSPECIFIED=0 READ_CONSISTENCY_UNSPECIFIED value - * @property {number} STRONG=1 STRONG value - * @property {number} EVENTUAL=2 EVENTUAL value - */ - ReadOptions.ReadConsistency = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "READ_CONSISTENCY_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRONG"] = 1; - values[valuesById[2] = "EVENTUAL"] = 2; - return values; - })(); + /** + * 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()); + }; - return ReadOptions; - })(); + /** + * 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; + }; - v1.TransactionOptions = (function() { + /** + * 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(); + }; - /** - * Properties of a TransactionOptions. - * @memberof google.datastore.v1 - * @interface ITransactionOptions - * @property {google.datastore.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite - * @property {google.datastore.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly - */ + /** + * 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 {}; + }; - /** - * Constructs a new TransactionOptions. - * @memberof google.datastore.v1 - * @classdesc Represents a TransactionOptions. - * @implements ITransactionOptions - * @constructor - * @param {google.datastore.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]]; - } + /** + * 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); + }; - /** - * TransactionOptions readWrite. - * @member {google.datastore.v1.TransactionOptions.IReadWrite|null|undefined} readWrite - * @memberof google.datastore.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readWrite = null; + return Empty; + })(); - /** - * TransactionOptions readOnly. - * @member {google.datastore.v1.TransactionOptions.IReadOnly|null|undefined} readOnly - * @memberof google.datastore.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readOnly = null; + return protobuf; + })(); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + google.datastore = (function() { - /** - * TransactionOptions mode. - * @member {"readWrite"|"readOnly"|undefined} mode - * @memberof google.datastore.v1.TransactionOptions - * @instance - */ - Object.defineProperty(TransactionOptions.prototype, "mode", { - get: $util.oneOfGetter($oneOfFields = ["readWrite", "readOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Namespace datastore. + * @memberof google + * @namespace + */ + var datastore = {}; - /** - * Creates a new TransactionOptions instance using the specified properties. - * @function create - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.v1.ITransactionOptions=} [properties] Properties to set - * @returns {google.datastore.v1.TransactionOptions} TransactionOptions instance - */ - TransactionOptions.create = function create(properties) { - return new TransactionOptions(properties); - }; + datastore.v1 = (function() { - /** - * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Namespace v1. + * @memberof google.datastore + * @namespace + */ + var v1 = {}; - /** - * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.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(); - }; + v1.AggregationResult = (function() { /** - * Decodes a TransactionOptions message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.TransactionOptions} TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Properties of an AggregationResult. + * @memberof google.datastore.v1 + * @interface IAggregationResult + * @property {Object.|null} [aggregateProperties] AggregationResult aggregateProperties */ - TransactionOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); - break; - case 2: - message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); - 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.datastore.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.TransactionOptions} TransactionOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Constructs a new AggregationResult. + * @memberof google.datastore.v1 + * @classdesc Represents an AggregationResult. + * @implements IAggregationResult + * @constructor + * @param {google.datastore.v1.IAggregationResult=} [properties] Properties to set */ - TransactionOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + function AggregationResult(properties) { + this.aggregateProperties = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Verifies a TransactionOptions message. - * @function verify - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * AggregationResult aggregateProperties. + * @member {Object.} aggregateProperties + * @memberof google.datastore.v1.AggregationResult + * @instance */ - 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.datastore.v1.TransactionOptions.ReadWrite.verify(message.readWrite); - if (error) - return "readWrite." + error; - } - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - if (properties.mode === 1) - return "mode: multiple values"; - properties.mode = 1; - { - var error = $root.google.datastore.v1.TransactionOptions.ReadOnly.verify(message.readOnly); - if (error) - return "readOnly." + error; - } - } - return null; - }; + AggregationResult.prototype.aggregateProperties = $util.emptyObject; /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.TransactionOptions + * Creates a new AggregationResult instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AggregationResult * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.TransactionOptions} TransactionOptions + * @param {google.datastore.v1.IAggregationResult=} [properties] Properties to set + * @returns {google.datastore.v1.AggregationResult} AggregationResult instance */ - TransactionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.TransactionOptions) - return object; - var message = new $root.google.datastore.v1.TransactionOptions(); - if (object.readWrite != null) { - if (typeof object.readWrite !== "object") - throw TypeError(".google.datastore.v1.TransactionOptions.readWrite: object expected"); - message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); - } - if (object.readOnly != null) { - if (typeof object.readOnly !== "object") - throw TypeError(".google.datastore.v1.TransactionOptions.readOnly: object expected"); - message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); - } - return message; + AggregationResult.create = function create(properties) { + return new AggregationResult(properties); }; /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.TransactionOptions + * Encodes the specified AggregationResult message. Does not implicitly {@link google.datastore.v1.AggregationResult.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AggregationResult * @static - * @param {google.datastore.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 (message.readWrite != null && message.hasOwnProperty("readWrite")) { - object.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); - if (options.oneofs) - object.mode = "readWrite"; - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - object.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); - if (options.oneofs) - object.mode = "readOnly"; - } - return object; - }; - - /** - * Converts this TransactionOptions to JSON. - * @function toJSON - * @memberof google.datastore.v1.TransactionOptions - * @instance - * @returns {Object.} JSON object + * @param {google.datastore.v1.IAggregationResult} message AggregationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - TransactionOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - TransactionOptions.ReadWrite = (function() { - - /** - * Properties of a ReadWrite. - * @memberof google.datastore.v1.TransactionOptions - * @interface IReadWrite - * @property {Uint8Array|null} [previousTransaction] ReadWrite previousTransaction - */ - - /** - * Constructs a new ReadWrite. - * @memberof google.datastore.v1.TransactionOptions - * @classdesc Represents a ReadWrite. - * @implements IReadWrite - * @constructor - * @param {google.datastore.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 previousTransaction. - * @member {Uint8Array} previousTransaction - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @instance - */ - ReadWrite.prototype.previousTransaction = $util.newBuffer([]); - - /** - * Creates a new ReadWrite instance using the specified properties. - * @function create - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set - * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite instance - */ - ReadWrite.create = function create(properties) { - return new ReadWrite(properties); - }; - - /** - * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.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.previousTransaction != null && Object.hasOwnProperty.call(message, "previousTransaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.previousTransaction); - return writer; - }; - - /** - * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.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.datastore.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.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.previousTransaction = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } + AggregationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aggregateProperties != null && Object.hasOwnProperty.call(message, "aggregateProperties")) + for (var keys = Object.keys(message.aggregateProperties), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.datastore.v1.Value.encode(message.aggregateProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } - return message; - }; + return writer; + }; - /** - * Decodes a ReadWrite message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * Encodes the specified AggregationResult message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {google.datastore.v1.IAggregationResult} message AggregationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a ReadWrite message. - * @function verify - * @memberof google.datastore.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.previousTransaction != null && message.hasOwnProperty("previousTransaction")) - if (!(message.previousTransaction && typeof message.previousTransaction.length === "number" || $util.isString(message.previousTransaction))) - return "previousTransaction: buffer expected"; - return null; - }; + /** + * Decodes an AggregationResult message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AggregationResult} AggregationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationResult(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (message.aggregateProperties === $util.emptyObject) + message.aggregateProperties = {}; + 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.datastore.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.aggregateProperties[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite - */ - ReadWrite.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadWrite) - return object; - var message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); - if (object.previousTransaction != null) - if (typeof object.previousTransaction === "string") - $util.base64.decode(object.previousTransaction, message.previousTransaction = $util.newBuffer($util.base64.length(object.previousTransaction)), 0); - else if (object.previousTransaction.length) - message.previousTransaction = object.previousTransaction; - return message; - }; + /** + * Decodes an AggregationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AggregationResult} AggregationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.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) - if (options.bytes === String) - object.previousTransaction = ""; - else { - object.previousTransaction = []; - if (options.bytes !== Array) - object.previousTransaction = $util.newBuffer(object.previousTransaction); - } - if (message.previousTransaction != null && message.hasOwnProperty("previousTransaction")) - object.previousTransaction = options.bytes === String ? $util.base64.encode(message.previousTransaction, 0, message.previousTransaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.previousTransaction) : message.previousTransaction; + /** + * Verifies an AggregationResult message. + * @function verify + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aggregateProperties != null && message.hasOwnProperty("aggregateProperties")) { + if (!$util.isObject(message.aggregateProperties)) + return "aggregateProperties: object expected"; + var key = Object.keys(message.aggregateProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.datastore.v1.Value.verify(message.aggregateProperties[key[i]]); + if (error) + return "aggregateProperties." + error; + } + } + return null; + }; + + /** + * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationResult} AggregationResult + */ + AggregationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationResult) return object; - }; + var message = new $root.google.datastore.v1.AggregationResult(); + if (object.aggregateProperties) { + if (typeof object.aggregateProperties !== "object") + throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); + message.aggregateProperties = {}; + for (var keys = Object.keys(object.aggregateProperties), i = 0; i < keys.length; ++i) { + if (typeof object.aggregateProperties[keys[i]] !== "object") + throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); + message.aggregateProperties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.aggregateProperties[keys[i]]); + } + } + return message; + }; - /** - * Converts this ReadWrite to JSON. - * @function toJSON - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @instance - * @returns {Object.} JSON object - */ - ReadWrite.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {google.datastore.v1.AggregationResult} message AggregationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.aggregateProperties = {}; + var keys2; + if (message.aggregateProperties && (keys2 = Object.keys(message.aggregateProperties)).length) { + object.aggregateProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.aggregateProperties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.aggregateProperties[keys2[j]], options); + } + return object; + }; - return ReadWrite; - })(); + /** + * Converts this AggregationResult to JSON. + * @function toJSON + * @memberof google.datastore.v1.AggregationResult + * @instance + * @returns {Object.} JSON object + */ + AggregationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - TransactionOptions.ReadOnly = (function() { + return AggregationResult; + })(); - /** - * Properties of a ReadOnly. - * @memberof google.datastore.v1.TransactionOptions - * @interface IReadOnly - * @property {google.protobuf.ITimestamp|null} [readTime] ReadOnly readTime - */ + v1.AggregationResultBatch = (function() { - /** - * Constructs a new ReadOnly. - * @memberof google.datastore.v1.TransactionOptions - * @classdesc Represents a ReadOnly. - * @implements IReadOnly - * @constructor - * @param {google.datastore.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]]; - } + /** + * Properties of an AggregationResultBatch. + * @memberof google.datastore.v1 + * @interface IAggregationResultBatch + * @property {Array.|null} [aggregationResults] AggregationResultBatch aggregationResults + * @property {google.datastore.v1.QueryResultBatch.MoreResultsType|null} [moreResults] AggregationResultBatch moreResults + * @property {google.protobuf.ITimestamp|null} [readTime] AggregationResultBatch readTime + */ - /** - * ReadOnly readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.readTime = null; + /** + * Constructs a new AggregationResultBatch. + * @memberof google.datastore.v1 + * @classdesc Represents an AggregationResultBatch. + * @implements IAggregationResultBatch + * @constructor + * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set + */ + function AggregationResultBatch(properties) { + this.aggregationResults = []; + if (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 ReadOnly instance using the specified properties. - * @function create - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.v1.TransactionOptions.IReadOnly=} [properties] Properties to set - * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly instance - */ - ReadOnly.create = function create(properties) { - return new ReadOnly(properties); - }; + /** + * AggregationResultBatch aggregationResults. + * @member {Array.} aggregationResults + * @memberof google.datastore.v1.AggregationResultBatch + * @instance + */ + AggregationResultBatch.prototype.aggregationResults = $util.emptyArray; + + /** + * AggregationResultBatch moreResults. + * @member {google.datastore.v1.QueryResultBatch.MoreResultsType} moreResults + * @memberof google.datastore.v1.AggregationResultBatch + * @instance + */ + AggregationResultBatch.prototype.moreResults = 0; + + /** + * AggregationResultBatch readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.AggregationResultBatch + * @instance + */ + AggregationResultBatch.prototype.readTime = null; - /** - * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.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.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Creates a new AggregationResultBatch instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch instance + */ + AggregationResultBatch.create = function create(properties) { + return new AggregationResultBatch(properties); + }; - /** - * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.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(); - }; + /** + * Encodes the specified AggregationResultBatch message. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationResultBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aggregationResults != null && message.aggregationResults.length) + for (var i = 0; i < message.aggregationResults.length; ++i) + $root.google.datastore.v1.AggregationResult.encode(message.aggregationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.moreResults != null && Object.hasOwnProperty.call(message, "moreResults")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.moreResults); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Decodes a ReadOnly message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.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.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Encodes the specified AggregationResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationResultBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregationResultBatch message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResultBatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationResultBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.aggregationResults && message.aggregationResults.length)) + message.aggregationResults = []; + message.aggregationResults.push($root.google.datastore.v1.AggregationResult.decode(reader, reader.uint32())); + break; + case 2: + message.moreResults = reader.int32(); + break; + case 3: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a ReadOnly message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * Decodes an AggregationResultBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResultBatch.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.datastore.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"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + /** + * Verifies an AggregationResultBatch message. + * @function verify + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregationResultBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aggregationResults != null && message.hasOwnProperty("aggregationResults")) { + if (!Array.isArray(message.aggregationResults)) + return "aggregationResults: array expected"; + for (var i = 0; i < message.aggregationResults.length; ++i) { + var error = $root.google.datastore.v1.AggregationResult.verify(message.aggregationResults[i]); if (error) - return "readTime." + error; + return "aggregationResults." + error; } - return null; - }; - - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly - */ - ReadOnly.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadOnly) - return object; - var message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.TransactionOptions.ReadOnly.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + if (message.moreResults != null && message.hasOwnProperty("moreResults")) + switch (message.moreResults) { + default: + return "moreResults: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 3: + break; } - return message; - }; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; + }; - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.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.readTime = null; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + /** + * Creates an AggregationResultBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + */ + AggregationResultBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationResultBatch) return object; - }; - - /** - * Converts this ReadOnly to JSON. - * @function toJSON - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @instance - * @returns {Object.} JSON object - */ - ReadOnly.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + var message = new $root.google.datastore.v1.AggregationResultBatch(); + if (object.aggregationResults) { + if (!Array.isArray(object.aggregationResults)) + throw TypeError(".google.datastore.v1.AggregationResultBatch.aggregationResults: array expected"); + message.aggregationResults = []; + for (var i = 0; i < object.aggregationResults.length; ++i) { + if (typeof object.aggregationResults[i] !== "object") + throw TypeError(".google.datastore.v1.AggregationResultBatch.aggregationResults: object expected"); + message.aggregationResults[i] = $root.google.datastore.v1.AggregationResult.fromObject(object.aggregationResults[i]); + } + } + switch (object.moreResults) { + case "MORE_RESULTS_TYPE_UNSPECIFIED": + case 0: + message.moreResults = 0; + break; + case "NOT_FINISHED": + case 1: + message.moreResults = 1; + break; + case "MORE_RESULTS_AFTER_LIMIT": + case 2: + message.moreResults = 2; + break; + case "MORE_RESULTS_AFTER_CURSOR": + case 4: + message.moreResults = 4; + break; + case "NO_MORE_RESULTS": + case 3: + message.moreResults = 3; + break; + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.AggregationResultBatch.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + return message; + }; - return ReadOnly; - })(); + /** + * Creates a plain object from an AggregationResultBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {google.datastore.v1.AggregationResultBatch} message AggregationResultBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregationResultBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aggregationResults = []; + if (options.defaults) { + object.moreResults = options.enums === String ? "MORE_RESULTS_TYPE_UNSPECIFIED" : 0; + object.readTime = null; + } + if (message.aggregationResults && message.aggregationResults.length) { + object.aggregationResults = []; + for (var j = 0; j < message.aggregationResults.length; ++j) + object.aggregationResults[j] = $root.google.datastore.v1.AggregationResult.toObject(message.aggregationResults[j], options); + } + if (message.moreResults != null && message.hasOwnProperty("moreResults")) + object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + return object; + }; - return TransactionOptions; + /** + * Converts this AggregationResultBatch to JSON. + * @function toJSON + * @memberof google.datastore.v1.AggregationResultBatch + * @instance + * @returns {Object.} JSON object + */ + AggregationResultBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AggregationResultBatch; })(); v1.PartitionId = (function() { @@ -11130,6 +12673,7 @@ * @memberof google.datastore.v1 * @interface IPartitionId * @property {string|null} [projectId] PartitionId projectId + * @property {string|null} [databaseId] PartitionId databaseId * @property {string|null} [namespaceId] PartitionId namespaceId */ @@ -11156,6 +12700,14 @@ */ PartitionId.prototype.projectId = ""; + /** + * PartitionId databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.PartitionId + * @instance + */ + PartitionId.prototype.databaseId = ""; + /** * PartitionId namespaceId. * @member {string} namespaceId @@ -11190,6 +12742,8 @@ writer = $Writer.create(); 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.namespaceId != null && Object.hasOwnProperty.call(message, "namespaceId")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.namespaceId); return writer; @@ -11229,6 +12783,9 @@ case 2: message.projectId = reader.string(); break; + case 3: + message.databaseId = reader.string(); + break; case 4: message.namespaceId = reader.string(); break; @@ -11270,6 +12827,9 @@ 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.namespaceId != null && message.hasOwnProperty("namespaceId")) if (!$util.isString(message.namespaceId)) return "namespaceId: string expected"; @@ -11290,6 +12850,8 @@ var message = new $root.google.datastore.v1.PartitionId(); if (object.projectId != null) message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); if (object.namespaceId != null) message.namespaceId = String(object.namespaceId); return message; @@ -11310,10 +12872,13 @@ var object = {}; if (options.defaults) { object.projectId = ""; + object.databaseId = ""; object.namespaceId = ""; } if (message.projectId != null && message.hasOwnProperty("projectId")) object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; if (message.namespaceId != null && message.hasOwnProperty("namespaceId")) object.namespaceId = message.namespaceId; return object; @@ -11832,28 +13397,247 @@ return PathElement; })(); - return Key; + return Key; + })(); + + v1.ArrayValue = (function() { + + /** + * Properties of an ArrayValue. + * @memberof google.datastore.v1 + * @interface IArrayValue + * @property {Array.|null} [values] ArrayValue values + */ + + /** + * Constructs a new ArrayValue. + * @memberof google.datastore.v1 + * @classdesc Represents an ArrayValue. + * @implements IArrayValue + * @constructor + * @param {google.datastore.v1.IArrayValue=} [properties] Properties to set + */ + function ArrayValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArrayValue values. + * @member {Array.} values + * @memberof google.datastore.v1.ArrayValue + * @instance + */ + ArrayValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ArrayValue instance using the specified properties. + * @function create + * @memberof google.datastore.v1.ArrayValue + * @static + * @param {google.datastore.v1.IArrayValue=} [properties] Properties to set + * @returns {google.datastore.v1.ArrayValue} ArrayValue instance + */ + ArrayValue.create = function create(properties) { + return new ArrayValue(properties); + }; + + /** + * Encodes the specified ArrayValue message. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.ArrayValue + * @static + * @param {google.datastore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.datastore.v1.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.ArrayValue + * @static + * @param {google.datastore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ArrayValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.datastore.v1.Value.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.ArrayValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.ArrayValue} ArrayValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArrayValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArrayValue message. + * @function verify + * @memberof google.datastore.v1.ArrayValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArrayValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.datastore.v1.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.ArrayValue + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.ArrayValue} ArrayValue + */ + ArrayValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.ArrayValue) + return object; + var message = new $root.google.datastore.v1.ArrayValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.datastore.v1.ArrayValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.datastore.v1.ArrayValue.values: object expected"); + message.values[i] = $root.google.datastore.v1.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.ArrayValue + * @static + * @param {google.datastore.v1.ArrayValue} message ArrayValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArrayValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.datastore.v1.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ArrayValue to JSON. + * @function toJSON + * @memberof google.datastore.v1.ArrayValue + * @instance + * @returns {Object.} JSON object + */ + ArrayValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ArrayValue; })(); - v1.ArrayValue = (function() { + v1.Value = (function() { /** - * Properties of an ArrayValue. + * Properties of a Value. * @memberof google.datastore.v1 - * @interface IArrayValue - * @property {Array.|null} [values] ArrayValue values + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {boolean|null} [booleanValue] Value booleanValue + * @property {number|Long|null} [integerValue] Value integerValue + * @property {number|null} [doubleValue] Value doubleValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue + * @property {google.datastore.v1.IKey|null} [keyValue] Value keyValue + * @property {string|null} [stringValue] Value stringValue + * @property {Uint8Array|null} [blobValue] Value blobValue + * @property {google.type.ILatLng|null} [geoPointValue] Value geoPointValue + * @property {google.datastore.v1.IEntity|null} [entityValue] Value entityValue + * @property {google.datastore.v1.IArrayValue|null} [arrayValue] Value arrayValue + * @property {number|null} [meaning] Value meaning + * @property {boolean|null} [excludeFromIndexes] Value excludeFromIndexes */ /** - * Constructs a new ArrayValue. + * Constructs a new Value. * @memberof google.datastore.v1 - * @classdesc Represents an ArrayValue. - * @implements IArrayValue + * @classdesc Represents a Value. + * @implements IValue * @constructor - * @param {google.datastore.v1.IArrayValue=} [properties] Properties to set + * @param {google.datastore.v1.IValue=} [properties] Properties to set */ - function ArrayValue(properties) { - this.values = []; + function Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11861,78 +13645,245 @@ } /** - * ArrayValue values. - * @member {Array.} values - * @memberof google.datastore.v1.ArrayValue + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.datastore.v1.Value * @instance */ - ArrayValue.prototype.values = $util.emptyArray; + Value.prototype.nullValue = null; /** - * Creates a new ArrayValue instance using the specified properties. + * Value booleanValue. + * @member {boolean|null|undefined} booleanValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.booleanValue = null; + + /** + * Value integerValue. + * @member {number|Long|null|undefined} integerValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.integerValue = null; + + /** + * Value doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.doubleValue = null; + + /** + * Value timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.timestampValue = null; + + /** + * Value keyValue. + * @member {google.datastore.v1.IKey|null|undefined} keyValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.keyValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value blobValue. + * @member {Uint8Array|null|undefined} blobValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.blobValue = null; + + /** + * Value geoPointValue. + * @member {google.type.ILatLng|null|undefined} geoPointValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.geoPointValue = null; + + /** + * Value entityValue. + * @member {google.datastore.v1.IEntity|null|undefined} entityValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.entityValue = null; + + /** + * Value arrayValue. + * @member {google.datastore.v1.IArrayValue|null|undefined} arrayValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.arrayValue = null; + + /** + * Value meaning. + * @member {number} meaning + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.meaning = 0; + + /** + * Value excludeFromIndexes. + * @member {boolean} excludeFromIndexes + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.excludeFromIndexes = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value valueType. + * @member {"nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"keyValue"|"stringValue"|"blobValue"|"geoPointValue"|"entityValue"|"arrayValue"|undefined} valueType + * @memberof google.datastore.v1.Value + * @instance + */ + Object.defineProperty(Value.prototype, "valueType", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "booleanValue", "integerValue", "doubleValue", "timestampValue", "keyValue", "stringValue", "blobValue", "geoPointValue", "entityValue", "arrayValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. * @function create - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.Value * @static - * @param {google.datastore.v1.IArrayValue=} [properties] Properties to set - * @returns {google.datastore.v1.ArrayValue} ArrayValue instance + * @param {google.datastore.v1.IValue=} [properties] Properties to set + * @returns {google.datastore.v1.Value} Value instance */ - ArrayValue.create = function create(properties) { - return new ArrayValue(properties); + Value.create = function create(properties) { + return new Value(properties); }; /** - * Encodes the specified ArrayValue message. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. + * Encodes the specified Value message. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.Value * @static - * @param {google.datastore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {google.datastore.v1.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArrayValue.encode = function encode(message, writer) { + Value.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.datastore.v1.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.booleanValue); + if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.integerValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); + if (message.keyValue != null && Object.hasOwnProperty.call(message, "keyValue")) + $root.google.datastore.v1.Key.encode(message.keyValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.entityValue != null && Object.hasOwnProperty.call(message, "entityValue")) + $root.google.datastore.v1.Entity.encode(message.entityValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.geoPointValue != null && Object.hasOwnProperty.call(message, "geoPointValue")) + $root.google.type.LatLng.encode(message.geoPointValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) + $root.google.datastore.v1.ArrayValue.encode(message.arrayValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.nullValue); + if (message.meaning != null && Object.hasOwnProperty.call(message, "meaning")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.meaning); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.stringValue); + if (message.blobValue != null && Object.hasOwnProperty.call(message, "blobValue")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.blobValue); + if (message.excludeFromIndexes != null && Object.hasOwnProperty.call(message, "excludeFromIndexes")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.excludeFromIndexes); return writer; }; /** - * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.Value * @static - * @param {google.datastore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {google.datastore.v1.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { + Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ArrayValue message from the specified reader or buffer. + * Decodes a Value message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.ArrayValue} ArrayValue + * @returns {google.datastore.v1.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArrayValue.decode = function decode(reader, length) { + Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ArrayValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 11: + message.nullValue = reader.int32(); + break; case 1: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.datastore.v1.Value.decode(reader, reader.uint32())); + message.booleanValue = reader.bool(); + break; + case 2: + message.integerValue = reader.int64(); + break; + case 3: + message.doubleValue = reader.double(); + break; + case 10: + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.keyValue = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); + break; + case 17: + message.stringValue = reader.string(); + break; + case 18: + message.blobValue = reader.bytes(); + break; + case 8: + message.geoPointValue = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + case 6: + message.entityValue = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + break; + case 9: + message.arrayValue = $root.google.datastore.v1.ArrayValue.decode(reader, reader.uint32()); + break; + case 14: + message.meaning = reader.int32(); + break; + case 19: + message.excludeFromIndexes = reader.bool(); break; default: reader.skipType(tag & 7); @@ -11943,136 +13894,322 @@ }; /** - * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * Decodes a Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ArrayValue} ArrayValue + * @returns {google.datastore.v1.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArrayValue.decodeDelimited = function decodeDelimited(reader) { + Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ArrayValue message. + * Verifies a Value message. * @function verify - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ArrayValue.verify = function verify(message) { + Value.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.datastore.v1.Value.verify(message.values[i]); + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.valueType = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.booleanValue !== "boolean") + return "booleanValue: boolean expected"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isInteger(message.integerValue) && !(message.integerValue && $util.isInteger(message.integerValue.low) && $util.isInteger(message.integerValue.high))) + return "integerValue: integer|Long 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.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 "values." + error; + return "timestampValue." + error; + } + } + if (message.keyValue != null && message.hasOwnProperty("keyValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.datastore.v1.Key.verify(message.keyValue); + if (error) + return "keyValue." + error; + } + } + 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.blobValue != null && message.hasOwnProperty("blobValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!(message.blobValue && typeof message.blobValue.length === "number" || $util.isString(message.blobValue))) + return "blobValue: buffer expected"; + } + if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.type.LatLng.verify(message.geoPointValue); + if (error) + return "geoPointValue." + error; + } + } + if (message.entityValue != null && message.hasOwnProperty("entityValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.datastore.v1.Entity.verify(message.entityValue); + if (error) + return "entityValue." + error; } } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.datastore.v1.ArrayValue.verify(message.arrayValue); + if (error) + return "arrayValue." + error; + } + } + if (message.meaning != null && message.hasOwnProperty("meaning")) + if (!$util.isInteger(message.meaning)) + return "meaning: integer expected"; + if (message.excludeFromIndexes != null && message.hasOwnProperty("excludeFromIndexes")) + if (typeof message.excludeFromIndexes !== "boolean") + return "excludeFromIndexes: boolean expected"; return null; }; /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * Creates a Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.Value * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.ArrayValue} ArrayValue + * @returns {google.datastore.v1.Value} Value */ - ArrayValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.ArrayValue) + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Value) return object; - var message = new $root.google.datastore.v1.ArrayValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.datastore.v1.ArrayValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.datastore.v1.ArrayValue.values: object expected"); - message.values[i] = $root.google.datastore.v1.Value.fromObject(object.values[i]); - } + var message = new $root.google.datastore.v1.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.booleanValue != null) + message.booleanValue = Boolean(object.booleanValue); + if (object.integerValue != null) + if ($util.Long) + (message.integerValue = $util.Long.fromValue(object.integerValue)).unsigned = false; + else if (typeof object.integerValue === "string") + message.integerValue = parseInt(object.integerValue, 10); + else if (typeof object.integerValue === "number") + message.integerValue = object.integerValue; + else if (typeof object.integerValue === "object") + message.integerValue = new $util.LongBits(object.integerValue.low >>> 0, object.integerValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.datastore.v1.Value.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.keyValue != null) { + if (typeof object.keyValue !== "object") + throw TypeError(".google.datastore.v1.Value.keyValue: object expected"); + message.keyValue = $root.google.datastore.v1.Key.fromObject(object.keyValue); + } + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.blobValue != null) + if (typeof object.blobValue === "string") + $util.base64.decode(object.blobValue, message.blobValue = $util.newBuffer($util.base64.length(object.blobValue)), 0); + else if (object.blobValue.length) + message.blobValue = object.blobValue; + if (object.geoPointValue != null) { + if (typeof object.geoPointValue !== "object") + throw TypeError(".google.datastore.v1.Value.geoPointValue: object expected"); + message.geoPointValue = $root.google.type.LatLng.fromObject(object.geoPointValue); + } + if (object.entityValue != null) { + if (typeof object.entityValue !== "object") + throw TypeError(".google.datastore.v1.Value.entityValue: object expected"); + message.entityValue = $root.google.datastore.v1.Entity.fromObject(object.entityValue); + } + if (object.arrayValue != null) { + if (typeof object.arrayValue !== "object") + throw TypeError(".google.datastore.v1.Value.arrayValue: object expected"); + message.arrayValue = $root.google.datastore.v1.ArrayValue.fromObject(object.arrayValue); + } + if (object.meaning != null) + message.meaning = object.meaning | 0; + if (object.excludeFromIndexes != null) + message.excludeFromIndexes = Boolean(object.excludeFromIndexes); + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.Value + * @static + * @param {google.datastore.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 (options.defaults) { + object.meaning = 0; + object.excludeFromIndexes = false; + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + object.booleanValue = message.booleanValue; + if (options.oneofs) + object.valueType = "booleanValue"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (typeof message.integerValue === "number") + object.integerValue = options.longs === String ? String(message.integerValue) : message.integerValue; + else + object.integerValue = options.longs === String ? $util.Long.prototype.toString.call(message.integerValue) : options.longs === Number ? new $util.LongBits(message.integerValue.low >>> 0, message.integerValue.high >>> 0).toNumber() : message.integerValue; + if (options.oneofs) + object.valueType = "integerValue"; + } + 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.keyValue != null && message.hasOwnProperty("keyValue")) { + object.keyValue = $root.google.datastore.v1.Key.toObject(message.keyValue, options); + if (options.oneofs) + object.valueType = "keyValue"; + } + if (message.entityValue != null && message.hasOwnProperty("entityValue")) { + object.entityValue = $root.google.datastore.v1.Entity.toObject(message.entityValue, options); + if (options.oneofs) + object.valueType = "entityValue"; + } + if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { + object.geoPointValue = $root.google.type.LatLng.toObject(message.geoPointValue, options); + if (options.oneofs) + object.valueType = "geoPointValue"; } - return message; - }; - - /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ArrayValue - * @static - * @param {google.datastore.v1.ArrayValue} message ArrayValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ArrayValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.datastore.v1.Value.toObject(message.values[j], options); + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object.arrayValue = $root.google.datastore.v1.ArrayValue.toObject(message.arrayValue, options); + if (options.oneofs) + object.valueType = "arrayValue"; + } + 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.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.valueType = "nullValue"; + } + if (message.meaning != null && message.hasOwnProperty("meaning")) + object.meaning = message.meaning; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.valueType = "stringValue"; + } + if (message.blobValue != null && message.hasOwnProperty("blobValue")) { + object.blobValue = options.bytes === String ? $util.base64.encode(message.blobValue, 0, message.blobValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.blobValue) : message.blobValue; + if (options.oneofs) + object.valueType = "blobValue"; } + if (message.excludeFromIndexes != null && message.hasOwnProperty("excludeFromIndexes")) + object.excludeFromIndexes = message.excludeFromIndexes; return object; }; /** - * Converts this ArrayValue to JSON. + * Converts this Value to JSON. * @function toJSON - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.Value * @instance * @returns {Object.} JSON object */ - ArrayValue.prototype.toJSON = function toJSON() { + Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ArrayValue; + return Value; })(); - v1.Value = (function() { + v1.Entity = (function() { /** - * Properties of a Value. + * Properties of an Entity. * @memberof google.datastore.v1 - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {boolean|null} [booleanValue] Value booleanValue - * @property {number|Long|null} [integerValue] Value integerValue - * @property {number|null} [doubleValue] Value doubleValue - * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue - * @property {google.datastore.v1.IKey|null} [keyValue] Value keyValue - * @property {string|null} [stringValue] Value stringValue - * @property {Uint8Array|null} [blobValue] Value blobValue - * @property {google.type.ILatLng|null} [geoPointValue] Value geoPointValue - * @property {google.datastore.v1.IEntity|null} [entityValue] Value entityValue - * @property {google.datastore.v1.IArrayValue|null} [arrayValue] Value arrayValue - * @property {number|null} [meaning] Value meaning - * @property {boolean|null} [excludeFromIndexes] Value excludeFromIndexes + * @interface IEntity + * @property {google.datastore.v1.IKey|null} [key] Entity key + * @property {Object.|null} [properties] Entity properties */ /** - * Constructs a new Value. + * Constructs a new Entity. * @memberof google.datastore.v1 - * @classdesc Represents a Value. - * @implements IValue + * @classdesc Represents an Entity. + * @implements IEntity * @constructor - * @param {google.datastore.v1.IValue=} [properties] Properties to set + * @param {google.datastore.v1.IEntity=} [properties] Properties to set */ - function Value(properties) { + function Entity(properties) { + this.properties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12080,245 +14217,110 @@ } /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value booleanValue. - * @member {boolean|null|undefined} booleanValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.booleanValue = null; - - /** - * Value integerValue. - * @member {number|Long|null|undefined} integerValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.integerValue = null; - - /** - * Value doubleValue. - * @member {number|null|undefined} doubleValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.doubleValue = null; - - /** - * Value timestampValue. - * @member {google.protobuf.ITimestamp|null|undefined} timestampValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.timestampValue = null; - - /** - * Value keyValue. - * @member {google.datastore.v1.IKey|null|undefined} keyValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.keyValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value blobValue. - * @member {Uint8Array|null|undefined} blobValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.blobValue = null; - - /** - * Value geoPointValue. - * @member {google.type.ILatLng|null|undefined} geoPointValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.geoPointValue = null; - - /** - * Value entityValue. - * @member {google.datastore.v1.IEntity|null|undefined} entityValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.entityValue = null; - - /** - * Value arrayValue. - * @member {google.datastore.v1.IArrayValue|null|undefined} arrayValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.arrayValue = null; - - /** - * Value meaning. - * @member {number} meaning - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.meaning = 0; - - /** - * Value excludeFromIndexes. - * @member {boolean} excludeFromIndexes - * @memberof google.datastore.v1.Value + * Entity key. + * @member {google.datastore.v1.IKey|null|undefined} key + * @memberof google.datastore.v1.Entity * @instance */ - Value.prototype.excludeFromIndexes = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Entity.prototype.key = null; /** - * Value valueType. - * @member {"nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"keyValue"|"stringValue"|"blobValue"|"geoPointValue"|"entityValue"|"arrayValue"|undefined} valueType - * @memberof google.datastore.v1.Value + * Entity properties. + * @member {Object.} properties + * @memberof google.datastore.v1.Entity * @instance */ - Object.defineProperty(Value.prototype, "valueType", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "booleanValue", "integerValue", "doubleValue", "timestampValue", "keyValue", "stringValue", "blobValue", "geoPointValue", "entityValue", "arrayValue"]), - set: $util.oneOfSetter($oneOfFields) - }); + Entity.prototype.properties = $util.emptyObject; /** - * Creates a new Value instance using the specified properties. + * Creates a new Entity instance using the specified properties. * @function create - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.Entity * @static - * @param {google.datastore.v1.IValue=} [properties] Properties to set - * @returns {google.datastore.v1.Value} Value instance + * @param {google.datastore.v1.IEntity=} [properties] Properties to set + * @returns {google.datastore.v1.Entity} Entity instance */ - Value.create = function create(properties) { - return new Value(properties); + Entity.create = function create(properties) { + return new Entity(properties); }; /** - * Encodes the specified Value message. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. + * Encodes the specified Entity message. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.Entity * @static - * @param {google.datastore.v1.IValue} message Value message or plain object to encode + * @param {google.datastore.v1.IEntity} message Entity 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.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.booleanValue); - if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.integerValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); - if (message.keyValue != null && Object.hasOwnProperty.call(message, "keyValue")) - $root.google.datastore.v1.Key.encode(message.keyValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entityValue != null && Object.hasOwnProperty.call(message, "entityValue")) - $root.google.datastore.v1.Entity.encode(message.entityValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.geoPointValue != null && Object.hasOwnProperty.call(message, "geoPointValue")) - $root.google.type.LatLng.encode(message.geoPointValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) - $root.google.datastore.v1.ArrayValue.encode(message.arrayValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) - $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.nullValue); - if (message.meaning != null && Object.hasOwnProperty.call(message, "meaning")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.meaning); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.stringValue); - if (message.blobValue != null && Object.hasOwnProperty.call(message, "blobValue")) - writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.blobValue); - if (message.excludeFromIndexes != null && Object.hasOwnProperty.call(message, "excludeFromIndexes")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.excludeFromIndexes); + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.datastore.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), 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.datastore.v1.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.Entity * @static - * @param {google.datastore.v1.IValue} message Value message or plain object to encode + * @param {google.datastore.v1.IEntity} message Entity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Value.encodeDelimited = function encodeDelimited(message, writer) { + Entity.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Value message from the specified reader or buffer. + * Decodes an Entity message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.Entity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Value} Value + * @returns {google.datastore.v1.Entity} Entity * @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) { + Entity.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Value(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Entity(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 11: - message.nullValue = reader.int32(); - break; case 1: - message.booleanValue = reader.bool(); - break; - case 2: - message.integerValue = reader.int64(); + message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); break; case 3: - message.doubleValue = reader.double(); - break; - case 10: - message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.keyValue = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); - break; - case 17: - message.stringValue = reader.string(); - break; - case 18: - message.blobValue = reader.bytes(); - break; - case 8: - message.geoPointValue = $root.google.type.LatLng.decode(reader, reader.uint32()); - break; - case 6: - message.entityValue = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); - break; - case 9: - message.arrayValue = $root.google.datastore.v1.ArrayValue.decode(reader, reader.uint32()); - break; - case 14: - message.meaning = reader.int32(); - break; - case 19: - message.excludeFromIndexes = reader.bool(); + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.datastore.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; break; default: reader.skipType(tag & 7); @@ -12329,322 +14331,143 @@ }; /** - * Decodes a Value message from the specified reader or buffer, length delimited. + * Decodes an Entity message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.Entity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Value} Value + * @returns {google.datastore.v1.Entity} Entity * @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) { + Entity.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Value message. + * Verifies an Entity message. * @function verify - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.Entity * @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.valueType = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (typeof message.booleanValue !== "boolean") - return "booleanValue: boolean expected"; - } - if (message.integerValue != null && message.hasOwnProperty("integerValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (!$util.isInteger(message.integerValue) && !(message.integerValue && $util.isInteger(message.integerValue.low) && $util.isInteger(message.integerValue.high))) - return "integerValue: integer|Long 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.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.keyValue != null && message.hasOwnProperty("keyValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.datastore.v1.Key.verify(message.keyValue); - if (error) - return "keyValue." + error; - } - } - 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.blobValue != null && message.hasOwnProperty("blobValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (!(message.blobValue && typeof message.blobValue.length === "number" || $util.isString(message.blobValue))) - return "blobValue: buffer expected"; - } - if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.type.LatLng.verify(message.geoPointValue); - if (error) - return "geoPointValue." + error; - } - } - if (message.entityValue != null && message.hasOwnProperty("entityValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.datastore.v1.Entity.verify(message.entityValue); - if (error) - return "entityValue." + error; - } - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.datastore.v1.ArrayValue.verify(message.arrayValue); - if (error) - return "arrayValue." + error; - } - } - if (message.meaning != null && message.hasOwnProperty("meaning")) - if (!$util.isInteger(message.meaning)) - return "meaning: integer expected"; - if (message.excludeFromIndexes != null && message.hasOwnProperty("excludeFromIndexes")) - if (typeof message.excludeFromIndexes !== "boolean") - return "excludeFromIndexes: boolean expected"; - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.Value - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Value) - return object; - var message = new $root.google.datastore.v1.Value(); - switch (object.nullValue) { - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.booleanValue != null) - message.booleanValue = Boolean(object.booleanValue); - if (object.integerValue != null) - if ($util.Long) - (message.integerValue = $util.Long.fromValue(object.integerValue)).unsigned = false; - else if (typeof object.integerValue === "string") - message.integerValue = parseInt(object.integerValue, 10); - else if (typeof object.integerValue === "number") - message.integerValue = object.integerValue; - else if (typeof object.integerValue === "object") - message.integerValue = new $util.LongBits(object.integerValue.low >>> 0, object.integerValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.timestampValue != null) { - if (typeof object.timestampValue !== "object") - throw TypeError(".google.datastore.v1.Value.timestampValue: object expected"); - message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); - } - if (object.keyValue != null) { - if (typeof object.keyValue !== "object") - throw TypeError(".google.datastore.v1.Value.keyValue: object expected"); - message.keyValue = $root.google.datastore.v1.Key.fromObject(object.keyValue); - } - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.blobValue != null) - if (typeof object.blobValue === "string") - $util.base64.decode(object.blobValue, message.blobValue = $util.newBuffer($util.base64.length(object.blobValue)), 0); - else if (object.blobValue.length) - message.blobValue = object.blobValue; - if (object.geoPointValue != null) { - if (typeof object.geoPointValue !== "object") - throw TypeError(".google.datastore.v1.Value.geoPointValue: object expected"); - message.geoPointValue = $root.google.type.LatLng.fromObject(object.geoPointValue); + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.datastore.v1.Key.verify(message.key); + if (error) + return "key." + error; } - if (object.entityValue != null) { - if (typeof object.entityValue !== "object") - throw TypeError(".google.datastore.v1.Value.entityValue: object expected"); - message.entityValue = $root.google.datastore.v1.Entity.fromObject(object.entityValue); + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.datastore.v1.Value.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } } - if (object.arrayValue != null) { - if (typeof object.arrayValue !== "object") - throw TypeError(".google.datastore.v1.Value.arrayValue: object expected"); - message.arrayValue = $root.google.datastore.v1.ArrayValue.fromObject(object.arrayValue); + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Entity) + return object; + var message = new $root.google.datastore.v1.Entity(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.datastore.v1.Entity.key: object expected"); + message.key = $root.google.datastore.v1.Key.fromObject(object.key); + } + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.datastore.v1.Entity.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.datastore.v1.Entity.properties: object expected"); + message.properties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.properties[keys[i]]); + } } - if (object.meaning != null) - message.meaning = object.meaning | 0; - if (object.excludeFromIndexes != null) - message.excludeFromIndexes = Boolean(object.excludeFromIndexes); return message; }; /** - * Creates a plain object from a Value message. Also converts values to other types if specified. + * Creates a plain object from an Entity message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.Entity * @static - * @param {google.datastore.v1.Value} message Value + * @param {google.datastore.v1.Entity} message Entity * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Value.toObject = function toObject(message, options) { + Entity.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.meaning = 0; - object.excludeFromIndexes = false; - } - if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { - object.booleanValue = message.booleanValue; - if (options.oneofs) - object.valueType = "booleanValue"; - } - if (message.integerValue != null && message.hasOwnProperty("integerValue")) { - if (typeof message.integerValue === "number") - object.integerValue = options.longs === String ? String(message.integerValue) : message.integerValue; - else - object.integerValue = options.longs === String ? $util.Long.prototype.toString.call(message.integerValue) : options.longs === Number ? new $util.LongBits(message.integerValue.low >>> 0, message.integerValue.high >>> 0).toNumber() : message.integerValue; - if (options.oneofs) - object.valueType = "integerValue"; - } - 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.keyValue != null && message.hasOwnProperty("keyValue")) { - object.keyValue = $root.google.datastore.v1.Key.toObject(message.keyValue, options); - if (options.oneofs) - object.valueType = "keyValue"; - } - if (message.entityValue != null && message.hasOwnProperty("entityValue")) { - object.entityValue = $root.google.datastore.v1.Entity.toObject(message.entityValue, options); - if (options.oneofs) - object.valueType = "entityValue"; - } - if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { - object.geoPointValue = $root.google.type.LatLng.toObject(message.geoPointValue, options); - if (options.oneofs) - object.valueType = "geoPointValue"; - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - object.arrayValue = $root.google.datastore.v1.ArrayValue.toObject(message.arrayValue, options); - if (options.oneofs) - object.valueType = "arrayValue"; - } - 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.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.valueType = "nullValue"; - } - if (message.meaning != null && message.hasOwnProperty("meaning")) - object.meaning = message.meaning; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.valueType = "stringValue"; - } - if (message.blobValue != null && message.hasOwnProperty("blobValue")) { - object.blobValue = options.bytes === String ? $util.base64.encode(message.blobValue, 0, message.blobValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.blobValue) : message.blobValue; - if (options.oneofs) - object.valueType = "blobValue"; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + object.key = null; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.datastore.v1.Key.toObject(message.key, options); + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.properties[keys2[j]], options); } - if (message.excludeFromIndexes != null && message.hasOwnProperty("excludeFromIndexes")) - object.excludeFromIndexes = message.excludeFromIndexes; return object; }; /** - * Converts this Value to JSON. + * Converts this Entity to JSON. * @function toJSON - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.Entity * @instance * @returns {Object.} JSON object */ - Value.prototype.toJSON = function toJSON() { + Entity.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Value; + return Entity; })(); - v1.Entity = (function() { + v1.EntityResult = (function() { /** - * Properties of an Entity. + * Properties of an EntityResult. * @memberof google.datastore.v1 - * @interface IEntity - * @property {google.datastore.v1.IKey|null} [key] Entity key - * @property {Object.|null} [properties] Entity properties + * @interface IEntityResult + * @property {google.datastore.v1.IEntity|null} [entity] EntityResult entity + * @property {number|Long|null} [version] EntityResult version + * @property {google.protobuf.ITimestamp|null} [updateTime] EntityResult updateTime + * @property {Uint8Array|null} [cursor] EntityResult cursor */ /** - * Constructs a new Entity. + * Constructs a new EntityResult. * @memberof google.datastore.v1 - * @classdesc Represents an Entity. - * @implements IEntity + * @classdesc Represents an EntityResult. + * @implements IEntityResult * @constructor - * @param {google.datastore.v1.IEntity=} [properties] Properties to set + * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set */ - function Entity(properties) { - this.properties = {}; + function EntityResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12652,110 +14475,114 @@ } /** - * Entity key. - * @member {google.datastore.v1.IKey|null|undefined} key - * @memberof google.datastore.v1.Entity + * EntityResult entity. + * @member {google.datastore.v1.IEntity|null|undefined} entity + * @memberof google.datastore.v1.EntityResult * @instance */ - Entity.prototype.key = null; + EntityResult.prototype.entity = null; /** - * Entity properties. - * @member {Object.} properties - * @memberof google.datastore.v1.Entity + * EntityResult version. + * @member {number|Long} version + * @memberof google.datastore.v1.EntityResult * @instance */ - Entity.prototype.properties = $util.emptyObject; + EntityResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new Entity instance using the specified properties. + * EntityResult updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.datastore.v1.EntityResult + * @instance + */ + EntityResult.prototype.updateTime = null; + + /** + * EntityResult cursor. + * @member {Uint8Array} cursor + * @memberof google.datastore.v1.EntityResult + * @instance + */ + EntityResult.prototype.cursor = $util.newBuffer([]); + + /** + * Creates a new EntityResult instance using the specified properties. * @function create - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.EntityResult * @static - * @param {google.datastore.v1.IEntity=} [properties] Properties to set - * @returns {google.datastore.v1.Entity} Entity instance + * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set + * @returns {google.datastore.v1.EntityResult} EntityResult instance */ - Entity.create = function create(properties) { - return new Entity(properties); + EntityResult.create = function create(properties) { + return new EntityResult(properties); }; /** - * Encodes the specified Entity message. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. + * Encodes the specified EntityResult message. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.EntityResult * @static - * @param {google.datastore.v1.IEntity} message Entity message or plain object to encode + * @param {google.datastore.v1.IEntityResult} message EntityResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Entity.encode = function encode(message, writer) { + EntityResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.datastore.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), 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.datastore.v1.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.datastore.v1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cursor != null && Object.hasOwnProperty.call(message, "cursor")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.cursor); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.version); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. + * Encodes the specified EntityResult message, length delimited. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.EntityResult * @static - * @param {google.datastore.v1.IEntity} message Entity message or plain object to encode + * @param {google.datastore.v1.IEntityResult} message EntityResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Entity.encodeDelimited = function encodeDelimited(message, writer) { + EntityResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Entity message from the specified reader or buffer. + * Decodes an EntityResult message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.EntityResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Entity} Entity + * @returns {google.datastore.v1.EntityResult} EntityResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Entity.decode = function decode(reader, length) { + EntityResult.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Entity(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.EntityResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); + message.entity = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + break; + case 4: + message.version = reader.int64(); + break; + case 5: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 3: - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.datastore.v1.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.properties[key] = value; + message.cursor = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -12766,258 +14593,387 @@ }; /** - * Decodes an Entity message from the specified reader or buffer, length delimited. + * Decodes an EntityResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.EntityResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Entity} Entity + * @returns {google.datastore.v1.EntityResult} EntityResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Entity.decodeDelimited = function decodeDelimited(reader) { + EntityResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Entity message. + * Verifies an EntityResult message. * @function verify - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.EntityResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Entity.verify = function verify(message) { + EntityResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.datastore.v1.Key.verify(message.key); + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.datastore.v1.Entity.verify(message.entity); if (error) - return "key." + error; + return "entity." + error; } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.datastore.v1.Value.verify(message.properties[key[i]]); - if (error) - return "properties." + error; - } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) + return "version: integer|Long expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; } + if (message.cursor != null && message.hasOwnProperty("cursor")) + if (!(message.cursor && typeof message.cursor.length === "number" || $util.isString(message.cursor))) + return "cursor: buffer expected"; return null; }; /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * Creates an EntityResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.EntityResult * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.Entity} Entity + * @returns {google.datastore.v1.EntityResult} EntityResult */ - Entity.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Entity) + EntityResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.EntityResult) return object; - var message = new $root.google.datastore.v1.Entity(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.datastore.v1.Entity.key: object expected"); - message.key = $root.google.datastore.v1.Key.fromObject(object.key); + var message = new $root.google.datastore.v1.EntityResult(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.datastore.v1.EntityResult.entity: object expected"); + message.entity = $root.google.datastore.v1.Entity.fromObject(object.entity); } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.datastore.v1.Entity.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.datastore.v1.Entity.properties: object expected"); - message.properties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.properties[keys[i]]); - } + if (object.version != null) + if ($util.Long) + (message.version = $util.Long.fromValue(object.version)).unsigned = false; + else if (typeof object.version === "string") + message.version = parseInt(object.version, 10); + else if (typeof object.version === "number") + message.version = object.version; + else if (typeof object.version === "object") + message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.datastore.v1.EntityResult.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.cursor != null) + if (typeof object.cursor === "string") + $util.base64.decode(object.cursor, message.cursor = $util.newBuffer($util.base64.length(object.cursor)), 0); + else if (object.cursor.length) + message.cursor = object.cursor; return message; }; /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. + * Creates a plain object from an EntityResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.EntityResult * @static - * @param {google.datastore.v1.Entity} message Entity + * @param {google.datastore.v1.EntityResult} message EntityResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Entity.toObject = function toObject(message, options) { + EntityResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) - object.key = null; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.datastore.v1.Key.toObject(message.key, options); - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.properties[keys2[j]], options); + if (options.defaults) { + object.entity = null; + if (options.bytes === String) + object.cursor = ""; + else { + object.cursor = []; + if (options.bytes !== Array) + object.cursor = $util.newBuffer(object.cursor); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.version = options.longs === String ? "0" : 0; + object.updateTime = null; } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.datastore.v1.Entity.toObject(message.entity, options); + if (message.cursor != null && message.hasOwnProperty("cursor")) + object.cursor = options.bytes === String ? $util.base64.encode(message.cursor, 0, message.cursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.cursor) : message.cursor; + if (message.version != null && message.hasOwnProperty("version")) + if (typeof message.version === "number") + object.version = options.longs === String ? String(message.version) : message.version; + else + object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this Entity to JSON. + * Converts this EntityResult to JSON. * @function toJSON - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.EntityResult * @instance * @returns {Object.} JSON object */ - Entity.prototype.toJSON = function toJSON() { + EntityResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Entity; + /** + * ResultType enum. + * @name google.datastore.v1.EntityResult.ResultType + * @enum {number} + * @property {number} RESULT_TYPE_UNSPECIFIED=0 RESULT_TYPE_UNSPECIFIED value + * @property {number} FULL=1 FULL value + * @property {number} PROJECTION=2 PROJECTION value + * @property {number} KEY_ONLY=3 KEY_ONLY value + */ + EntityResult.ResultType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESULT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL"] = 1; + values[valuesById[2] = "PROJECTION"] = 2; + values[valuesById[3] = "KEY_ONLY"] = 3; + return values; + })(); + + return EntityResult; })(); - v1.EntityResult = (function() { + v1.Query = (function() { /** - * Properties of an EntityResult. + * Properties of a Query. * @memberof google.datastore.v1 - * @interface IEntityResult - * @property {google.datastore.v1.IEntity|null} [entity] EntityResult entity - * @property {number|Long|null} [version] EntityResult version - * @property {google.protobuf.ITimestamp|null} [updateTime] EntityResult updateTime - * @property {Uint8Array|null} [cursor] EntityResult cursor + * @interface IQuery + * @property {Array.|null} [projection] Query projection + * @property {Array.|null} [kind] Query kind + * @property {google.datastore.v1.IFilter|null} [filter] Query filter + * @property {Array.|null} [order] Query order + * @property {Array.|null} [distinctOn] Query distinctOn + * @property {Uint8Array|null} [startCursor] Query startCursor + * @property {Uint8Array|null} [endCursor] Query endCursor + * @property {number|null} [offset] Query offset + * @property {google.protobuf.IInt32Value|null} [limit] Query limit */ /** - * Constructs a new EntityResult. + * Constructs a new Query. * @memberof google.datastore.v1 - * @classdesc Represents an EntityResult. - * @implements IEntityResult + * @classdesc Represents a Query. + * @implements IQuery * @constructor - * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set + * @param {google.datastore.v1.IQuery=} [properties] Properties to set + */ + function Query(properties) { + this.projection = []; + this.kind = []; + this.order = []; + this.distinctOn = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Query projection. + * @member {Array.} projection + * @memberof google.datastore.v1.Query + * @instance + */ + Query.prototype.projection = $util.emptyArray; + + /** + * Query kind. + * @member {Array.} kind + * @memberof google.datastore.v1.Query + * @instance + */ + Query.prototype.kind = $util.emptyArray; + + /** + * Query filter. + * @member {google.datastore.v1.IFilter|null|undefined} filter + * @memberof google.datastore.v1.Query + * @instance + */ + Query.prototype.filter = null; + + /** + * Query order. + * @member {Array.} order + * @memberof google.datastore.v1.Query + * @instance + */ + Query.prototype.order = $util.emptyArray; + + /** + * Query distinctOn. + * @member {Array.} distinctOn + * @memberof google.datastore.v1.Query + * @instance */ - function EntityResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Query.prototype.distinctOn = $util.emptyArray; /** - * EntityResult entity. - * @member {google.datastore.v1.IEntity|null|undefined} entity - * @memberof google.datastore.v1.EntityResult + * Query startCursor. + * @member {Uint8Array} startCursor + * @memberof google.datastore.v1.Query * @instance */ - EntityResult.prototype.entity = null; + Query.prototype.startCursor = $util.newBuffer([]); /** - * EntityResult version. - * @member {number|Long} version - * @memberof google.datastore.v1.EntityResult + * Query endCursor. + * @member {Uint8Array} endCursor + * @memberof google.datastore.v1.Query * @instance */ - EntityResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Query.prototype.endCursor = $util.newBuffer([]); /** - * EntityResult updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.datastore.v1.EntityResult + * Query offset. + * @member {number} offset + * @memberof google.datastore.v1.Query * @instance */ - EntityResult.prototype.updateTime = null; + Query.prototype.offset = 0; /** - * EntityResult cursor. - * @member {Uint8Array} cursor - * @memberof google.datastore.v1.EntityResult + * Query limit. + * @member {google.protobuf.IInt32Value|null|undefined} limit + * @memberof google.datastore.v1.Query * @instance */ - EntityResult.prototype.cursor = $util.newBuffer([]); + Query.prototype.limit = null; /** - * Creates a new EntityResult instance using the specified properties. + * Creates a new Query instance using the specified properties. * @function create - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.Query * @static - * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set - * @returns {google.datastore.v1.EntityResult} EntityResult instance + * @param {google.datastore.v1.IQuery=} [properties] Properties to set + * @returns {google.datastore.v1.Query} Query instance */ - EntityResult.create = function create(properties) { - return new EntityResult(properties); + Query.create = function create(properties) { + return new Query(properties); }; /** - * Encodes the specified EntityResult message. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. + * Encodes the specified Query message. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.Query * @static - * @param {google.datastore.v1.IEntityResult} message EntityResult message or plain object to encode + * @param {google.datastore.v1.IQuery} message Query message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityResult.encode = function encode(message, writer) { + Query.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) - $root.google.datastore.v1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.cursor != null && Object.hasOwnProperty.call(message, "cursor")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.cursor); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.version); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.projection != null && message.projection.length) + for (var i = 0; i < message.projection.length; ++i) + $root.google.datastore.v1.Projection.encode(message.projection[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.kind != null && message.kind.length) + for (var i = 0; i < message.kind.length; ++i) + $root.google.datastore.v1.KindExpression.encode(message.kind[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.datastore.v1.Filter.encode(message.filter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.order != null && message.order.length) + for (var i = 0; i < message.order.length; ++i) + $root.google.datastore.v1.PropertyOrder.encode(message.order[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.distinctOn != null && message.distinctOn.length) + for (var i = 0; i < message.distinctOn.length; ++i) + $root.google.datastore.v1.PropertyReference.encode(message.distinctOn[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.startCursor != null && Object.hasOwnProperty.call(message, "startCursor")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startCursor); + if (message.endCursor != null && Object.hasOwnProperty.call(message, "endCursor")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.endCursor); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.offset); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.Int32Value.encode(message.limit, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified EntityResult message, length delimited. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. + * Encodes the specified Query message, length delimited. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.Query * @static - * @param {google.datastore.v1.IEntityResult} message EntityResult message or plain object to encode + * @param {google.datastore.v1.IQuery} message Query message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityResult.encodeDelimited = function encodeDelimited(message, writer) { + Query.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EntityResult message from the specified reader or buffer. + * Decodes a Query message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.Query * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.EntityResult} EntityResult + * @returns {google.datastore.v1.Query} Query * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityResult.decode = function decode(reader, length) { + Query.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.EntityResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Query(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.entity = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + case 2: + if (!(message.projection && message.projection.length)) + message.projection = []; + message.projection.push($root.google.datastore.v1.Projection.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.kind && message.kind.length)) + message.kind = []; + message.kind.push($root.google.datastore.v1.KindExpression.decode(reader, reader.uint32())); break; case 4: - message.version = reader.int64(); + message.filter = $root.google.datastore.v1.Filter.decode(reader, reader.uint32()); break; case 5: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (!(message.order && message.order.length)) + message.order = []; + message.order.push($root.google.datastore.v1.PropertyOrder.decode(reader, reader.uint32())); break; - case 3: - message.cursor = reader.bytes(); + case 6: + if (!(message.distinctOn && message.distinctOn.length)) + message.distinctOn = []; + message.distinctOn.push($root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32())); + break; + case 7: + message.startCursor = reader.bytes(); + break; + case 8: + message.endCursor = reader.bytes(); + break; + case 10: + message.offset = reader.int32(); + break; + case 12: + message.limit = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -13028,387 +14984,378 @@ }; /** - * Decodes an EntityResult message from the specified reader or buffer, length delimited. + * Decodes a Query message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.Query * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.EntityResult} EntityResult + * @returns {google.datastore.v1.Query} Query * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityResult.decodeDelimited = function decodeDelimited(reader) { + Query.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EntityResult message. + * Verifies a Query message. * @function verify - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.Query * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EntityResult.verify = function verify(message) { + Query.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entity != null && message.hasOwnProperty("entity")) { - var error = $root.google.datastore.v1.Entity.verify(message.entity); + if (message.projection != null && message.hasOwnProperty("projection")) { + if (!Array.isArray(message.projection)) + return "projection: array expected"; + for (var i = 0; i < message.projection.length; ++i) { + var error = $root.google.datastore.v1.Projection.verify(message.projection[i]); + if (error) + return "projection." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + if (!Array.isArray(message.kind)) + return "kind: array expected"; + for (var i = 0; i < message.kind.length; ++i) { + var error = $root.google.datastore.v1.KindExpression.verify(message.kind[i]); + if (error) + return "kind." + error; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) { + var error = $root.google.datastore.v1.Filter.verify(message.filter); if (error) - return "entity." + error; + return "filter." + error; + } + if (message.order != null && message.hasOwnProperty("order")) { + if (!Array.isArray(message.order)) + return "order: array expected"; + for (var i = 0; i < message.order.length; ++i) { + var error = $root.google.datastore.v1.PropertyOrder.verify(message.order[i]); + if (error) + return "order." + error; + } + } + if (message.distinctOn != null && message.hasOwnProperty("distinctOn")) { + if (!Array.isArray(message.distinctOn)) + return "distinctOn: array expected"; + for (var i = 0; i < message.distinctOn.length; ++i) { + var error = $root.google.datastore.v1.PropertyReference.verify(message.distinctOn[i]); + if (error) + return "distinctOn." + error; + } + } + if (message.startCursor != null && message.hasOwnProperty("startCursor")) + if (!(message.startCursor && typeof message.startCursor.length === "number" || $util.isString(message.startCursor))) + return "startCursor: buffer expected"; + if (message.endCursor != null && message.hasOwnProperty("endCursor")) + if (!(message.endCursor && typeof message.endCursor.length === "number" || $util.isString(message.endCursor))) + return "endCursor: buffer expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.Int32Value.verify(message.limit); + if (error) + return "limit." + error; + } + return null; + }; + + /** + * Creates a Query message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.Query + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.Query} Query + */ + Query.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Query) + return object; + var message = new $root.google.datastore.v1.Query(); + if (object.projection) { + if (!Array.isArray(object.projection)) + throw TypeError(".google.datastore.v1.Query.projection: array expected"); + message.projection = []; + for (var i = 0; i < object.projection.length; ++i) { + if (typeof object.projection[i] !== "object") + throw TypeError(".google.datastore.v1.Query.projection: object expected"); + message.projection[i] = $root.google.datastore.v1.Projection.fromObject(object.projection[i]); + } + } + if (object.kind) { + if (!Array.isArray(object.kind)) + throw TypeError(".google.datastore.v1.Query.kind: array expected"); + message.kind = []; + for (var i = 0; i < object.kind.length; ++i) { + if (typeof object.kind[i] !== "object") + throw TypeError(".google.datastore.v1.Query.kind: object expected"); + message.kind[i] = $root.google.datastore.v1.KindExpression.fromObject(object.kind[i]); + } + } + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.datastore.v1.Query.filter: object expected"); + message.filter = $root.google.datastore.v1.Filter.fromObject(object.filter); } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) - return "version: integer|Long expected"; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; + if (object.order) { + if (!Array.isArray(object.order)) + throw TypeError(".google.datastore.v1.Query.order: array expected"); + message.order = []; + for (var i = 0; i < object.order.length; ++i) { + if (typeof object.order[i] !== "object") + throw TypeError(".google.datastore.v1.Query.order: object expected"); + message.order[i] = $root.google.datastore.v1.PropertyOrder.fromObject(object.order[i]); + } } - if (message.cursor != null && message.hasOwnProperty("cursor")) - if (!(message.cursor && typeof message.cursor.length === "number" || $util.isString(message.cursor))) - return "cursor: buffer expected"; - return null; - }; - - /** - * Creates an EntityResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.EntityResult - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.EntityResult} EntityResult - */ - EntityResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.EntityResult) - return object; - var message = new $root.google.datastore.v1.EntityResult(); - if (object.entity != null) { - if (typeof object.entity !== "object") - throw TypeError(".google.datastore.v1.EntityResult.entity: object expected"); - message.entity = $root.google.datastore.v1.Entity.fromObject(object.entity); + if (object.distinctOn) { + if (!Array.isArray(object.distinctOn)) + throw TypeError(".google.datastore.v1.Query.distinctOn: array expected"); + message.distinctOn = []; + for (var i = 0; i < object.distinctOn.length; ++i) { + if (typeof object.distinctOn[i] !== "object") + throw TypeError(".google.datastore.v1.Query.distinctOn: object expected"); + message.distinctOn[i] = $root.google.datastore.v1.PropertyReference.fromObject(object.distinctOn[i]); + } } - if (object.version != null) - if ($util.Long) - (message.version = $util.Long.fromValue(object.version)).unsigned = false; - else if (typeof object.version === "string") - message.version = parseInt(object.version, 10); - else if (typeof object.version === "number") - message.version = object.version; - else if (typeof object.version === "object") - message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.datastore.v1.EntityResult.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + if (object.startCursor != null) + if (typeof object.startCursor === "string") + $util.base64.decode(object.startCursor, message.startCursor = $util.newBuffer($util.base64.length(object.startCursor)), 0); + else if (object.startCursor.length) + message.startCursor = object.startCursor; + if (object.endCursor != null) + if (typeof object.endCursor === "string") + $util.base64.decode(object.endCursor, message.endCursor = $util.newBuffer($util.base64.length(object.endCursor)), 0); + else if (object.endCursor.length) + message.endCursor = object.endCursor; + if (object.offset != null) + message.offset = object.offset | 0; + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".google.datastore.v1.Query.limit: object expected"); + message.limit = $root.google.protobuf.Int32Value.fromObject(object.limit); } - if (object.cursor != null) - if (typeof object.cursor === "string") - $util.base64.decode(object.cursor, message.cursor = $util.newBuffer($util.base64.length(object.cursor)), 0); - else if (object.cursor.length) - message.cursor = object.cursor; return message; }; /** - * Creates a plain object from an EntityResult message. Also converts values to other types if specified. + * Creates a plain object from a Query message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.Query * @static - * @param {google.datastore.v1.EntityResult} message EntityResult + * @param {google.datastore.v1.Query} message Query * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EntityResult.toObject = function toObject(message, options) { + Query.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.projection = []; + object.kind = []; + object.order = []; + object.distinctOn = []; + } if (options.defaults) { - object.entity = null; + object.filter = null; if (options.bytes === String) - object.cursor = ""; + object.startCursor = ""; else { - object.cursor = []; + object.startCursor = []; if (options.bytes !== Array) - object.cursor = $util.newBuffer(object.cursor); + object.startCursor = $util.newBuffer(object.startCursor); } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.version = options.longs === String ? "0" : 0; - object.updateTime = null; + if (options.bytes === String) + object.endCursor = ""; + else { + object.endCursor = []; + if (options.bytes !== Array) + object.endCursor = $util.newBuffer(object.endCursor); + } + object.offset = 0; + object.limit = null; } - if (message.entity != null && message.hasOwnProperty("entity")) - object.entity = $root.google.datastore.v1.Entity.toObject(message.entity, options); - if (message.cursor != null && message.hasOwnProperty("cursor")) - object.cursor = options.bytes === String ? $util.base64.encode(message.cursor, 0, message.cursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.cursor) : message.cursor; - if (message.version != null && message.hasOwnProperty("version")) - if (typeof message.version === "number") - object.version = options.longs === String ? String(message.version) : message.version; - else - object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.projection && message.projection.length) { + object.projection = []; + for (var j = 0; j < message.projection.length; ++j) + object.projection[j] = $root.google.datastore.v1.Projection.toObject(message.projection[j], options); + } + if (message.kind && message.kind.length) { + object.kind = []; + for (var j = 0; j < message.kind.length; ++j) + object.kind[j] = $root.google.datastore.v1.KindExpression.toObject(message.kind[j], options); + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = $root.google.datastore.v1.Filter.toObject(message.filter, options); + if (message.order && message.order.length) { + object.order = []; + for (var j = 0; j < message.order.length; ++j) + object.order[j] = $root.google.datastore.v1.PropertyOrder.toObject(message.order[j], options); + } + if (message.distinctOn && message.distinctOn.length) { + object.distinctOn = []; + for (var j = 0; j < message.distinctOn.length; ++j) + object.distinctOn[j] = $root.google.datastore.v1.PropertyReference.toObject(message.distinctOn[j], options); + } + if (message.startCursor != null && message.hasOwnProperty("startCursor")) + object.startCursor = options.bytes === String ? $util.base64.encode(message.startCursor, 0, message.startCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.startCursor) : message.startCursor; + if (message.endCursor != null && message.hasOwnProperty("endCursor")) + object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.Int32Value.toObject(message.limit, options); return object; }; /** - * Converts this EntityResult to JSON. + * Converts this Query to JSON. * @function toJSON - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.Query * @instance * @returns {Object.} JSON object */ - EntityResult.prototype.toJSON = function toJSON() { + Query.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ResultType enum. - * @name google.datastore.v1.EntityResult.ResultType - * @enum {number} - * @property {number} RESULT_TYPE_UNSPECIFIED=0 RESULT_TYPE_UNSPECIFIED value - * @property {number} FULL=1 FULL value - * @property {number} PROJECTION=2 PROJECTION value - * @property {number} KEY_ONLY=3 KEY_ONLY value - */ - EntityResult.ResultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESULT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FULL"] = 1; - values[valuesById[2] = "PROJECTION"] = 2; - values[valuesById[3] = "KEY_ONLY"] = 3; - return values; - })(); - - return EntityResult; - })(); - - v1.Query = (function() { - - /** - * Properties of a Query. - * @memberof google.datastore.v1 - * @interface IQuery - * @property {Array.|null} [projection] Query projection - * @property {Array.|null} [kind] Query kind - * @property {google.datastore.v1.IFilter|null} [filter] Query filter - * @property {Array.|null} [order] Query order - * @property {Array.|null} [distinctOn] Query distinctOn - * @property {Uint8Array|null} [startCursor] Query startCursor - * @property {Uint8Array|null} [endCursor] Query endCursor - * @property {number|null} [offset] Query offset - * @property {google.protobuf.IInt32Value|null} [limit] Query limit - */ - - /** - * Constructs a new Query. - * @memberof google.datastore.v1 - * @classdesc Represents a Query. - * @implements IQuery - * @constructor - * @param {google.datastore.v1.IQuery=} [properties] Properties to set - */ - function Query(properties) { - this.projection = []; - this.kind = []; - this.order = []; - this.distinctOn = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Query projection. - * @member {Array.} projection - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.projection = $util.emptyArray; - - /** - * Query kind. - * @member {Array.} kind - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.kind = $util.emptyArray; - - /** - * Query filter. - * @member {google.datastore.v1.IFilter|null|undefined} filter - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.filter = null; - - /** - * Query order. - * @member {Array.} order - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.order = $util.emptyArray; + return Query; + })(); + + v1.AggregationQuery = (function() { /** - * Query distinctOn. - * @member {Array.} distinctOn - * @memberof google.datastore.v1.Query - * @instance + * Properties of an AggregationQuery. + * @memberof google.datastore.v1 + * @interface IAggregationQuery + * @property {google.datastore.v1.IQuery|null} [nestedQuery] AggregationQuery nestedQuery + * @property {Array.|null} [aggregations] AggregationQuery aggregations */ - Query.prototype.distinctOn = $util.emptyArray; /** - * Query startCursor. - * @member {Uint8Array} startCursor - * @memberof google.datastore.v1.Query - * @instance + * Constructs a new AggregationQuery. + * @memberof google.datastore.v1 + * @classdesc Represents an AggregationQuery. + * @implements IAggregationQuery + * @constructor + * @param {google.datastore.v1.IAggregationQuery=} [properties] Properties to set */ - Query.prototype.startCursor = $util.newBuffer([]); + function AggregationQuery(properties) { + this.aggregations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Query endCursor. - * @member {Uint8Array} endCursor - * @memberof google.datastore.v1.Query + * AggregationQuery nestedQuery. + * @member {google.datastore.v1.IQuery|null|undefined} nestedQuery + * @memberof google.datastore.v1.AggregationQuery * @instance */ - Query.prototype.endCursor = $util.newBuffer([]); + AggregationQuery.prototype.nestedQuery = null; /** - * Query offset. - * @member {number} offset - * @memberof google.datastore.v1.Query + * AggregationQuery aggregations. + * @member {Array.} aggregations + * @memberof google.datastore.v1.AggregationQuery * @instance */ - Query.prototype.offset = 0; + AggregationQuery.prototype.aggregations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Query limit. - * @member {google.protobuf.IInt32Value|null|undefined} limit - * @memberof google.datastore.v1.Query + * AggregationQuery queryType. + * @member {"nestedQuery"|undefined} queryType + * @memberof google.datastore.v1.AggregationQuery * @instance */ - Query.prototype.limit = null; + Object.defineProperty(AggregationQuery.prototype, "queryType", { + get: $util.oneOfGetter($oneOfFields = ["nestedQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Query instance using the specified properties. + * Creates a new AggregationQuery instance using the specified properties. * @function create - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.AggregationQuery * @static - * @param {google.datastore.v1.IQuery=} [properties] Properties to set - * @returns {google.datastore.v1.Query} Query instance + * @param {google.datastore.v1.IAggregationQuery=} [properties] Properties to set + * @returns {google.datastore.v1.AggregationQuery} AggregationQuery instance */ - Query.create = function create(properties) { - return new Query(properties); + AggregationQuery.create = function create(properties) { + return new AggregationQuery(properties); }; /** - * Encodes the specified Query message. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. + * Encodes the specified AggregationQuery message. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.AggregationQuery * @static - * @param {google.datastore.v1.IQuery} message Query message or plain object to encode + * @param {google.datastore.v1.IAggregationQuery} message AggregationQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Query.encode = function encode(message, writer) { + AggregationQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projection != null && message.projection.length) - for (var i = 0; i < message.projection.length; ++i) - $root.google.datastore.v1.Projection.encode(message.projection[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.kind != null && message.kind.length) - for (var i = 0; i < message.kind.length; ++i) - $root.google.datastore.v1.KindExpression.encode(message.kind[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - $root.google.datastore.v1.Filter.encode(message.filter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.order != null && message.order.length) - for (var i = 0; i < message.order.length; ++i) - $root.google.datastore.v1.PropertyOrder.encode(message.order[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.distinctOn != null && message.distinctOn.length) - for (var i = 0; i < message.distinctOn.length; ++i) - $root.google.datastore.v1.PropertyReference.encode(message.distinctOn[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.startCursor != null && Object.hasOwnProperty.call(message, "startCursor")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startCursor); - if (message.endCursor != null && Object.hasOwnProperty.call(message, "endCursor")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.endCursor); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.offset); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.protobuf.Int32Value.encode(message.limit, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.nestedQuery != null && Object.hasOwnProperty.call(message, "nestedQuery")) + $root.google.datastore.v1.Query.encode(message.nestedQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.aggregations != null && message.aggregations.length) + for (var i = 0; i < message.aggregations.length; ++i) + $root.google.datastore.v1.AggregationQuery.Aggregation.encode(message.aggregations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Query message, length delimited. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. + * Encodes the specified AggregationQuery message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.AggregationQuery * @static - * @param {google.datastore.v1.IQuery} message Query message or plain object to encode + * @param {google.datastore.v1.IAggregationQuery} message AggregationQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Query.encodeDelimited = function encodeDelimited(message, writer) { + AggregationQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Query message from the specified reader or buffer. + * Decodes an AggregationQuery message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.AggregationQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Query} Query + * @returns {google.datastore.v1.AggregationQuery} AggregationQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Query.decode = function decode(reader, length) { + AggregationQuery.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Query(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - if (!(message.projection && message.projection.length)) - message.projection = []; - message.projection.push($root.google.datastore.v1.Projection.decode(reader, reader.uint32())); + case 1: + message.nestedQuery = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); break; case 3: - if (!(message.kind && message.kind.length)) - message.kind = []; - message.kind.push($root.google.datastore.v1.KindExpression.decode(reader, reader.uint32())); - break; - case 4: - message.filter = $root.google.datastore.v1.Filter.decode(reader, reader.uint32()); - break; - case 5: - if (!(message.order && message.order.length)) - message.order = []; - message.order.push($root.google.datastore.v1.PropertyOrder.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.distinctOn && message.distinctOn.length)) - message.distinctOn = []; - message.distinctOn.push($root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32())); - break; - case 7: - message.startCursor = reader.bytes(); - break; - case 8: - message.endCursor = reader.bytes(); - break; - case 10: - message.offset = reader.int32(); - break; - case 12: - message.limit = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + if (!(message.aggregations && message.aggregations.length)) + message.aggregations = []; + message.aggregations.push($root.google.datastore.v1.AggregationQuery.Aggregation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -13419,250 +15366,544 @@ }; /** - * Decodes a Query message from the specified reader or buffer, length delimited. + * Decodes an AggregationQuery message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.AggregationQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Query} Query + * @returns {google.datastore.v1.AggregationQuery} AggregationQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Query.decodeDelimited = function decodeDelimited(reader) { + AggregationQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Query message. + * Verifies an AggregationQuery message. * @function verify - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.AggregationQuery * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Query.verify = function verify(message) { + AggregationQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.projection != null && message.hasOwnProperty("projection")) { - if (!Array.isArray(message.projection)) - return "projection: array expected"; - for (var i = 0; i < message.projection.length; ++i) { - var error = $root.google.datastore.v1.Projection.verify(message.projection[i]); + var properties = {}; + if (message.nestedQuery != null && message.hasOwnProperty("nestedQuery")) { + properties.queryType = 1; + { + var error = $root.google.datastore.v1.Query.verify(message.nestedQuery); if (error) - return "projection." + error; + return "nestedQuery." + error; } } - if (message.kind != null && message.hasOwnProperty("kind")) { - if (!Array.isArray(message.kind)) - return "kind: array expected"; - for (var i = 0; i < message.kind.length; ++i) { - var error = $root.google.datastore.v1.KindExpression.verify(message.kind[i]); + if (message.aggregations != null && message.hasOwnProperty("aggregations")) { + if (!Array.isArray(message.aggregations)) + return "aggregations: array expected"; + for (var i = 0; i < message.aggregations.length; ++i) { + var error = $root.google.datastore.v1.AggregationQuery.Aggregation.verify(message.aggregations[i]); if (error) - return "kind." + error; + return "aggregations." + error; } } - if (message.filter != null && message.hasOwnProperty("filter")) { - var error = $root.google.datastore.v1.Filter.verify(message.filter); - if (error) - return "filter." + error; - } - if (message.order != null && message.hasOwnProperty("order")) { - if (!Array.isArray(message.order)) - return "order: array expected"; - for (var i = 0; i < message.order.length; ++i) { - var error = $root.google.datastore.v1.PropertyOrder.verify(message.order[i]); - if (error) - return "order." + error; + return null; + }; + + /** + * Creates an AggregationQuery message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationQuery + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationQuery} AggregationQuery + */ + AggregationQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationQuery) + return object; + var message = new $root.google.datastore.v1.AggregationQuery(); + if (object.nestedQuery != null) { + if (typeof object.nestedQuery !== "object") + throw TypeError(".google.datastore.v1.AggregationQuery.nestedQuery: object expected"); + message.nestedQuery = $root.google.datastore.v1.Query.fromObject(object.nestedQuery); + } + if (object.aggregations) { + if (!Array.isArray(object.aggregations)) + throw TypeError(".google.datastore.v1.AggregationQuery.aggregations: array expected"); + message.aggregations = []; + for (var i = 0; i < object.aggregations.length; ++i) { + if (typeof object.aggregations[i] !== "object") + throw TypeError(".google.datastore.v1.AggregationQuery.aggregations: object expected"); + message.aggregations[i] = $root.google.datastore.v1.AggregationQuery.Aggregation.fromObject(object.aggregations[i]); } } - if (message.distinctOn != null && message.hasOwnProperty("distinctOn")) { - if (!Array.isArray(message.distinctOn)) - return "distinctOn: array expected"; - for (var i = 0; i < message.distinctOn.length; ++i) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.distinctOn[i]); - if (error) - return "distinctOn." + error; + return message; + }; + + /** + * Creates a plain object from an AggregationQuery message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AggregationQuery + * @static + * @param {google.datastore.v1.AggregationQuery} message AggregationQuery + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregationQuery.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aggregations = []; + if (message.nestedQuery != null && message.hasOwnProperty("nestedQuery")) { + object.nestedQuery = $root.google.datastore.v1.Query.toObject(message.nestedQuery, options); + if (options.oneofs) + object.queryType = "nestedQuery"; + } + if (message.aggregations && message.aggregations.length) { + object.aggregations = []; + for (var j = 0; j < message.aggregations.length; ++j) + object.aggregations[j] = $root.google.datastore.v1.AggregationQuery.Aggregation.toObject(message.aggregations[j], options); + } + return object; + }; + + /** + * Converts this AggregationQuery to JSON. + * @function toJSON + * @memberof google.datastore.v1.AggregationQuery + * @instance + * @returns {Object.} JSON object + */ + AggregationQuery.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AggregationQuery.Aggregation = (function() { + + /** + * Properties of an Aggregation. + * @memberof google.datastore.v1.AggregationQuery + * @interface IAggregation + * @property {google.datastore.v1.AggregationQuery.Aggregation.ICount|null} [count] Aggregation count + * @property {string|null} [alias] Aggregation alias + */ + + /** + * Constructs a new Aggregation. + * @memberof google.datastore.v1.AggregationQuery + * @classdesc Represents an Aggregation. + * @implements IAggregation + * @constructor + * @param {google.datastore.v1.AggregationQuery.IAggregation=} [properties] Properties to set + */ + function Aggregation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Aggregation count. + * @member {google.datastore.v1.AggregationQuery.Aggregation.ICount|null|undefined} count + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @instance + */ + Aggregation.prototype.count = null; + + /** + * Aggregation alias. + * @member {string} alias + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @instance + */ + Aggregation.prototype.alias = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Aggregation operator. + * @member {"count"|undefined} operator + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @instance + */ + Object.defineProperty(Aggregation.prototype, "operator", { + get: $util.oneOfGetter($oneOfFields = ["count"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Aggregation instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @static + * @param {google.datastore.v1.AggregationQuery.IAggregation=} [properties] Properties to set + * @returns {google.datastore.v1.AggregationQuery.Aggregation} Aggregation instance + */ + Aggregation.create = function create(properties) { + return new Aggregation(properties); + }; + + /** + * Encodes the specified Aggregation message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @static + * @param {google.datastore.v1.AggregationQuery.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + $root.google.datastore.v1.AggregationQuery.Aggregation.Count.encode(message.count, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.alias); + return writer; + }; + + /** + * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @static + * @param {google.datastore.v1.AggregationQuery.IAggregation} message Aggregation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Aggregation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Aggregation message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AggregationQuery.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery.Aggregation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.count = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.decode(reader, reader.uint32()); + break; + case 7: + message.alias = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - if (message.startCursor != null && message.hasOwnProperty("startCursor")) - if (!(message.startCursor && typeof message.startCursor.length === "number" || $util.isString(message.startCursor))) - return "startCursor: buffer expected"; - if (message.endCursor != null && message.hasOwnProperty("endCursor")) - if (!(message.endCursor && typeof message.endCursor.length === "number" || $util.isString(message.endCursor))) - return "endCursor: buffer expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.protobuf.Int32Value.verify(message.limit); - if (error) - return "limit." + error; - } - return null; - }; + return message; + }; - /** - * Creates a Query message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.Query - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.Query} Query - */ - Query.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Query) - return object; - var message = new $root.google.datastore.v1.Query(); - if (object.projection) { - if (!Array.isArray(object.projection)) - throw TypeError(".google.datastore.v1.Query.projection: array expected"); - message.projection = []; - for (var i = 0; i < object.projection.length; ++i) { - if (typeof object.projection[i] !== "object") - throw TypeError(".google.datastore.v1.Query.projection: object expected"); - message.projection[i] = $root.google.datastore.v1.Projection.fromObject(object.projection[i]); + /** + * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AggregationQuery.Aggregation} Aggregation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Aggregation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Aggregation message. + * @function verify + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Aggregation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.count != null && message.hasOwnProperty("count")) { + properties.operator = 1; + { + var error = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.verify(message.count); + if (error) + return "count." + error; + } } - } - if (object.kind) { - if (!Array.isArray(object.kind)) - throw TypeError(".google.datastore.v1.Query.kind: array expected"); - message.kind = []; - for (var i = 0; i < object.kind.length; ++i) { - if (typeof object.kind[i] !== "object") - throw TypeError(".google.datastore.v1.Query.kind: object expected"); - message.kind[i] = $root.google.datastore.v1.KindExpression.fromObject(object.kind[i]); + if (message.alias != null && message.hasOwnProperty("alias")) + if (!$util.isString(message.alias)) + return "alias: string expected"; + return null; + }; + + /** + * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationQuery.Aggregation} Aggregation + */ + Aggregation.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation) + return object; + var message = new $root.google.datastore.v1.AggregationQuery.Aggregation(); + if (object.count != null) { + if (typeof object.count !== "object") + throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.count: object expected"); + message.count = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.fromObject(object.count); } - } - if (object.filter != null) { - if (typeof object.filter !== "object") - throw TypeError(".google.datastore.v1.Query.filter: object expected"); - message.filter = $root.google.datastore.v1.Filter.fromObject(object.filter); - } - if (object.order) { - if (!Array.isArray(object.order)) - throw TypeError(".google.datastore.v1.Query.order: array expected"); - message.order = []; - for (var i = 0; i < object.order.length; ++i) { - if (typeof object.order[i] !== "object") - throw TypeError(".google.datastore.v1.Query.order: object expected"); - message.order[i] = $root.google.datastore.v1.PropertyOrder.fromObject(object.order[i]); + if (object.alias != null) + message.alias = String(object.alias); + return message; + }; + + /** + * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation} message Aggregation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Aggregation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.alias = ""; + if (message.count != null && message.hasOwnProperty("count")) { + object.count = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.toObject(message.count, options); + if (options.oneofs) + object.operator = "count"; } - } - if (object.distinctOn) { - if (!Array.isArray(object.distinctOn)) - throw TypeError(".google.datastore.v1.Query.distinctOn: array expected"); - message.distinctOn = []; - for (var i = 0; i < object.distinctOn.length; ++i) { - if (typeof object.distinctOn[i] !== "object") - throw TypeError(".google.datastore.v1.Query.distinctOn: object expected"); - message.distinctOn[i] = $root.google.datastore.v1.PropertyReference.fromObject(object.distinctOn[i]); + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = message.alias; + return object; + }; + + /** + * Converts this Aggregation to JSON. + * @function toJSON + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @instance + * @returns {Object.} JSON object + */ + Aggregation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Aggregation.Count = (function() { + + /** + * Properties of a Count. + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @interface ICount + * @property {number|null} [upTo] Count upTo + */ + + /** + * Constructs a new Count. + * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @classdesc Represents a Count. + * @implements ICount + * @constructor + * @param {google.datastore.v1.AggregationQuery.Aggregation.ICount=} [properties] Properties to set + */ + function Count(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - if (object.startCursor != null) - if (typeof object.startCursor === "string") - $util.base64.decode(object.startCursor, message.startCursor = $util.newBuffer($util.base64.length(object.startCursor)), 0); - else if (object.startCursor.length) - message.startCursor = object.startCursor; - if (object.endCursor != null) - if (typeof object.endCursor === "string") - $util.base64.decode(object.endCursor, message.endCursor = $util.newBuffer($util.base64.length(object.endCursor)), 0); - else if (object.endCursor.length) - message.endCursor = object.endCursor; - if (object.offset != null) - message.offset = object.offset | 0; - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".google.datastore.v1.Query.limit: object expected"); - message.limit = $root.google.protobuf.Int32Value.fromObject(object.limit); - } - return message; - }; - /** - * Creates a plain object from a Query message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.Query - * @static - * @param {google.datastore.v1.Query} message Query - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Query.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.projection = []; - object.kind = []; - object.order = []; - object.distinctOn = []; - } - if (options.defaults) { - object.filter = null; - if (options.bytes === String) - object.startCursor = ""; - else { - object.startCursor = []; - if (options.bytes !== Array) - object.startCursor = $util.newBuffer(object.startCursor); - } - if (options.bytes === String) - object.endCursor = ""; - else { - object.endCursor = []; - if (options.bytes !== Array) - object.endCursor = $util.newBuffer(object.endCursor); - } - object.offset = 0; - object.limit = null; - } - if (message.projection && message.projection.length) { - object.projection = []; - for (var j = 0; j < message.projection.length; ++j) - object.projection[j] = $root.google.datastore.v1.Projection.toObject(message.projection[j], options); - } - if (message.kind && message.kind.length) { - object.kind = []; - for (var j = 0; j < message.kind.length; ++j) - object.kind[j] = $root.google.datastore.v1.KindExpression.toObject(message.kind[j], options); - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = $root.google.datastore.v1.Filter.toObject(message.filter, options); - if (message.order && message.order.length) { - object.order = []; - for (var j = 0; j < message.order.length; ++j) - object.order[j] = $root.google.datastore.v1.PropertyOrder.toObject(message.order[j], options); - } - if (message.distinctOn && message.distinctOn.length) { - object.distinctOn = []; - for (var j = 0; j < message.distinctOn.length; ++j) - object.distinctOn[j] = $root.google.datastore.v1.PropertyReference.toObject(message.distinctOn[j], options); - } - if (message.startCursor != null && message.hasOwnProperty("startCursor")) - object.startCursor = options.bytes === String ? $util.base64.encode(message.startCursor, 0, message.startCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.startCursor) : message.startCursor; - if (message.endCursor != null && message.hasOwnProperty("endCursor")) - object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.protobuf.Int32Value.toObject(message.limit, options); - return object; - }; + /** + * Count upTo. + * @member {number} upTo + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @instance + */ + Count.prototype.upTo = 0; + + /** + * Creates a new Count instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.ICount=} [properties] Properties to set + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Count} Count instance + */ + Count.create = function create(properties) { + return new Count(properties); + }; + + /** + * Encodes the specified Count message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Count.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.ICount} message Count message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Count.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.upTo != null && Object.hasOwnProperty.call(message, "upTo")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.upTo); + return writer; + }; + + /** + * Encodes the specified Count message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Count.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.ICount} message Count message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Count.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Count message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Count} Count + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Count.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Count(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.upTo = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Count message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Count} Count + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Count.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Count message. + * @function verify + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Count.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.upTo != null && message.hasOwnProperty("upTo")) + if (!$util.isInteger(message.upTo)) + return "upTo: integer expected"; + return null; + }; + + /** + * Creates a Count message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationQuery.Aggregation.Count} Count + */ + Count.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation.Count) + return object; + var message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Count(); + if (object.upTo != null) + message.upTo = object.upTo | 0; + return message; + }; + + /** + * Creates a plain object from a Count message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @static + * @param {google.datastore.v1.AggregationQuery.Aggregation.Count} message Count + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Count.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.upTo = 0; + if (message.upTo != null && message.hasOwnProperty("upTo")) + object.upTo = message.upTo; + return object; + }; + + /** + * Converts this Count to JSON. + * @function toJSON + * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count + * @instance + * @returns {Object.} JSON object + */ + Count.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Query to JSON. - * @function toJSON - * @memberof google.datastore.v1.Query - * @instance - * @returns {Object.} JSON object - */ - Query.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Count; + })(); - return Query; + return Aggregation; + })(); + + return AggregationQuery; })(); v1.KindExpression = (function() { @@ -14879,6 +17120,7 @@ return "op: enum value expected"; case 0: case 1: + case 2: break; } if (message.filters != null && message.hasOwnProperty("filters")) { @@ -14914,6 +17156,10 @@ case 1: message.op = 1; break; + case "OR": + case 2: + message.op = 2; + break; } if (object.filters) { if (!Array.isArray(object.filters)) @@ -14972,11 +17218,13 @@ * @enum {number} * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value * @property {number} AND=1 AND value + * @property {number} OR=2 OR value */ CompositeFilter.Operator = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; values[valuesById[1] = "AND"] = 1; + values[valuesById[2] = "OR"] = 2; return values; })(); @@ -16123,2546 +18371,2056 @@ for (var i = 0; i < message.entityResults.length; ++i) { var error = $root.google.datastore.v1.EntityResult.verify(message.entityResults[i]); if (error) - return "entityResults." + error; - } - } - if (message.endCursor != null && message.hasOwnProperty("endCursor")) - if (!(message.endCursor && typeof message.endCursor.length === "number" || $util.isString(message.endCursor))) - return "endCursor: buffer expected"; - if (message.moreResults != null && message.hasOwnProperty("moreResults")) - switch (message.moreResults) { - default: - return "moreResults: enum value expected"; - case 0: - case 1: - case 2: - case 4: - case 3: - break; - } - if (message.snapshotVersion != null && message.hasOwnProperty("snapshotVersion")) - if (!$util.isInteger(message.snapshotVersion) && !(message.snapshotVersion && $util.isInteger(message.snapshotVersion.low) && $util.isInteger(message.snapshotVersion.high))) - return "snapshotVersion: integer|Long expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - return null; - }; - - /** - * Creates a QueryResultBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.QueryResultBatch - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch - */ - QueryResultBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.QueryResultBatch) - return object; - var message = new $root.google.datastore.v1.QueryResultBatch(); - if (object.skippedResults != null) - message.skippedResults = object.skippedResults | 0; - if (object.skippedCursor != null) - if (typeof object.skippedCursor === "string") - $util.base64.decode(object.skippedCursor, message.skippedCursor = $util.newBuffer($util.base64.length(object.skippedCursor)), 0); - else if (object.skippedCursor.length) - message.skippedCursor = object.skippedCursor; - switch (object.entityResultType) { - case "RESULT_TYPE_UNSPECIFIED": - case 0: - message.entityResultType = 0; - break; - case "FULL": - case 1: - message.entityResultType = 1; - break; - case "PROJECTION": - case 2: - message.entityResultType = 2; - break; - case "KEY_ONLY": - case 3: - message.entityResultType = 3; - break; - } - if (object.entityResults) { - if (!Array.isArray(object.entityResults)) - throw TypeError(".google.datastore.v1.QueryResultBatch.entityResults: array expected"); - message.entityResults = []; - for (var i = 0; i < object.entityResults.length; ++i) { - if (typeof object.entityResults[i] !== "object") - throw TypeError(".google.datastore.v1.QueryResultBatch.entityResults: object expected"); - message.entityResults[i] = $root.google.datastore.v1.EntityResult.fromObject(object.entityResults[i]); - } - } - if (object.endCursor != null) - if (typeof object.endCursor === "string") - $util.base64.decode(object.endCursor, message.endCursor = $util.newBuffer($util.base64.length(object.endCursor)), 0); - else if (object.endCursor.length) - message.endCursor = object.endCursor; - switch (object.moreResults) { - case "MORE_RESULTS_TYPE_UNSPECIFIED": - case 0: - message.moreResults = 0; - break; - case "NOT_FINISHED": - case 1: - message.moreResults = 1; - break; - case "MORE_RESULTS_AFTER_LIMIT": - case 2: - message.moreResults = 2; - break; - case "MORE_RESULTS_AFTER_CURSOR": - case 4: - message.moreResults = 4; - break; - case "NO_MORE_RESULTS": - case 3: - message.moreResults = 3; - break; - } - if (object.snapshotVersion != null) - if ($util.Long) - (message.snapshotVersion = $util.Long.fromValue(object.snapshotVersion)).unsigned = false; - else if (typeof object.snapshotVersion === "string") - message.snapshotVersion = parseInt(object.snapshotVersion, 10); - else if (typeof object.snapshotVersion === "number") - message.snapshotVersion = object.snapshotVersion; - else if (typeof object.snapshotVersion === "object") - message.snapshotVersion = new $util.LongBits(object.snapshotVersion.low >>> 0, object.snapshotVersion.high >>> 0).toNumber(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.QueryResultBatch.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - return message; - }; - - /** - * Creates a plain object from a QueryResultBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.QueryResultBatch - * @static - * @param {google.datastore.v1.QueryResultBatch} message QueryResultBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryResultBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entityResults = []; - if (options.defaults) { - object.entityResultType = options.enums === String ? "RESULT_TYPE_UNSPECIFIED" : 0; - if (options.bytes === String) - object.skippedCursor = ""; - else { - object.skippedCursor = []; - if (options.bytes !== Array) - object.skippedCursor = $util.newBuffer(object.skippedCursor); - } - if (options.bytes === String) - object.endCursor = ""; - else { - object.endCursor = []; - if (options.bytes !== Array) - object.endCursor = $util.newBuffer(object.endCursor); + return "entityResults." + error; } - object.moreResults = options.enums === String ? "MORE_RESULTS_TYPE_UNSPECIFIED" : 0; - object.skippedResults = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.snapshotVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.snapshotVersion = options.longs === String ? "0" : 0; - object.readTime = null; - } - if (message.entityResultType != null && message.hasOwnProperty("entityResultType")) - object.entityResultType = options.enums === String ? $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] : message.entityResultType; - if (message.entityResults && message.entityResults.length) { - object.entityResults = []; - for (var j = 0; j < message.entityResults.length; ++j) - object.entityResults[j] = $root.google.datastore.v1.EntityResult.toObject(message.entityResults[j], options); } - if (message.skippedCursor != null && message.hasOwnProperty("skippedCursor")) - object.skippedCursor = options.bytes === String ? $util.base64.encode(message.skippedCursor, 0, message.skippedCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.skippedCursor) : message.skippedCursor; if (message.endCursor != null && message.hasOwnProperty("endCursor")) - object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; + if (!(message.endCursor && typeof message.endCursor.length === "number" || $util.isString(message.endCursor))) + return "endCursor: buffer expected"; if (message.moreResults != null && message.hasOwnProperty("moreResults")) - object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; - if (message.skippedResults != null && message.hasOwnProperty("skippedResults")) - object.skippedResults = message.skippedResults; + switch (message.moreResults) { + default: + return "moreResults: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 3: + break; + } if (message.snapshotVersion != null && message.hasOwnProperty("snapshotVersion")) - if (typeof message.snapshotVersion === "number") - object.snapshotVersion = options.longs === String ? String(message.snapshotVersion) : message.snapshotVersion; - else - object.snapshotVersion = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotVersion) : options.longs === Number ? new $util.LongBits(message.snapshotVersion.low >>> 0, message.snapshotVersion.high >>> 0).toNumber() : message.snapshotVersion; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - return object; + if (!$util.isInteger(message.snapshotVersion) && !(message.snapshotVersion && $util.isInteger(message.snapshotVersion.low) && $util.isInteger(message.snapshotVersion.high))) + return "snapshotVersion: integer|Long expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; }; /** - * Converts this QueryResultBatch to JSON. - * @function toJSON + * Creates a QueryResultBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject * @memberof google.datastore.v1.QueryResultBatch - * @instance - * @returns {Object.} JSON object - */ - QueryResultBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * MoreResultsType enum. - * @name google.datastore.v1.QueryResultBatch.MoreResultsType - * @enum {number} - * @property {number} MORE_RESULTS_TYPE_UNSPECIFIED=0 MORE_RESULTS_TYPE_UNSPECIFIED value - * @property {number} NOT_FINISHED=1 NOT_FINISHED value - * @property {number} MORE_RESULTS_AFTER_LIMIT=2 MORE_RESULTS_AFTER_LIMIT value - * @property {number} MORE_RESULTS_AFTER_CURSOR=4 MORE_RESULTS_AFTER_CURSOR value - * @property {number} NO_MORE_RESULTS=3 NO_MORE_RESULTS value + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch */ - QueryResultBatch.MoreResultsType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MORE_RESULTS_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NOT_FINISHED"] = 1; - values[valuesById[2] = "MORE_RESULTS_AFTER_LIMIT"] = 2; - values[valuesById[4] = "MORE_RESULTS_AFTER_CURSOR"] = 4; - values[valuesById[3] = "NO_MORE_RESULTS"] = 3; - return values; - })(); - - return QueryResultBatch; - })(); - - return v1; - })(); - - return datastore; - })(); - - google.api = (function() { - - /** - * Namespace api. - * @memberof google - * @namespace - */ - var api = {}; - - api.Http = (function() { - - /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion - */ - - /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp - * @constructor - * @param {google.api.IHttp=} [properties] Properties to set - */ - function Http(properties) { - this.rules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + QueryResultBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.QueryResultBatch) + return object; + var message = new $root.google.datastore.v1.QueryResultBatch(); + if (object.skippedResults != null) + message.skippedResults = object.skippedResults | 0; + if (object.skippedCursor != null) + if (typeof object.skippedCursor === "string") + $util.base64.decode(object.skippedCursor, message.skippedCursor = $util.newBuffer($util.base64.length(object.skippedCursor)), 0); + else if (object.skippedCursor.length) + message.skippedCursor = object.skippedCursor; + switch (object.entityResultType) { + case "RESULT_TYPE_UNSPECIFIED": + case 0: + message.entityResultType = 0; + break; + case "FULL": case 1: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.entityResultType = 1; + break; + case "PROJECTION": + case 2: + message.entityResultType = 2; + break; + case "KEY_ONLY": + case 3: + message.entityResultType = 3; + break; + } + if (object.entityResults) { + if (!Array.isArray(object.entityResults)) + throw TypeError(".google.datastore.v1.QueryResultBatch.entityResults: array expected"); + message.entityResults = []; + for (var i = 0; i < object.entityResults.length; ++i) { + if (typeof object.entityResults[i] !== "object") + throw TypeError(".google.datastore.v1.QueryResultBatch.entityResults: object expected"); + message.entityResults[i] = $root.google.datastore.v1.EntityResult.fromObject(object.entityResults[i]); + } + } + if (object.endCursor != null) + if (typeof object.endCursor === "string") + $util.base64.decode(object.endCursor, message.endCursor = $util.newBuffer($util.base64.length(object.endCursor)), 0); + else if (object.endCursor.length) + message.endCursor = object.endCursor; + switch (object.moreResults) { + case "MORE_RESULTS_TYPE_UNSPECIFIED": + case 0: + message.moreResults = 0; + break; + case "NOT_FINISHED": + case 1: + message.moreResults = 1; break; + case "MORE_RESULTS_AFTER_LIMIT": case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + message.moreResults = 2; break; - default: - reader.skipType(tag & 7); + case "MORE_RESULTS_AFTER_CURSOR": + case 4: + message.moreResults = 4; + break; + case "NO_MORE_RESULTS": + case 3: + message.moreResults = 3; 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 (object.snapshotVersion != null) + if ($util.Long) + (message.snapshotVersion = $util.Long.fromValue(object.snapshotVersion)).unsigned = false; + else if (typeof object.snapshotVersion === "string") + message.snapshotVersion = parseInt(object.snapshotVersion, 10); + else if (typeof object.snapshotVersion === "number") + message.snapshotVersion = object.snapshotVersion; + else if (typeof object.snapshotVersion === "object") + message.snapshotVersion = new $util.LongBits(object.snapshotVersion.low >>> 0, object.snapshotVersion.high >>> 0).toNumber(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.QueryResultBatch.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; + return message; + }; - /** - * 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]); + /** + * Creates a plain object from a QueryResultBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.QueryResultBatch + * @static + * @param {google.datastore.v1.QueryResultBatch} message QueryResultBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryResultBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityResults = []; + if (options.defaults) { + object.entityResultType = options.enums === String ? "RESULT_TYPE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.skippedCursor = ""; + else { + object.skippedCursor = []; + if (options.bytes !== Array) + object.skippedCursor = $util.newBuffer(object.skippedCursor); + } + if (options.bytes === String) + object.endCursor = ""; + else { + object.endCursor = []; + if (options.bytes !== Array) + object.endCursor = $util.newBuffer(object.endCursor); + } + object.moreResults = options.enums === String ? "MORE_RESULTS_TYPE_UNSPECIFIED" : 0; + object.skippedResults = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.snapshotVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.snapshotVersion = options.longs === String ? "0" : 0; + object.readTime = null; } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Http; - })(); - - api.HttpRule = (function() { + if (message.entityResultType != null && message.hasOwnProperty("entityResultType")) + object.entityResultType = options.enums === String ? $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] : message.entityResultType; + if (message.entityResults && message.entityResults.length) { + object.entityResults = []; + for (var j = 0; j < message.entityResults.length; ++j) + object.entityResults[j] = $root.google.datastore.v1.EntityResult.toObject(message.entityResults[j], options); + } + if (message.skippedCursor != null && message.hasOwnProperty("skippedCursor")) + object.skippedCursor = options.bytes === String ? $util.base64.encode(message.skippedCursor, 0, message.skippedCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.skippedCursor) : message.skippedCursor; + if (message.endCursor != null && message.hasOwnProperty("endCursor")) + object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; + if (message.moreResults != null && message.hasOwnProperty("moreResults")) + object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; + if (message.skippedResults != null && message.hasOwnProperty("skippedResults")) + object.skippedResults = message.skippedResults; + if (message.snapshotVersion != null && message.hasOwnProperty("snapshotVersion")) + if (typeof message.snapshotVersion === "number") + object.snapshotVersion = options.longs === String ? String(message.snapshotVersion) : message.snapshotVersion; + else + object.snapshotVersion = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotVersion) : options.longs === Number ? new $util.LongBits(message.snapshotVersion.low >>> 0, message.snapshotVersion.high >>> 0).toNumber() : message.snapshotVersion; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + return object; + }; - /** - * 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 - */ + /** + * Converts this QueryResultBatch to JSON. + * @function toJSON + * @memberof google.datastore.v1.QueryResultBatch + * @instance + * @returns {Object.} JSON object + */ + QueryResultBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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]]; - } + /** + * MoreResultsType enum. + * @name google.datastore.v1.QueryResultBatch.MoreResultsType + * @enum {number} + * @property {number} MORE_RESULTS_TYPE_UNSPECIFIED=0 MORE_RESULTS_TYPE_UNSPECIFIED value + * @property {number} NOT_FINISHED=1 NOT_FINISHED value + * @property {number} MORE_RESULTS_AFTER_LIMIT=2 MORE_RESULTS_AFTER_LIMIT value + * @property {number} MORE_RESULTS_AFTER_CURSOR=4 MORE_RESULTS_AFTER_CURSOR value + * @property {number} NO_MORE_RESULTS=3 NO_MORE_RESULTS value + */ + QueryResultBatch.MoreResultsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MORE_RESULTS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOT_FINISHED"] = 1; + values[valuesById[2] = "MORE_RESULTS_AFTER_LIMIT"] = 2; + values[valuesById[4] = "MORE_RESULTS_AFTER_CURSOR"] = 4; + values[valuesById[3] = "NO_MORE_RESULTS"] = 3; + return values; + })(); - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; + return QueryResultBatch; + })(); - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; + v1.Datastore = (function() { - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; + /** + * Constructs a new Datastore service. + * @memberof google.datastore.v1 + * @classdesc Represents a Datastore + * @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 Datastore(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; + (Datastore.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Datastore; - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; + /** + * Creates new Datastore service using the specified rpc implementation. + * @function create + * @memberof google.datastore.v1.Datastore + * @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 {Datastore} RPC service. Useful where requests and/or responses are streamed. + */ + Datastore.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; + /** + * Callback as used by {@link google.datastore.v1.Datastore#lookup}. + * @memberof google.datastore.v1.Datastore + * @typedef LookupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.LookupResponse} [response] LookupResponse + */ - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; + /** + * Calls Lookup. + * @function lookup + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.ILookupRequest} request LookupRequest message or plain object + * @param {google.datastore.v1.Datastore.LookupCallback} callback Node-style callback called with the error, if any, and LookupResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.lookup = function lookup(request, callback) { + return this.rpcCall(lookup, $root.google.datastore.v1.LookupRequest, $root.google.datastore.v1.LookupResponse, request, callback); + }, "name", { value: "Lookup" }); - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; + /** + * Calls Lookup. + * @function lookup + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.ILookupRequest} request LookupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; + /** + * Callback as used by {@link google.datastore.v1.Datastore#runQuery}. + * @memberof google.datastore.v1.Datastore + * @typedef RunQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.RunQueryResponse} [response] RunQueryResponse + */ - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; + /** + * Calls RunQuery. + * @function runQuery + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRunQueryRequest} request RunQueryRequest message or plain object + * @param {google.datastore.v1.Datastore.RunQueryCallback} callback Node-style callback called with the error, if any, and RunQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.runQuery = function runQuery(request, callback) { + return this.rpcCall(runQuery, $root.google.datastore.v1.RunQueryRequest, $root.google.datastore.v1.RunQueryResponse, request, callback); + }, "name", { value: "RunQuery" }); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Calls RunQuery. + * @function runQuery + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRunQueryRequest} request RunQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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) - }); + /** + * Callback as used by {@link google.datastore.v1.Datastore#runAggregationQuery}. + * @memberof google.datastore.v1.Datastore + * @typedef RunAggregationQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.RunAggregationQueryResponse} [response] RunAggregationQueryResponse + */ - /** - * 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); - }; + /** + * Calls RunAggregationQuery. + * @function runAggregationQuery + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRunAggregationQueryRequest} request RunAggregationQueryRequest message or plain object + * @param {google.datastore.v1.Datastore.RunAggregationQueryCallback} callback Node-style callback called with the error, if any, and RunAggregationQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.runAggregationQuery = function runAggregationQuery(request, callback) { + return this.rpcCall(runAggregationQuery, $root.google.datastore.v1.RunAggregationQueryRequest, $root.google.datastore.v1.RunAggregationQueryResponse, request, callback); + }, "name", { value: "RunAggregationQuery" }); - /** - * 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; - }; + /** + * Calls RunAggregationQuery. + * @function runAggregationQuery + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRunAggregationQueryRequest} request RunAggregationQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.datastore.v1.Datastore#beginTransaction}. + * @memberof google.datastore.v1.Datastore + * @typedef BeginTransactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.BeginTransactionResponse} [response] BeginTransactionResponse + */ + + /** + * Calls BeginTransaction. + * @function beginTransaction + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object + * @param {google.datastore.v1.Datastore.BeginTransactionCallback} callback Node-style callback called with the error, if any, and BeginTransactionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.beginTransaction = function beginTransaction(request, callback) { + return this.rpcCall(beginTransaction, $root.google.datastore.v1.BeginTransactionRequest, $root.google.datastore.v1.BeginTransactionResponse, request, callback); + }, "name", { value: "BeginTransaction" }); - /** - * 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(); - }; + /** + * Calls BeginTransaction. + * @function beginTransaction + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.selector = reader.string(); - break; - case 2: - message.get = reader.string(); - break; - case 3: - message.put = reader.string(); - break; - case 4: - message.post = reader.string(); - break; - case 5: - message["delete"] = reader.string(); - break; - case 6: - message.patch = reader.string(); - break; - case 8: - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); - break; - case 7: - message.body = reader.string(); - break; - case 12: - message.responseBody = reader.string(); - break; - case 11: - if (!(message.additionalBindings && message.additionalBindings.length)) - message.additionalBindings = []; - message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.datastore.v1.Datastore#commit}. + * @memberof google.datastore.v1.Datastore + * @typedef CommitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.CommitResponse} [response] CommitResponse + */ - /** - * 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()); - }; + /** + * Calls Commit. + * @function commit + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.ICommitRequest} request CommitRequest message or plain object + * @param {google.datastore.v1.Datastore.CommitCallback} callback Node-style callback called with the error, if any, and CommitResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.commit = function commit(request, callback) { + return this.rpcCall(commit, $root.google.datastore.v1.CommitRequest, $root.google.datastore.v1.CommitResponse, request, callback); + }, "name", { value: "Commit" }); - /** - * 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; - }; + /** + * Calls Commit. + * @function commit + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.ICommitRequest} request CommitRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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; - }; + /** + * Callback as used by {@link google.datastore.v1.Datastore#rollback}. + * @memberof google.datastore.v1.Datastore + * @typedef RollbackCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.RollbackResponse} [response] RollbackResponse + */ - /** - * 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; - }; + /** + * Calls Rollback. + * @function rollback + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRollbackRequest} request RollbackRequest message or plain object + * @param {google.datastore.v1.Datastore.RollbackCallback} callback Node-style callback called with the error, if any, and RollbackResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.rollback = function rollback(request, callback) { + return this.rpcCall(rollback, $root.google.datastore.v1.RollbackRequest, $root.google.datastore.v1.RollbackResponse, request, callback); + }, "name", { value: "Rollback" }); - /** - * 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); - }; + /** + * Calls Rollback. + * @function rollback + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRollbackRequest} request RollbackRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return HttpRule; - })(); + /** + * Callback as used by {@link google.datastore.v1.Datastore#allocateIds}. + * @memberof google.datastore.v1.Datastore + * @typedef AllocateIdsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.AllocateIdsResponse} [response] AllocateIdsResponse + */ - api.CustomHttpPattern = (function() { + /** + * Calls AllocateIds. + * @function allocateIds + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IAllocateIdsRequest} request AllocateIdsRequest message or plain object + * @param {google.datastore.v1.Datastore.AllocateIdsCallback} callback Node-style callback called with the error, if any, and AllocateIdsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.allocateIds = function allocateIds(request, callback) { + return this.rpcCall(allocateIds, $root.google.datastore.v1.AllocateIdsRequest, $root.google.datastore.v1.AllocateIdsResponse, request, callback); + }, "name", { value: "AllocateIds" }); - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ + /** + * Calls AllocateIds. + * @function allocateIds + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IAllocateIdsRequest} request AllocateIdsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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]]; - } + /** + * Callback as used by {@link google.datastore.v1.Datastore#reserveIds}. + * @memberof google.datastore.v1.Datastore + * @typedef ReserveIdsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.ReserveIdsResponse} [response] ReserveIdsResponse + */ - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; + /** + * Calls ReserveIds. + * @function reserveIds + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IReserveIdsRequest} request ReserveIdsRequest message or plain object + * @param {google.datastore.v1.Datastore.ReserveIdsCallback} callback Node-style callback called with the error, if any, and ReserveIdsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.reserveIds = function reserveIds(request, callback) { + return this.rpcCall(reserveIds, $root.google.datastore.v1.ReserveIdsRequest, $root.google.datastore.v1.ReserveIdsResponse, request, callback); + }, "name", { value: "ReserveIds" }); - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; + /** + * Calls ReserveIds. + * @function reserveIds + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IReserveIdsRequest} request ReserveIdsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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); - }; + return Datastore; + })(); - /** - * 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; - }; + v1.LookupRequest = (function() { + + /** + * Properties of a LookupRequest. + * @memberof google.datastore.v1 + * @interface ILookupRequest + * @property {string|null} [projectId] LookupRequest projectId + * @property {string|null} [databaseId] LookupRequest databaseId + * @property {google.datastore.v1.IReadOptions|null} [readOptions] LookupRequest readOptions + * @property {Array.|null} [keys] LookupRequest keys + */ + + /** + * Constructs a new LookupRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a LookupRequest. + * @implements ILookupRequest + * @constructor + * @param {google.datastore.v1.ILookupRequest=} [properties] Properties to set + */ + function LookupRequest(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]]; + } + + /** + * LookupRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.LookupRequest + * @instance + */ + LookupRequest.prototype.projectId = ""; - /** - * 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(); - }; + /** + * LookupRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.LookupRequest + * @instance + */ + LookupRequest.prototype.databaseId = ""; - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * LookupRequest readOptions. + * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions + * @memberof google.datastore.v1.LookupRequest + * @instance + */ + LookupRequest.prototype.readOptions = null; - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * LookupRequest keys. + * @member {Array.} keys + * @memberof google.datastore.v1.LookupRequest + * @instance + */ + LookupRequest.prototype.keys = $util.emptyArray; - /** - * 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 new LookupRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {google.datastore.v1.ILookupRequest=} [properties] Properties to set + * @returns {google.datastore.v1.LookupRequest} LookupRequest instance + */ + LookupRequest.create = function create(properties) { + return new LookupRequest(properties); + }; - /** - * 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; - }; + /** + * Encodes the specified LookupRequest message. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {google.datastore.v1.ILookupRequest} message LookupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) + $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + return writer; + }; - /** - * 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; - }; + /** + * Encodes the specified LookupRequest message, length delimited. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {google.datastore.v1.ILookupRequest} message LookupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes a LookupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.LookupRequest} LookupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 9: + message.databaseId = reader.string(); + break; + case 1: + message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LookupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.LookupRequest} LookupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LookupRequest message. + * @function verify + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupRequest.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.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); + if (error) + return "readOptions." + error; + } + 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.datastore.v1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + return null; + }; - return CustomHttpPattern; - })(); + /** + * Creates a LookupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.LookupRequest} LookupRequest + */ + LookupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.LookupRequest) + return object; + var message = new $root.google.datastore.v1.LookupRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.datastore.v1.LookupRequest.readOptions: object expected"); + message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); + } + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.datastore.v1.LookupRequest.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.datastore.v1.LookupRequest.keys: object expected"); + message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); + } + } + return message; + }; - /** - * 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 - */ - 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; - return values; - })(); + /** + * Creates a plain object from a LookupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {google.datastore.v1.LookupRequest} message LookupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) { + object.readOptions = null; + object.projectId = ""; + object.databaseId = ""; + } + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + return object; + }; - return api; - })(); + /** + * Converts this LookupRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.LookupRequest + * @instance + * @returns {Object.} JSON object + */ + LookupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - google.protobuf = (function() { + return LookupRequest; + })(); - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; + v1.LookupResponse = (function() { - protobuf.FileDescriptorSet = (function() { + /** + * Properties of a LookupResponse. + * @memberof google.datastore.v1 + * @interface ILookupResponse + * @property {Array.|null} [found] LookupResponse found + * @property {Array.|null} [missing] LookupResponse missing + * @property {Array.|null} [deferred] LookupResponse deferred + * @property {google.protobuf.ITimestamp|null} [readTime] LookupResponse readTime + */ - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ + /** + * Constructs a new LookupResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a LookupResponse. + * @implements ILookupResponse + * @constructor + * @param {google.datastore.v1.ILookupResponse=} [properties] Properties to set + */ + function LookupResponse(properties) { + this.found = []; + this.missing = []; + this.deferred = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new 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]]; - } + /** + * LookupResponse found. + * @member {Array.} found + * @memberof google.datastore.v1.LookupResponse + * @instance + */ + LookupResponse.prototype.found = $util.emptyArray; - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; + /** + * LookupResponse missing. + * @member {Array.} missing + * @memberof google.datastore.v1.LookupResponse + * @instance + */ + LookupResponse.prototype.missing = $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); - }; + /** + * LookupResponse deferred. + * @member {Array.} deferred + * @memberof google.datastore.v1.LookupResponse + * @instance + */ + LookupResponse.prototype.deferred = $util.emptyArray; - /** - * 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; - }; + /** + * LookupResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.LookupResponse + * @instance + */ + LookupResponse.prototype.readTime = null; - /** - * 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(); - }; + /** + * Creates a new LookupResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {google.datastore.v1.ILookupResponse=} [properties] Properties to set + * @returns {google.datastore.v1.LookupResponse} LookupResponse instance + */ + LookupResponse.create = function create(properties) { + return new LookupResponse(properties); + }; - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified LookupResponse message. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {google.datastore.v1.ILookupResponse} message LookupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.found != null && message.found.length) + for (var i = 0; i < message.found.length; ++i) + $root.google.datastore.v1.EntityResult.encode(message.found[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.missing != null && message.missing.length) + for (var i = 0; i < message.missing.length; ++i) + $root.google.datastore.v1.EntityResult.encode(message.missing[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deferred != null && message.deferred.length) + for (var i = 0; i < message.deferred.length; ++i) + $root.google.datastore.v1.Key.encode(message.deferred[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LookupResponse message, length delimited. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {google.datastore.v1.ILookupResponse} message LookupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LookupResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.LookupResponse} LookupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.found && message.found.length)) + message.found = []; + message.found.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.missing && message.missing.length)) + message.missing = []; + message.missing.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.deferred && message.deferred.length)) + message.deferred = []; + message.deferred.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + break; + case 7: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a LookupResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.LookupResponse} LookupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupResponse.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]); + /** + * Verifies a LookupResponse message. + * @function verify + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.found != null && message.hasOwnProperty("found")) { + if (!Array.isArray(message.found)) + return "found: array expected"; + for (var i = 0; i < message.found.length; ++i) { + var error = $root.google.datastore.v1.EntityResult.verify(message.found[i]); + if (error) + return "found." + error; + } + } + if (message.missing != null && message.hasOwnProperty("missing")) { + if (!Array.isArray(message.missing)) + return "missing: array expected"; + for (var i = 0; i < message.missing.length; ++i) { + var error = $root.google.datastore.v1.EntityResult.verify(message.missing[i]); + if (error) + return "missing." + error; + } + } + if (message.deferred != null && message.hasOwnProperty("deferred")) { + if (!Array.isArray(message.deferred)) + return "deferred: array expected"; + for (var i = 0; i < message.deferred.length; ++i) { + var error = $root.google.datastore.v1.Key.verify(message.deferred[i]); + if (error) + return "deferred." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "file." + error; + return "readTime." + error; + } + return null; + }; + + /** + * Creates a LookupResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.LookupResponse} LookupResponse + */ + LookupResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.LookupResponse) + return object; + var message = new $root.google.datastore.v1.LookupResponse(); + if (object.found) { + if (!Array.isArray(object.found)) + throw TypeError(".google.datastore.v1.LookupResponse.found: array expected"); + message.found = []; + for (var i = 0; i < object.found.length; ++i) { + if (typeof object.found[i] !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.found: object expected"); + message.found[i] = $root.google.datastore.v1.EntityResult.fromObject(object.found[i]); + } + } + if (object.missing) { + if (!Array.isArray(object.missing)) + throw TypeError(".google.datastore.v1.LookupResponse.missing: array expected"); + message.missing = []; + for (var i = 0; i < object.missing.length; ++i) { + if (typeof object.missing[i] !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.missing: object expected"); + message.missing[i] = $root.google.datastore.v1.EntityResult.fromObject(object.missing[i]); + } } - } - 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]); + if (object.deferred) { + if (!Array.isArray(object.deferred)) + throw TypeError(".google.datastore.v1.LookupResponse.deferred: array expected"); + message.deferred = []; + for (var i = 0; i < object.deferred.length; ++i) { + if (typeof object.deferred[i] !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.deferred: object expected"); + message.deferred[i] = $root.google.datastore.v1.Key.fromObject(object.deferred[i]); + } } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorSet; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + return message; + }; - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; + /** + * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {google.datastore.v1.LookupResponse} message LookupResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.found = []; + object.missing = []; + object.deferred = []; + } + if (options.defaults) + object.readTime = null; + if (message.found && message.found.length) { + object.found = []; + for (var j = 0; j < message.found.length; ++j) + object.found[j] = $root.google.datastore.v1.EntityResult.toObject(message.found[j], options); + } + if (message.missing && message.missing.length) { + object.missing = []; + for (var j = 0; j < message.missing.length; ++j) + object.missing[j] = $root.google.datastore.v1.EntityResult.toObject(message.missing[j], options); + } + if (message.deferred && message.deferred.length) { + object.deferred = []; + for (var j = 0; j < message.deferred.length; ++j) + object.deferred[j] = $root.google.datastore.v1.Key.toObject(message.deferred[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + return object; + }; - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; + /** + * Converts this LookupResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.LookupResponse + * @instance + * @returns {Object.} JSON object + */ + LookupResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; + return LookupResponse; + })(); - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + v1.RunQueryRequest = (function() { - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * Properties of a RunQueryRequest. + * @memberof google.datastore.v1 + * @interface IRunQueryRequest + * @property {string|null} [projectId] RunQueryRequest projectId + * @property {string|null} [databaseId] RunQueryRequest databaseId + * @property {google.datastore.v1.IPartitionId|null} [partitionId] RunQueryRequest partitionId + * @property {google.datastore.v1.IReadOptions|null} [readOptions] RunQueryRequest readOptions + * @property {google.datastore.v1.IQuery|null} [query] RunQueryRequest query + * @property {google.datastore.v1.IGqlQuery|null} [gqlQuery] RunQueryRequest gqlQuery + */ - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; + /** + * Constructs a new RunQueryRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a RunQueryRequest. + * @implements IRunQueryRequest + * @constructor + * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set + */ + function RunQueryRequest(properties) { + if (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 enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; + /** + * RunQueryRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.projectId = ""; - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; + /** + * RunQueryRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.databaseId = ""; - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; + /** + * RunQueryRequest partitionId. + * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.partitionId = null; - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; + /** + * RunQueryRequest readOptions. + * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.readOptions = null; - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; + /** + * RunQueryRequest query. + * @member {google.datastore.v1.IQuery|null|undefined} query + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.query = null; - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; + /** + * RunQueryRequest gqlQuery. + * @member {google.datastore.v1.IGqlQuery|null|undefined} gqlQuery + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.gqlQuery = null; - /** - * 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); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - return writer; - }; + /** + * RunQueryRequest queryType. + * @member {"query"|"gqlQuery"|undefined} queryType + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + Object.defineProperty(RunQueryRequest.prototype, "queryType", { + get: $util.oneOfGetter($oneOfFields = ["query", "gqlQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * 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(); - }; + /** + * Creates a new RunQueryRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest instance + */ + RunQueryRequest.create = function create(properties) { + return new RunQueryRequest(properties); + }; - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - case 11: - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - case 4: - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) + $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gqlQuery != null && Object.hasOwnProperty.call(message, "gqlQuery")) + $root.google.datastore.v1.GqlQuery.encode(message.gqlQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + return writer; + }; + + /** + * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 9: + message.databaseId = reader.string(); + break; + case 2: + message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); + break; + case 1: + message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); + break; + case 3: + message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); + break; + case 7: + message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryRequest.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]); + /** + * Verifies a RunQueryRequest message. + * @function verify + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunQueryRequest.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.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) { + var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); if (error) - return "messageType." + error; + return "partitionId." + 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 (message.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); if (error) - return "enumType." + error; + return "readOptions." + 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.query != null && message.hasOwnProperty("query")) { + properties.queryType = 1; + { + var error = $root.google.datastore.v1.Query.verify(message.query); + if (error) + return "query." + 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.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { + if (properties.queryType === 1) + return "queryType: multiple values"; + properties.queryType = 1; + { + var error = $root.google.datastore.v1.GqlQuery.verify(message.gqlQuery); + if (error) + return "gqlQuery." + error; + } } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - return null; - }; + return null; + }; + + /** + * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + */ + RunQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RunQueryRequest) + return object; + var message = new $root.google.datastore.v1.RunQueryRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.partitionId != null) { + if (typeof object.partitionId !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.partitionId: object expected"); + message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); + } + if (object.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.readOptions: object expected"); + message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.query: object expected"); + message.query = $root.google.datastore.v1.Query.fromObject(object.query); + } + if (object.gqlQuery != null) { + if (typeof object.gqlQuery !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.gqlQuery: object expected"); + message.gqlQuery = $root.google.datastore.v1.GqlQuery.fromObject(object.gqlQuery); + } + return message; + }; - /** - * 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]); + /** + * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {google.datastore.v1.RunQueryRequest} message RunQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readOptions = null; + object.partitionId = null; + object.projectId = ""; + object.databaseId = ""; } - } - 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 (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.google.datastore.v1.Query.toObject(message.query, options); + if (options.oneofs) + object.queryType = "query"; } - } - 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 (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { + object.gqlQuery = $root.google.datastore.v1.GqlQuery.toObject(message.gqlQuery, options); + if (options.oneofs) + object.queryType = "gqlQuery"; } + 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 RunQueryRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.RunQueryRequest + * @instance + * @returns {Object.} JSON object + */ + RunQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RunQueryRequest; + })(); + + v1.RunQueryResponse = (function() { + + /** + * Properties of a RunQueryResponse. + * @memberof google.datastore.v1 + * @interface IRunQueryResponse + * @property {google.datastore.v1.IQueryResultBatch|null} [batch] RunQueryResponse batch + * @property {google.datastore.v1.IQuery|null} [query] RunQueryResponse query + */ + + /** + * Constructs a new RunQueryResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a RunQueryResponse. + * @implements IRunQueryResponse + * @constructor + * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set + */ + function RunQueryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (object.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]); + + /** + * RunQueryResponse batch. + * @member {google.datastore.v1.IQueryResultBatch|null|undefined} batch + * @memberof google.datastore.v1.RunQueryResponse + * @instance + */ + RunQueryResponse.prototype.batch = null; + + /** + * RunQueryResponse query. + * @member {google.datastore.v1.IQuery|null|undefined} query + * @memberof google.datastore.v1.RunQueryResponse + * @instance + */ + RunQueryResponse.prototype.query = null; + + /** + * Creates a new RunQueryResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse instance + */ + RunQueryResponse.create = function create(properties) { + return new RunQueryResponse(properties); + }; + + /** + * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) + $root.google.datastore.v1.QueryResultBatch.encode(message.batch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batch = $root.google.datastore.v1.QueryResultBatch.decode(reader, reader.uint32()); + break; + case 2: + message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - return message; - }; + return message; + }; - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - return object; - }; + /** + * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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); - }; + /** + * Verifies a RunQueryResponse message. + * @function verify + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.batch != null && message.hasOwnProperty("batch")) { + var error = $root.google.datastore.v1.QueryResultBatch.verify(message.batch); + if (error) + return "batch." + error; + } + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.google.datastore.v1.Query.verify(message.query); + if (error) + return "query." + error; + } + return null; + }; - return FileDescriptorProto; - })(); + /** + * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + */ + RunQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RunQueryResponse) + return object; + var message = new $root.google.datastore.v1.RunQueryResponse(); + if (object.batch != null) { + if (typeof object.batch !== "object") + throw TypeError(".google.datastore.v1.RunQueryResponse.batch: object expected"); + message.batch = $root.google.datastore.v1.QueryResultBatch.fromObject(object.batch); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.datastore.v1.RunQueryResponse.query: object expected"); + message.query = $root.google.datastore.v1.Query.fromObject(object.query); + } + return message; + }; - protobuf.DescriptorProto = (function() { + /** + * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.RunQueryResponse} message RunQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.batch = null; + object.query = null; + } + if (message.batch != null && message.hasOwnProperty("batch")) + object.batch = $root.google.datastore.v1.QueryResultBatch.toObject(message.batch, options); + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.google.datastore.v1.Query.toObject(message.query, options); + return object; + }; - /** - * 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 - */ + /** + * Converts this RunQueryResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.RunQueryResponse + * @instance + * @returns {Object.} JSON object + */ + RunQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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]]; - } + return RunQueryResponse; + })(); - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; + v1.RunAggregationQueryRequest = (function() { - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; + /** + * Properties of a RunAggregationQueryRequest. + * @memberof google.datastore.v1 + * @interface IRunAggregationQueryRequest + * @property {string|null} [projectId] RunAggregationQueryRequest projectId + * @property {string|null} [databaseId] RunAggregationQueryRequest databaseId + * @property {google.datastore.v1.IPartitionId|null} [partitionId] RunAggregationQueryRequest partitionId + * @property {google.datastore.v1.IReadOptions|null} [readOptions] RunAggregationQueryRequest readOptions + * @property {google.datastore.v1.IAggregationQuery|null} [aggregationQuery] RunAggregationQueryRequest aggregationQuery + * @property {google.datastore.v1.IGqlQuery|null} [gqlQuery] RunAggregationQueryRequest gqlQuery + */ - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; + /** + * Constructs a new RunAggregationQueryRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a RunAggregationQueryRequest. + * @implements IRunAggregationQueryRequest + * @constructor + * @param {google.datastore.v1.IRunAggregationQueryRequest=} [properties] Properties to set + */ + function RunAggregationQueryRequest(properties) { + if (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 nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; + /** + * RunAggregationQueryRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @instance + */ + RunAggregationQueryRequest.prototype.projectId = ""; - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; + /** + * RunAggregationQueryRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @instance + */ + RunAggregationQueryRequest.prototype.databaseId = ""; - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; + /** + * RunAggregationQueryRequest partitionId. + * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @instance + */ + RunAggregationQueryRequest.prototype.partitionId = null; - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; + /** + * RunAggregationQueryRequest readOptions. + * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @instance + */ + RunAggregationQueryRequest.prototype.readOptions = null; - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; + /** + * RunAggregationQueryRequest aggregationQuery. + * @member {google.datastore.v1.IAggregationQuery|null|undefined} aggregationQuery + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @instance + */ + RunAggregationQueryRequest.prototype.aggregationQuery = null; - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; + /** + * RunAggregationQueryRequest gqlQuery. + * @member {google.datastore.v1.IGqlQuery|null|undefined} gqlQuery + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @instance + */ + RunAggregationQueryRequest.prototype.gqlQuery = null; - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * 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); - }; + /** + * RunAggregationQueryRequest queryType. + * @member {"aggregationQuery"|"gqlQuery"|undefined} queryType + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @instance + */ + Object.defineProperty(RunAggregationQueryRequest.prototype, "queryType", { + get: $util.oneOfGetter($oneOfFields = ["aggregationQuery", "gqlQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * 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; - }; + /** + * Creates a new RunAggregationQueryRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @static + * @param {google.datastore.v1.IRunAggregationQueryRequest=} [properties] Properties to set + * @returns {google.datastore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest instance + */ + RunAggregationQueryRequest.create = function create(properties) { + return new RunAggregationQueryRequest(properties); + }; - /** - * 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(); - }; + /** + * Encodes the specified RunAggregationQueryRequest message. Does not implicitly {@link google.datastore.v1.RunAggregationQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @static + * @param {google.datastore.v1.IRunAggregationQueryRequest} message RunAggregationQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAggregationQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) + $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.aggregationQuery != null && Object.hasOwnProperty.call(message, "aggregationQuery")) + $root.google.datastore.v1.AggregationQuery.encode(message.aggregationQuery, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gqlQuery != null && Object.hasOwnProperty.call(message, "gqlQuery")) + $root.google.datastore.v1.GqlQuery.encode(message.gqlQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + return writer; + }; - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified RunAggregationQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunAggregationQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @static + * @param {google.datastore.v1.IRunAggregationQueryRequest} message RunAggregationQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunAggregationQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunAggregationQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAggregationQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunAggregationQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 9: + message.databaseId = reader.string(); + break; + case 2: + message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); + break; + case 1: + message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); + break; + case 3: + message.aggregationQuery = $root.google.datastore.v1.AggregationQuery.decode(reader, reader.uint32()); + break; + case 7: + message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a RunAggregationQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunAggregationQueryRequest.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]); + /** + * Verifies a RunAggregationQueryRequest message. + * @function verify + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunAggregationQueryRequest.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.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) { + var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); if (error) - return "enumType." + error; + return "partitionId." + 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 (message.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); if (error) - return "extensionRange." + error; + return "readOptions." + 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.aggregationQuery != null && message.hasOwnProperty("aggregationQuery")) { + properties.queryType = 1; + { + var error = $root.google.datastore.v1.AggregationQuery.verify(message.aggregationQuery); + if (error) + return "aggregationQuery." + 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.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { + if (properties.queryType === 1) + return "queryType: multiple values"; + properties.queryType = 1; + { + var error = $root.google.datastore.v1.GqlQuery.verify(message.gqlQuery); + if (error) + return "gqlQuery." + 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; - }; + 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]); + /** + * Creates a RunAggregationQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest + */ + RunAggregationQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RunAggregationQueryRequest) + return object; + var message = new $root.google.datastore.v1.RunAggregationQueryRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.partitionId != null) { + if (typeof object.partitionId !== "object") + throw TypeError(".google.datastore.v1.RunAggregationQueryRequest.partitionId: object expected"); + message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); } - } - 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.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.datastore.v1.RunAggregationQueryRequest.readOptions: object expected"); + message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); } - } - 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.aggregationQuery != null) { + if (typeof object.aggregationQuery !== "object") + throw TypeError(".google.datastore.v1.RunAggregationQueryRequest.aggregationQuery: object expected"); + message.aggregationQuery = $root.google.datastore.v1.AggregationQuery.fromObject(object.aggregationQuery); } - } - 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.gqlQuery != null) { + if (typeof object.gqlQuery !== "object") + throw TypeError(".google.datastore.v1.RunAggregationQueryRequest.gqlQuery: object expected"); + message.gqlQuery = $root.google.datastore.v1.GqlQuery.fromObject(object.gqlQuery); } - } - 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]); + return message; + }; + + /** + * Creates a plain object from a RunAggregationQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @static + * @param {google.datastore.v1.RunAggregationQueryRequest} message RunAggregationQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunAggregationQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readOptions = null; + object.partitionId = null; + object.projectId = ""; + object.databaseId = ""; } - } - 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 (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); + if (message.aggregationQuery != null && message.hasOwnProperty("aggregationQuery")) { + object.aggregationQuery = $root.google.datastore.v1.AggregationQuery.toObject(message.aggregationQuery, options); + if (options.oneofs) + object.queryType = "aggregationQuery"; } - } - 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 (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { + object.gqlQuery = $root.google.datastore.v1.GqlQuery.toObject(message.gqlQuery, options); + if (options.oneofs) + object.queryType = "gqlQuery"; } - } - 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; - }; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + return object; + }; - /** - * 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 RunAggregationQueryRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.RunAggregationQueryRequest + * @instance + * @returns {Object.} JSON object + */ + RunAggregationQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return RunAggregationQueryRequest; + })(); - DescriptorProto.ExtensionRange = (function() { + v1.RunAggregationQueryResponse = (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 + * Properties of a RunAggregationQueryResponse. + * @memberof google.datastore.v1 + * @interface IRunAggregationQueryResponse + * @property {google.datastore.v1.IAggregationResultBatch|null} [batch] RunAggregationQueryResponse batch + * @property {google.datastore.v1.IAggregationQuery|null} [query] RunAggregationQueryResponse query */ /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange + * Constructs a new RunAggregationQueryResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a RunAggregationQueryResponse. + * @implements IRunAggregationQueryResponse * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @param {google.datastore.v1.IRunAggregationQueryResponse=} [properties] Properties to set */ - function ExtensionRange(properties) { + function RunAggregationQueryResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18670,101 +20428,88 @@ } /** - * 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 + * RunAggregationQueryResponse batch. + * @member {google.datastore.v1.IAggregationResultBatch|null|undefined} batch + * @memberof google.datastore.v1.RunAggregationQueryResponse * @instance */ - ExtensionRange.prototype.end = 0; + RunAggregationQueryResponse.prototype.batch = null; /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * RunAggregationQueryResponse query. + * @member {google.datastore.v1.IAggregationQuery|null|undefined} query + * @memberof google.datastore.v1.RunAggregationQueryResponse * @instance */ - ExtensionRange.prototype.options = null; + RunAggregationQueryResponse.prototype.query = null; /** - * Creates a new ExtensionRange instance using the specified properties. + * Creates a new RunAggregationQueryResponse instance using the specified properties. * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.datastore.v1.RunAggregationQueryResponse * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + * @param {google.datastore.v1.IRunAggregationQueryResponse=} [properties] Properties to set + * @returns {google.datastore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse instance */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); + RunAggregationQueryResponse.create = function create(properties) { + return new RunAggregationQueryResponse(properties); }; /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * Encodes the specified RunAggregationQueryResponse message. Does not implicitly {@link google.datastore.v1.RunAggregationQueryResponse.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.datastore.v1.RunAggregationQueryResponse * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {google.datastore.v1.IRunAggregationQueryResponse} message RunAggregationQueryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRange.encode = function encode(message, writer) { + RunAggregationQueryResponse.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(); + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) + $root.google.datastore.v1.AggregationResultBatch.encode(message.batch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.datastore.v1.AggregationQuery.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * Encodes the specified RunAggregationQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunAggregationQueryResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.datastore.v1.RunAggregationQueryResponse * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {google.datastore.v1.IRunAggregationQueryResponse} message RunAggregationQueryResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + RunAggregationQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExtensionRange message from the specified reader or buffer. + * Decodes a RunAggregationQueryResponse message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.datastore.v1.RunAggregationQueryResponse * @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 + * @returns {google.datastore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse * @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) { + RunAggregationQueryResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunAggregationQueryResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.start = reader.int32(); + message.batch = $root.google.datastore.v1.AggregationResultBatch.decode(reader, reader.uint32()); break; case 2: - message.end = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + message.query = $root.google.datastore.v1.AggregationQuery.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -18775,130 +20520,128 @@ }; /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * Decodes a RunAggregationQueryResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.datastore.v1.RunAggregationQueryResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @returns {google.datastore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse * @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) { + RunAggregationQueryResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExtensionRange message. + * Verifies a RunAggregationQueryResponse message. * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.datastore.v1.RunAggregationQueryResponse * @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) { + RunAggregationQueryResponse.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 (message.batch != null && message.hasOwnProperty("batch")) { + var error = $root.google.datastore.v1.AggregationResultBatch.verify(message.batch); if (error) - return "options." + error; + return "batch." + error; + } + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.google.datastore.v1.AggregationQuery.verify(message.query); + if (error) + return "query." + error; } return null; }; /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.datastore.v1.RunAggregationQueryResponse * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @returns {google.datastore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + RunAggregationQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RunAggregationQueryResponse) 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); + var message = new $root.google.datastore.v1.RunAggregationQueryResponse(); + if (object.batch != null) { + if (typeof object.batch !== "object") + throw TypeError(".google.datastore.v1.RunAggregationQueryResponse.batch: object expected"); + message.batch = $root.google.datastore.v1.AggregationResultBatch.fromObject(object.batch); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.datastore.v1.RunAggregationQueryResponse.query: object expected"); + message.query = $root.google.datastore.v1.AggregationQuery.fromObject(object.query); } return message; }; /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * Creates a plain object from a RunAggregationQueryResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.datastore.v1.RunAggregationQueryResponse * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {google.datastore.v1.RunAggregationQueryResponse} message RunAggregationQueryResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExtensionRange.toObject = function toObject(message, options) { + RunAggregationQueryResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; + object.batch = null; + object.query = 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); + if (message.batch != null && message.hasOwnProperty("batch")) + object.batch = $root.google.datastore.v1.AggregationResultBatch.toObject(message.batch, options); + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.google.datastore.v1.AggregationQuery.toObject(message.query, options); return object; }; /** - * Converts this ExtensionRange to JSON. + * Converts this RunAggregationQueryResponse to JSON. * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @memberof google.datastore.v1.RunAggregationQueryResponse * @instance * @returns {Object.} JSON object */ - ExtensionRange.prototype.toJSON = function toJSON() { + RunAggregationQueryResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExtensionRange; + return RunAggregationQueryResponse; })(); - DescriptorProto.ReservedRange = (function() { + v1.BeginTransactionRequest = (function() { /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end + * Properties of a BeginTransactionRequest. + * @memberof google.datastore.v1 + * @interface IBeginTransactionRequest + * @property {string|null} [projectId] BeginTransactionRequest projectId + * @property {string|null} [databaseId] BeginTransactionRequest databaseId + * @property {google.datastore.v1.ITransactionOptions|null} [transactionOptions] BeginTransactionRequest transactionOptions */ /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange + * Constructs a new BeginTransactionRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a BeginTransactionRequest. + * @implements IBeginTransactionRequest * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @param {google.datastore.v1.IBeginTransactionRequest=} [properties] Properties to set */ - function ReservedRange(properties) { + function BeginTransactionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18906,88 +20649,101 @@ } /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange + * BeginTransactionRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.BeginTransactionRequest * @instance */ - ReservedRange.prototype.start = 0; + BeginTransactionRequest.prototype.projectId = ""; /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange + * BeginTransactionRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.BeginTransactionRequest * @instance */ - ReservedRange.prototype.end = 0; + BeginTransactionRequest.prototype.databaseId = ""; /** - * Creates a new ReservedRange instance using the specified properties. + * BeginTransactionRequest transactionOptions. + * @member {google.datastore.v1.ITransactionOptions|null|undefined} transactionOptions + * @memberof google.datastore.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.transactionOptions = null; + + /** + * Creates a new BeginTransactionRequest instance using the specified properties. * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange + * @memberof google.datastore.v1.BeginTransactionRequest * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + * @param {google.datastore.v1.IBeginTransactionRequest=} [properties] Properties to set + * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest instance */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); + BeginTransactionRequest.create = function create(properties) { + return new BeginTransactionRequest(properties); }; /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange + * @memberof google.datastore.v1.BeginTransactionRequest * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {google.datastore.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReservedRange.encode = function encode(message, writer) { + BeginTransactionRequest.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + if (message.transactionOptions != null && Object.hasOwnProperty.call(message, "transactionOptions")) + $root.google.datastore.v1.TransactionOptions.encode(message.transactionOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange + * @memberof google.datastore.v1.BeginTransactionRequest * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {google.datastore.v1.IBeginTransactionRequest} message BeginTransactionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + BeginTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReservedRange message from the specified reader or buffer. + * Decodes a BeginTransactionRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange + * @memberof google.datastore.v1.BeginTransactionRequest * @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 + * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest * @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) { + BeginTransactionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.start = reader.int32(); + case 8: + message.projectId = reader.string(); break; - case 2: - message.end = reader.int32(); + case 9: + message.databaseId = reader.string(); + break; + case 10: + message.transactionOptions = $root.google.datastore.v1.TransactionOptions.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -18998,1467 +20754,1342 @@ }; /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange + * @memberof google.datastore.v1.BeginTransactionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest * @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) { + BeginTransactionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReservedRange message. + * Verifies a BeginTransactionRequest message. * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange + * @memberof google.datastore.v1.BeginTransactionRequest * @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) { + BeginTransactionRequest.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.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.transactionOptions != null && message.hasOwnProperty("transactionOptions")) { + var error = $root.google.datastore.v1.TransactionOptions.verify(message.transactionOptions); + if (error) + return "transactionOptions." + error; + } return null; }; /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange + * @memberof google.datastore.v1.BeginTransactionRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + BeginTransactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.BeginTransactionRequest) 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; + var message = new $root.google.datastore.v1.BeginTransactionRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.transactionOptions != null) { + if (typeof object.transactionOptions !== "object") + throw TypeError(".google.datastore.v1.BeginTransactionRequest.transactionOptions: object expected"); + message.transactionOptions = $root.google.datastore.v1.TransactionOptions.fromObject(object.transactionOptions); + } return message; }; /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange + * @memberof google.datastore.v1.BeginTransactionRequest * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {google.datastore.v1.BeginTransactionRequest} message BeginTransactionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReservedRange.toObject = function toObject(message, options) { + BeginTransactionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.start = 0; - object.end = 0; + object.projectId = ""; + object.databaseId = ""; + object.transactionOptions = null; } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.transactionOptions != null && message.hasOwnProperty("transactionOptions")) + object.transactionOptions = $root.google.datastore.v1.TransactionOptions.toObject(message.transactionOptions, options); + return object; + }; - /** - * 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); - }; + /** + * Converts this BeginTransactionRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.BeginTransactionRequest + * @instance + * @returns {Object.} JSON object + */ + BeginTransactionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + return BeginTransactionRequest; + })(); - /** - * 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(); - }; + v1.BeginTransactionResponse = (function() { - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Properties of a BeginTransactionResponse. + * @memberof google.datastore.v1 + * @interface IBeginTransactionResponse + * @property {Uint8Array|null} [transaction] BeginTransactionResponse transaction + */ + + /** + * Constructs a new BeginTransactionResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a BeginTransactionResponse. + * @implements IBeginTransactionResponse + * @constructor + * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set + */ + function BeginTransactionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes 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()); - }; + /** + * BeginTransactionResponse transaction. + * @member {Uint8Array} transaction + * @memberof google.datastore.v1.BeginTransactionResponse + * @instance + */ + BeginTransactionResponse.prototype.transaction = $util.newBuffer([]); - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + /** + * Creates a new BeginTransactionResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse instance + */ + BeginTransactionResponse.create = function create(properties) { + return new BeginTransactionResponse(properties); + }; - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; + /** + * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + return writer; + }; - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transaction = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return ExtensionRangeOptions; - })(); + /** + * Verifies a BeginTransactionResponse message. + * @function verify + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BeginTransactionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + return null; + }; - protobuf.FieldDescriptorProto = (function() { + /** + * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse + */ + BeginTransactionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.BeginTransactionResponse) + return object; + var message = new $root.google.datastore.v1.BeginTransactionResponse(); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length) + message.transaction = object.transaction; + return message; + }; - /** - * 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 - */ + /** + * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.BeginTransactionResponse} message BeginTransactionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BeginTransactionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.transaction = ""; + else { + object.transaction = []; + if (options.bytes !== Array) + object.transaction = $util.newBuffer(object.transaction); + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + return object; + }; - /** - * 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]]; - } + /** + * Converts this BeginTransactionResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.BeginTransactionResponse + * @instance + * @returns {Object.} JSON object + */ + BeginTransactionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; + return BeginTransactionResponse; + })(); - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; + v1.RollbackRequest = (function() { - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; + /** + * Properties of a RollbackRequest. + * @memberof google.datastore.v1 + * @interface IRollbackRequest + * @property {string|null} [projectId] RollbackRequest projectId + * @property {string|null} [databaseId] RollbackRequest databaseId + * @property {Uint8Array|null} [transaction] RollbackRequest transaction + */ - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; + /** + * Constructs a new RollbackRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a RollbackRequest. + * @implements IRollbackRequest + * @constructor + * @param {google.datastore.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]]; + } - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; + /** + * RollbackRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.projectId = ""; - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; + /** + * RollbackRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.databaseId = ""; - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; + /** + * RollbackRequest transaction. + * @member {Uint8Array} transaction + * @memberof google.datastore.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.transaction = $util.newBuffer([]); - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; + /** + * Creates a new RollbackRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.v1.IRollbackRequest=} [properties] Properties to set + * @returns {google.datastore.v1.RollbackRequest} RollbackRequest instance + */ + RollbackRequest.create = function create(properties) { + return new RollbackRequest(properties); + }; - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + return writer; + }; - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.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(); + }; - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; + /** + * Decodes a RollbackRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 9: + message.databaseId = reader.string(); + break; + case 1: + message.transaction = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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()); + }; - /** - * 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; - }; + /** + * Verifies a RollbackRequest message. + * @function verify + * @memberof google.datastore.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.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.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + return null; + }; - /** - * 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(); - }; + /** + * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RollbackRequest} RollbackRequest + */ + RollbackRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RollbackRequest) + return object; + var message = new $root.google.datastore.v1.RollbackRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length) + message.transaction = object.transaction; + return message; + }; - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.typeName = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.defaultValue = reader.string(); - break; - case 9: - message.oneofIndex = reader.int32(); - break; - case 10: - message.jsonName = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3Optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.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) { + if (options.bytes === String) + object.transaction = ""; + else { + object.transaction = []; + if (options.bytes !== Array) + object.transaction = $util.newBuffer(object.transaction); + } + object.projectId = ""; + object.databaseId = ""; } - } - return message; - }; + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + return object; + }; - /** - * 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()); - }; + /** + * Converts this RollbackRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.RollbackRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; + return RollbackRequest; + })(); - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; + v1.RollbackResponse = (function() { + + /** + * Properties of a RollbackResponse. + * @memberof google.datastore.v1 + * @interface IRollbackResponse + */ - /** - * 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; + /** + * Constructs a new RollbackResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a RollbackResponse. + * @implements IRollbackResponse + * @constructor + * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set + */ + function RollbackResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new RollbackResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse instance + */ + RollbackResponse.create = function create(properties) { + return new RollbackResponse(properties); + }; - /** - * 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; - })(); + /** + * Encodes the specified RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; + /** + * Encodes the specified RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackResponse message. + * @function verify + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RollbackResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse + */ + RollbackResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RollbackResponse) + return object; + return new $root.google.datastore.v1.RollbackResponse(); + }; + + /** + * Creates a plain object from a RollbackResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {google.datastore.v1.RollbackResponse} message RollbackResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RollbackResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.RollbackResponse + * @instance + * @returns {Object.} JSON object + */ + RollbackResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RollbackResponse; })(); - return FieldDescriptorProto; - })(); + v1.CommitRequest = (function() { - protobuf.OneofDescriptorProto = (function() { + /** + * Properties of a CommitRequest. + * @memberof google.datastore.v1 + * @interface ICommitRequest + * @property {string|null} [projectId] CommitRequest projectId + * @property {string|null} [databaseId] CommitRequest databaseId + * @property {google.datastore.v1.CommitRequest.Mode|null} [mode] CommitRequest mode + * @property {Uint8Array|null} [transaction] CommitRequest transaction + * @property {Array.|null} [mutations] CommitRequest mutations + */ - /** - * 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 CommitRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a CommitRequest. + * @implements ICommitRequest + * @constructor + * @param {google.datastore.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]]; + } - /** - * 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]]; - } + /** + * CommitRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.projectId = ""; - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; + /** + * CommitRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.databaseId = ""; - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; + /** + * CommitRequest mode. + * @member {google.datastore.v1.CommitRequest.Mode} mode + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.mode = 0; - /** - * 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); - }; + /** + * CommitRequest transaction. + * @member {Uint8Array|null|undefined} transaction + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.transaction = null; - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * CommitRequest mutations. + * @member {Array.} mutations + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.mutations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitRequest transactionSelector. + * @member {"transaction"|undefined} transactionSelector + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + Object.defineProperty(CommitRequest.prototype, "transactionSelector", { + get: $util.oneOfGetter($oneOfFields = ["transaction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {google.datastore.v1.ICommitRequest=} [properties] Properties to set + * @returns {google.datastore.v1.CommitRequest} CommitRequest instance + */ + CommitRequest.create = function create(properties) { + return new CommitRequest(properties); + }; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.mode); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.datastore.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + return writer; + }; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {google.datastore.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.datastore.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 9: + message.databaseId = reader.string(); + break; + case 5: + message.mode = reader.int32(); + break; + case 1: + message.transaction = reader.bytes(); + break; + case 6: + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.datastore.v1.Mutation.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.datastore.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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()); + }; - /** - * 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(); - }; + /** + * Verifies a CommitRequest message. + * @function verify + * @memberof google.datastore.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.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.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + properties.transactionSelector = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.datastore.v1.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + return null; + }; - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.CommitRequest} CommitRequest + */ + CommitRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.CommitRequest) + return object; + var message = new $root.google.datastore.v1.CommitRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + switch (object.mode) { + case "MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "TRANSACTIONAL": case 1: - message.name = reader.string(); + message.mode = 1; break; + case "NON_TRANSACTIONAL": case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); + message.mode = 2; break; } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofDescriptorProto; - })(); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length) + message.transaction = object.transaction; + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.datastore.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.datastore.v1.CommitRequest.mutations: object expected"); + message.mutations[i] = $root.google.datastore.v1.Mutation.fromObject(object.mutations[i]); + } + } + return message; + }; - protobuf.EnumDescriptorProto = (function() { + /** + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {google.datastore.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.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.projectId = ""; + object.databaseId = ""; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (options.oneofs) + object.transactionSelector = "transaction"; + } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.datastore.v1.CommitRequest.Mode[message.mode] : message.mode; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.datastore.v1.Mutation.toObject(message.mutations[j], options); + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + return object; + }; - /** - * 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 - */ + /** + * Converts this CommitRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.CommitRequest + * @instance + * @returns {Object.} JSON object + */ + CommitRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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]]; - } + /** + * Mode enum. + * @name google.datastore.v1.CommitRequest.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} TRANSACTIONAL=1 TRANSACTIONAL value + * @property {number} NON_TRANSACTIONAL=2 NON_TRANSACTIONAL value + */ + CommitRequest.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRANSACTIONAL"] = 1; + values[valuesById[2] = "NON_TRANSACTIONAL"] = 2; + return values; + })(); - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; + return CommitRequest; + })(); - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; + v1.CommitResponse = (function() { - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; + /** + * Properties of a CommitResponse. + * @memberof google.datastore.v1 + * @interface ICommitResponse + * @property {Array.|null} [mutationResults] CommitResponse mutationResults + * @property {number|null} [indexUpdates] CommitResponse indexUpdates + * @property {google.protobuf.ITimestamp|null} [commitTime] CommitResponse commitTime + */ - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + /** + * Constructs a new CommitResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a CommitResponse. + * @implements ICommitResponse + * @constructor + * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set + */ + function CommitResponse(properties) { + this.mutationResults = []; + if (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 reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * CommitResponse mutationResults. + * @member {Array.} mutationResults + * @memberof google.datastore.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.mutationResults = $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); - }; + /** + * CommitResponse indexUpdates. + * @member {number} indexUpdates + * @memberof google.datastore.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.indexUpdates = 0; - /** - * 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; - }; + /** + * CommitResponse commitTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitTime + * @memberof google.datastore.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.commitTime = null; - /** - * 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(); - }; + /** + * Creates a new CommitResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set + * @returns {google.datastore.v1.CommitResponse} CommitResponse instance + */ + CommitResponse.create = function create(properties) { + return new CommitResponse(properties); + }; - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {google.datastore.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.mutationResults != null && message.mutationResults.length) + for (var i = 0; i < message.mutationResults.length; ++i) + $root.google.datastore.v1.MutationResult.encode(message.mutationResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.indexUpdates != null && Object.hasOwnProperty.call(message, "indexUpdates")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.indexUpdates); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {google.datastore.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.datastore.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + if (!(message.mutationResults && message.mutationResults.length)) + message.mutationResults = []; + message.mutationResults.push($root.google.datastore.v1.MutationResult.decode(reader, reader.uint32())); + break; + case 4: + message.indexUpdates = reader.int32(); + break; + case 8: + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a CommitResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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 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; + /** + * Verifies a CommitResponse message. + * @function verify + * @memberof google.datastore.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"; + if (message.mutationResults != null && message.hasOwnProperty("mutationResults")) { + if (!Array.isArray(message.mutationResults)) + return "mutationResults: array expected"; + for (var i = 0; i < message.mutationResults.length; ++i) { + var error = $root.google.datastore.v1.MutationResult.verify(message.mutationResults[i]); + if (error) + return "mutationResults." + 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 (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) + if (!$util.isInteger(message.indexUpdates)) + return "indexUpdates: integer expected"; + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTime); if (error) - return "reservedRange." + error; + return "commitTime." + 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; - }; + 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]); + /** + * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.CommitResponse} CommitResponse + */ + CommitResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.CommitResponse) + return object; + var message = new $root.google.datastore.v1.CommitResponse(); + if (object.mutationResults) { + if (!Array.isArray(object.mutationResults)) + throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: array expected"); + message.mutationResults = []; + for (var i = 0; i < object.mutationResults.length; ++i) { + if (typeof object.mutationResults[i] !== "object") + throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: object expected"); + message.mutationResults[i] = $root.google.datastore.v1.MutationResult.fromObject(object.mutationResults[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.indexUpdates != null) + message.indexUpdates = object.indexUpdates | 0; + if (object.commitTime != null) { + if (typeof object.commitTime !== "object") + throw TypeError(".google.datastore.v1.CommitResponse.commitTime: object expected"); + message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); } - } - 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; - }; + return message; + }; + + /** + * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {google.datastore.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.arrays || options.defaults) + object.mutationResults = []; + if (options.defaults) { + object.indexUpdates = 0; + object.commitTime = null; + } + if (message.mutationResults && message.mutationResults.length) { + object.mutationResults = []; + for (var j = 0; j < message.mutationResults.length; ++j) + object.mutationResults[j] = $root.google.datastore.v1.MutationResult.toObject(message.mutationResults[j], options); + } + if (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) + object.indexUpdates = message.indexUpdates; + if (message.commitTime != null && message.hasOwnProperty("commitTime")) + object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); + return object; + }; - /** - * 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 CommitResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.CommitResponse + * @instance + * @returns {Object.} JSON object + */ + CommitResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return CommitResponse; + })(); - EnumDescriptorProto.EnumReservedRange = (function() { + v1.AllocateIdsRequest = (function() { /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end + * Properties of an AllocateIdsRequest. + * @memberof google.datastore.v1 + * @interface IAllocateIdsRequest + * @property {string|null} [projectId] AllocateIdsRequest projectId + * @property {string|null} [databaseId] AllocateIdsRequest databaseId + * @property {Array.|null} [keys] AllocateIdsRequest keys */ /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange + * Constructs a new AllocateIdsRequest. + * @memberof google.datastore.v1 + * @classdesc Represents an AllocateIdsRequest. + * @implements IAllocateIdsRequest * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set */ - function EnumReservedRange(properties) { + function AllocateIdsRequest(properties) { + this.keys = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20466,88 +22097,104 @@ } /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * AllocateIdsRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.AllocateIdsRequest * @instance */ - EnumReservedRange.prototype.start = 0; + AllocateIdsRequest.prototype.projectId = ""; /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * AllocateIdsRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.AllocateIdsRequest * @instance */ - EnumReservedRange.prototype.end = 0; + AllocateIdsRequest.prototype.databaseId = ""; /** - * Creates a new EnumReservedRange instance using the specified properties. + * AllocateIdsRequest keys. + * @member {Array.} keys + * @memberof google.datastore.v1.AllocateIdsRequest + * @instance + */ + AllocateIdsRequest.prototype.keys = $util.emptyArray; + + /** + * Creates a new AllocateIdsRequest instance using the specified properties. * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.datastore.v1.AllocateIdsRequest * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest instance */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); + AllocateIdsRequest.create = function create(properties) { + return new AllocateIdsRequest(properties); }; /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.datastore.v1.AllocateIdsRequest * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumReservedRange.encode = function encode(message, writer) { + AllocateIdsRequest.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.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); return writer; }; /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * Encodes the specified AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.datastore.v1.AllocateIdsRequest * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + AllocateIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EnumReservedRange message from the specified reader or buffer. + * Decodes an AllocateIdsRequest message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.datastore.v1.AllocateIdsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest * @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) { + AllocateIdsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.start = reader.int32(); + case 8: + message.projectId = reader.string(); break; - case 2: - message.end = reader.int32(); + case 9: + message.databaseId = reader.string(); + break; + case 1: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -20558,7594 +22205,8221 @@ }; /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * Decodes an AllocateIdsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.datastore.v1.AllocateIdsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest * @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) { + AllocateIdsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EnumReservedRange message. + * Verifies an AllocateIdsRequest message. * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.datastore.v1.AllocateIdsRequest * @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) { + AllocateIdsRequest.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.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.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.datastore.v1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } return null; }; /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * Creates an AllocateIdsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.datastore.v1.AllocateIdsRequest * @static * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + AllocateIdsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AllocateIdsRequest) 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; + var message = new $root.google.datastore.v1.AllocateIdsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.datastore.v1.AllocateIdsRequest.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.datastore.v1.AllocateIdsRequest.keys: object expected"); + message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); + } + } return message; }; /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * Creates a plain object from an AllocateIdsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.datastore.v1.AllocateIdsRequest * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {google.datastore.v1.AllocateIdsRequest} message AllocateIdsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EnumReservedRange.toObject = function toObject(message, options) { + AllocateIdsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.keys = []; if (options.defaults) { - object.start = 0; - object.end = 0; + object.projectId = ""; + object.databaseId = ""; } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + } + 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 EnumReservedRange to JSON. + * Converts this AllocateIdsRequest to JSON. * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @memberof google.datastore.v1.AllocateIdsRequest * @instance * @returns {Object.} JSON object */ - EnumReservedRange.prototype.toJSON = function toJSON() { + AllocateIdsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EnumReservedRange; + return AllocateIdsRequest; })(); - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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; - }; + v1.AllocateIdsResponse = (function() { - /** - * 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; - }; + /** + * Properties of an AllocateIdsResponse. + * @memberof google.datastore.v1 + * @interface IAllocateIdsResponse + * @property {Array.|null} [keys] AllocateIdsResponse keys + */ - /** - * 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; + /** + * Constructs a new AllocateIdsResponse. + * @memberof google.datastore.v1 + * @classdesc Represents an AllocateIdsResponse. + * @implements IAllocateIdsResponse + * @constructor + * @param {google.datastore.v1.IAllocateIdsResponse=} [properties] Properties to set + */ + function AllocateIdsResponse(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]]; } - 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); - }; + /** + * AllocateIdsResponse keys. + * @member {Array.} keys + * @memberof google.datastore.v1.AllocateIdsResponse + * @instance + */ + AllocateIdsResponse.prototype.keys = $util.emptyArray; - return EnumValueDescriptorProto; - })(); + /** + * Creates a new AllocateIdsResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {google.datastore.v1.IAllocateIdsResponse=} [properties] Properties to set + * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse instance + */ + AllocateIdsResponse.create = function create(properties) { + return new AllocateIdsResponse(properties); + }; - protobuf.ServiceDescriptorProto = (function() { + /** + * Encodes the specified AllocateIdsResponse message. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {google.datastore.v1.IAllocateIdsResponse} message AllocateIdsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocateIdsResponse.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * 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 - */ + /** + * Encodes the specified AllocateIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {google.datastore.v1.IAllocateIdsResponse} message AllocateIdsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocateIdsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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]]; - } + /** + * Decodes an AllocateIdsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocateIdsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; + /** + * Decodes an AllocateIdsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocateIdsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; + /** + * Verifies an AllocateIdsResponse message. + * @function verify + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocateIdsResponse.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.datastore.v1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + return null; + }; - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; + /** + * Creates an AllocateIdsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse + */ + AllocateIdsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AllocateIdsResponse) + return object; + var message = new $root.google.datastore.v1.AllocateIdsResponse(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.datastore.v1.AllocateIdsResponse.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.datastore.v1.AllocateIdsResponse.keys: object expected"); + message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); + } + } + return message; + }; - /** - * 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); - }; + /** + * Creates a plain object from an AllocateIdsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {google.datastore.v1.AllocateIdsResponse} message AllocateIdsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocateIdsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + } + return object; + }; + + /** + * Converts this AllocateIdsResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.AllocateIdsResponse + * @instance + * @returns {Object.} JSON object + */ + AllocateIdsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return AllocateIdsResponse; + })(); - /** - * 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(); - }; + v1.ReserveIdsRequest = (function() { - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Properties of a ReserveIdsRequest. + * @memberof google.datastore.v1 + * @interface IReserveIdsRequest + * @property {string|null} [projectId] ReserveIdsRequest projectId + * @property {string|null} [databaseId] ReserveIdsRequest databaseId + * @property {Array.|null} [keys] ReserveIdsRequest keys + */ + + /** + * Constructs a new ReserveIdsRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a ReserveIdsRequest. + * @implements IReserveIdsRequest + * @constructor + * @param {google.datastore.v1.IReserveIdsRequest=} [properties] Properties to set + */ + function ReserveIdsRequest(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]]; } - 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()); - }; + /** + * ReserveIdsRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.ReserveIdsRequest + * @instance + */ + ReserveIdsRequest.prototype.projectId = ""; - /** - * 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; - }; + /** + * ReserveIdsRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.ReserveIdsRequest + * @instance + */ + ReserveIdsRequest.prototype.databaseId = ""; - /** - * 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; - }; + /** + * ReserveIdsRequest keys. + * @member {Array.} keys + * @memberof google.datastore.v1.ReserveIdsRequest + * @instance + */ + ReserveIdsRequest.prototype.keys = $util.emptyArray; - /** - * 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; - }; + /** + * Creates a new ReserveIdsRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.ReserveIdsRequest + * @static + * @param {google.datastore.v1.IReserveIdsRequest=} [properties] Properties to set + * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest instance + */ + ReserveIdsRequest.create = function create(properties) { + return new ReserveIdsRequest(properties); + }; + + /** + * Encodes the specified ReserveIdsRequest message. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.ReserveIdsRequest + * @static + * @param {google.datastore.v1.IReserveIdsRequest} message ReserveIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReserveIdsRequest.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + return writer; + }; - /** - * 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); - }; + /** + * Encodes the specified ReserveIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.ReserveIdsRequest + * @static + * @param {google.datastore.v1.IReserveIdsRequest} message ReserveIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReserveIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return ServiceDescriptorProto; - })(); + /** + * Decodes a ReserveIdsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.ReserveIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReserveIdsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 9: + message.databaseId = reader.string(); + break; + case 1: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - protobuf.MethodDescriptorProto = (function() { + /** + * Decodes a ReserveIdsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.ReserveIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReserveIdsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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 - */ + /** + * Verifies a ReserveIdsRequest message. + * @function verify + * @memberof google.datastore.v1.ReserveIdsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReserveIdsRequest.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.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: 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.datastore.v1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + return null; + }; - /** - * 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]]; - } + /** + * Creates a ReserveIdsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.ReserveIdsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest + */ + ReserveIdsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.ReserveIdsRequest) + return object; + var message = new $root.google.datastore.v1.ReserveIdsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.datastore.v1.ReserveIdsRequest.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.datastore.v1.ReserveIdsRequest.keys: object expected"); + message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); + } + } + return message; + }; - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; + /** + * Creates a plain object from a ReserveIdsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.ReserveIdsRequest + * @static + * @param {google.datastore.v1.ReserveIdsRequest} message ReserveIdsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReserveIdsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) { + object.projectId = ""; + object.databaseId = ""; + } + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + return object; + }; - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; + /** + * Converts this ReserveIdsRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.ReserveIdsRequest + * @instance + * @returns {Object.} JSON object + */ + ReserveIdsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; + return ReserveIdsRequest; + })(); - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; + v1.ReserveIdsResponse = (function() { - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; + /** + * Properties of a ReserveIdsResponse. + * @memberof google.datastore.v1 + * @interface IReserveIdsResponse + */ - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; + /** + * Constructs a new ReserveIdsResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a ReserveIdsResponse. + * @implements IReserveIdsResponse + * @constructor + * @param {google.datastore.v1.IReserveIdsResponse=} [properties] Properties to set + */ + function ReserveIdsResponse(properties) { + if (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 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); - }; + /** + * Creates a new ReserveIdsResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {google.datastore.v1.IReserveIdsResponse=} [properties] Properties to set + * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse instance + */ + ReserveIdsResponse.create = function create(properties) { + return new ReserveIdsResponse(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 ReserveIdsResponse message. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {google.datastore.v1.IReserveIdsResponse} message ReserveIdsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReserveIdsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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(); - }; + /** + * Encodes the specified ReserveIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {google.datastore.v1.IReserveIdsResponse} message ReserveIdsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReserveIdsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.inputType = reader.string(); - break; - case 3: - message.outputType = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.clientStreaming = reader.bool(); - break; - case 6: - message.serverStreaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a ReserveIdsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReserveIdsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ReserveIdsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReserveIdsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; + /** + * Verifies a ReserveIdsResponse message. + * @function verify + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReserveIdsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ReserveIdsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse + */ + ReserveIdsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.ReserveIdsResponse) + return object; + return new $root.google.datastore.v1.ReserveIdsResponse(); + }; + + /** + * Creates a plain object from a ReserveIdsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {google.datastore.v1.ReserveIdsResponse} message ReserveIdsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReserveIdsResponse.toObject = function toObject() { + return {}; + }; - /** - * 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; - }; + /** + * Converts this ReserveIdsResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.ReserveIdsResponse + * @instance + * @returns {Object.} JSON object + */ + ReserveIdsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return ReserveIdsResponse; + })(); - /** - * 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); - }; + v1.Mutation = (function() { - return MethodDescriptorProto; - })(); + /** + * Properties of a Mutation. + * @memberof google.datastore.v1 + * @interface IMutation + * @property {google.datastore.v1.IEntity|null} [insert] Mutation insert + * @property {google.datastore.v1.IEntity|null} [update] Mutation update + * @property {google.datastore.v1.IEntity|null} [upsert] Mutation upsert + * @property {google.datastore.v1.IKey|null} ["delete"] Mutation delete + * @property {number|Long|null} [baseVersion] Mutation baseVersion + * @property {google.protobuf.ITimestamp|null} [updateTime] Mutation updateTime + */ - protobuf.FileOptions = (function() { + /** + * Constructs a new Mutation. + * @memberof google.datastore.v1 + * @classdesc Represents a Mutation. + * @implements IMutation + * @constructor + * @param {google.datastore.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]]; + } - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - */ + /** + * Mutation insert. + * @member {google.datastore.v1.IEntity|null|undefined} insert + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype.insert = null; - /** - * 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 = []; - if (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 update. + * @member {google.datastore.v1.IEntity|null|undefined} update + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype.update = null; - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; + /** + * Mutation upsert. + * @member {google.datastore.v1.IEntity|null|undefined} upsert + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype.upsert = null; - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; + /** + * Mutation delete. + * @member {google.datastore.v1.IKey|null|undefined} delete + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype["delete"] = null; - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; + /** + * Mutation baseVersion. + * @member {number|Long|null|undefined} baseVersion + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype.baseVersion = null; - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; + /** + * Mutation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype.updateTime = null; - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; + /** + * Mutation operation. + * @member {"insert"|"update"|"upsert"|"delete"|undefined} operation + * @memberof google.datastore.v1.Mutation + * @instance + */ + Object.defineProperty(Mutation.prototype, "operation", { + get: $util.oneOfGetter($oneOfFields = ["insert", "update", "upsert", "delete"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; + /** + * Mutation conflictDetectionStrategy. + * @member {"baseVersion"|"updateTime"|undefined} conflictDetectionStrategy + * @memberof google.datastore.v1.Mutation + * @instance + */ + Object.defineProperty(Mutation.prototype, "conflictDetectionStrategy", { + get: $util.oneOfGetter($oneOfFields = ["baseVersion", "updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; + /** + * Creates a new Mutation instance using the specified properties. + * @function create + * @memberof google.datastore.v1.Mutation + * @static + * @param {google.datastore.v1.IMutation=} [properties] Properties to set + * @returns {google.datastore.v1.Mutation} Mutation instance + */ + Mutation.create = function create(properties) { + return new Mutation(properties); + }; - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.Mutation + * @static + * @param {google.datastore.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.datastore.v1.Entity.encode(message.insert, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.datastore.v1.Entity.encode(message.update, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.upsert != null && Object.hasOwnProperty.call(message, "upsert")) + $root.google.datastore.v1.Entity.encode(message.upsert, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + $root.google.datastore.v1.Key.encode(message["delete"], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.baseVersion != null && Object.hasOwnProperty.call(message, "baseVersion")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.baseVersion); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.Mutation + * @static + * @param {google.datastore.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(); + }; - /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpGenericServices = false; + /** + * Decodes a Mutation message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Mutation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.insert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + break; + case 5: + message.update = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + break; + case 6: + message.upsert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + break; + case 7: + message["delete"] = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); + break; + case 8: + message.baseVersion = reader.int64(); + break; + case 11: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; + /** + * Decodes a Mutation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.Mutation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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()); + }; - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; + /** + * Verifies a Mutation message. + * @function verify + * @memberof google.datastore.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.datastore.v1.Entity.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.datastore.v1.Entity.verify(message.update); + if (error) + return "update." + error; + } + } + if (message.upsert != null && message.hasOwnProperty("upsert")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.datastore.v1.Entity.verify(message.upsert); + if (error) + return "upsert." + error; + } + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.datastore.v1.Key.verify(message["delete"]); + if (error) + return "delete." + error; + } + } + if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) { + properties.conflictDetectionStrategy = 1; + if (!$util.isInteger(message.baseVersion) && !(message.baseVersion && $util.isInteger(message.baseVersion.low) && $util.isInteger(message.baseVersion.high))) + return "baseVersion: integer|Long expected"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + if (properties.conflictDetectionStrategy === 1) + return "conflictDetectionStrategy: multiple values"; + properties.conflictDetectionStrategy = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + } + return null; + }; + + /** + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.Mutation + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.Mutation} Mutation + */ + Mutation.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Mutation) + return object; + var message = new $root.google.datastore.v1.Mutation(); + if (object.insert != null) { + if (typeof object.insert !== "object") + throw TypeError(".google.datastore.v1.Mutation.insert: object expected"); + message.insert = $root.google.datastore.v1.Entity.fromObject(object.insert); + } + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".google.datastore.v1.Mutation.update: object expected"); + message.update = $root.google.datastore.v1.Entity.fromObject(object.update); + } + if (object.upsert != null) { + if (typeof object.upsert !== "object") + throw TypeError(".google.datastore.v1.Mutation.upsert: object expected"); + message.upsert = $root.google.datastore.v1.Entity.fromObject(object.upsert); + } + if (object["delete"] != null) { + if (typeof object["delete"] !== "object") + throw TypeError(".google.datastore.v1.Mutation.delete: object expected"); + message["delete"] = $root.google.datastore.v1.Key.fromObject(object["delete"]); + } + if (object.baseVersion != null) + if ($util.Long) + (message.baseVersion = $util.Long.fromValue(object.baseVersion)).unsigned = false; + else if (typeof object.baseVersion === "string") + message.baseVersion = parseInt(object.baseVersion, 10); + else if (typeof object.baseVersion === "number") + message.baseVersion = object.baseVersion; + else if (typeof object.baseVersion === "object") + message.baseVersion = new $util.LongBits(object.baseVersion.low >>> 0, object.baseVersion.high >>> 0).toNumber(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.datastore.v1.Mutation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; + /** + * Creates a plain object from a Mutation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.Mutation + * @static + * @param {google.datastore.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.datastore.v1.Entity.toObject(message.insert, options); + if (options.oneofs) + object.operation = "insert"; + } + if (message.update != null && message.hasOwnProperty("update")) { + object.update = $root.google.datastore.v1.Entity.toObject(message.update, options); + if (options.oneofs) + object.operation = "update"; + } + if (message.upsert != null && message.hasOwnProperty("upsert")) { + object.upsert = $root.google.datastore.v1.Entity.toObject(message.upsert, options); + if (options.oneofs) + object.operation = "upsert"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = $root.google.datastore.v1.Key.toObject(message["delete"], options); + if (options.oneofs) + object.operation = "delete"; + } + if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) { + if (typeof message.baseVersion === "number") + object.baseVersion = options.longs === String ? String(message.baseVersion) : message.baseVersion; + else + object.baseVersion = options.longs === String ? $util.Long.prototype.toString.call(message.baseVersion) : options.longs === Number ? new $util.LongBits(message.baseVersion.low >>> 0, message.baseVersion.high >>> 0).toNumber() : message.baseVersion; + if (options.oneofs) + object.conflictDetectionStrategy = "baseVersion"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object.conflictDetectionStrategy = "updateTime"; + } + return object; + }; - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; + /** + * Converts this Mutation to JSON. + * @function toJSON + * @memberof google.datastore.v1.Mutation + * @instance + * @returns {Object.} JSON object + */ + Mutation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; + return Mutation; + })(); - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; + v1.MutationResult = (function() { - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; + /** + * Properties of a MutationResult. + * @memberof google.datastore.v1 + * @interface IMutationResult + * @property {google.datastore.v1.IKey|null} [key] MutationResult key + * @property {number|Long|null} [version] MutationResult version + * @property {google.protobuf.ITimestamp|null} [updateTime] MutationResult updateTime + * @property {boolean|null} [conflictDetected] MutationResult conflictDetected + */ - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; + /** + * Constructs a new MutationResult. + * @memberof google.datastore.v1 + * @classdesc Represents a MutationResult. + * @implements IMutationResult + * @constructor + * @param {google.datastore.v1.IMutationResult=} [properties] Properties to set + */ + function MutationResult(properties) { + if (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 rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; + /** + * MutationResult key. + * @member {google.datastore.v1.IKey|null|undefined} key + * @memberof google.datastore.v1.MutationResult + * @instance + */ + MutationResult.prototype.key = null; - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * MutationResult version. + * @member {number|Long} version + * @memberof google.datastore.v1.MutationResult + * @instance + */ + MutationResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * 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); - }; + /** + * MutationResult updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.datastore.v1.MutationResult + * @instance + */ + MutationResult.prototype.updateTime = null; - /** - * 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * MutationResult conflictDetected. + * @member {boolean} conflictDetected + * @memberof google.datastore.v1.MutationResult + * @instance + */ + MutationResult.prototype.conflictDetected = false; - /** - * 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(); - }; + /** + * Creates a new MutationResult instance using the specified properties. + * @function create + * @memberof google.datastore.v1.MutationResult + * @static + * @param {google.datastore.v1.IMutationResult=} [properties] Properties to set + * @returns {google.datastore.v1.MutationResult} MutationResult instance + */ + MutationResult.create = function create(properties) { + return new MutationResult(properties); + }; - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.javaPackage = reader.string(); - break; - case 8: - message.javaOuterClassname = reader.string(); - break; - case 10: - message.javaMultipleFiles = reader.bool(); - break; - case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; - case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; - case 9: - message.optimizeFor = reader.int32(); - break; - case 11: - message.goPackage = reader.string(); - break; - case 16: - message.ccGenericServices = reader.bool(); - break; - case 17: - message.javaGenericServices = reader.bool(); - break; - case 18: - message.pyGenericServices = reader.bool(); - break; - case 42: - message.phpGenericServices = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.ccEnableArenas = reader.bool(); - break; - case 36: - message.objcClassPrefix = reader.string(); - break; - case 37: - message.csharpNamespace = reader.string(); - break; - case 39: - message.swiftPrefix = reader.string(); - break; - case 40: - message.phpClassPrefix = reader.string(); - break; - case 41: - message.phpNamespace = reader.string(); - break; - case 44: - message.phpMetadataNamespace = reader.string(); - break; - case 45: - message.rubyPackage = reader.string(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified MutationResult message. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.MutationResult + * @static + * @param {google.datastore.v1.IMutationResult} message MutationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.datastore.v1.Key.encode(message.key, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.version); + if (message.conflictDetected != null && Object.hasOwnProperty.call(message, "conflictDetected")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.conflictDetected); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MutationResult message, length delimited. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.MutationResult + * @static + * @param {google.datastore.v1.IMutationResult} message MutationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MutationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MutationResult message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.MutationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.MutationResult} MutationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.MutationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); + break; + case 4: + message.version = reader.int64(); + break; + case 6: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.conflictDetected = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes a MutationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.MutationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.MutationResult} MutationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MutationResult.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; + /** + * Verifies a MutationResult message. + * @function verify + * @memberof google.datastore.v1.MutationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MutationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.datastore.v1.Key.verify(message.key); + if (error) + return "key." + error; } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) + return "version: integer|Long expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); if (error) - return "uninterpretedOption." + error; + return "updateTime." + error; } - } - return null; - }; + if (message.conflictDetected != null && message.hasOwnProperty("conflictDetected")) + if (typeof message.conflictDetected !== "boolean") + return "conflictDetected: boolean expected"; + return null; + }; - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + /** + * Creates a MutationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.MutationResult + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.MutationResult} MutationResult + */ + MutationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.MutationResult) + return object; + var message = new $root.google.datastore.v1.MutationResult(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.datastore.v1.MutationResult.key: object expected"); + message.key = $root.google.datastore.v1.Key.fromObject(object.key); + } + if (object.version != null) + if ($util.Long) + (message.version = $util.Long.fromValue(object.version)).unsigned = false; + else if (typeof object.version === "string") + message.version = parseInt(object.version, 10); + else if (typeof object.version === "number") + message.version = object.version; + else if (typeof object.version === "object") + message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.datastore.v1.MutationResult.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.conflictDetected != null) + message.conflictDetected = Boolean(object.conflictDetected); + return message; + }; + + /** + * Creates a plain object from a MutationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.MutationResult + * @static + * @param {google.datastore.v1.MutationResult} message MutationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MutationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.key = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.version = options.longs === String ? "0" : 0; + object.conflictDetected = false; + object.updateTime = null; } + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.datastore.v1.Key.toObject(message.key, options); + if (message.version != null && message.hasOwnProperty("version")) + if (typeof message.version === "number") + object.version = options.longs === String ? String(message.version) : message.version; + else + object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; + if (message.conflictDetected != null && message.hasOwnProperty("conflictDetected")) + object.conflictDetected = message.conflictDetected; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this MutationResult to JSON. + * @function toJSON + * @memberof google.datastore.v1.MutationResult + * @instance + * @returns {Object.} JSON object + */ + MutationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MutationResult; + })(); + + v1.ReadOptions = (function() { + + /** + * Properties of a ReadOptions. + * @memberof google.datastore.v1 + * @interface IReadOptions + * @property {google.datastore.v1.ReadOptions.ReadConsistency|null} [readConsistency] ReadOptions readConsistency + * @property {Uint8Array|null} [transaction] ReadOptions transaction + * @property {google.protobuf.ITimestamp|null} [readTime] ReadOptions readTime + */ + + /** + * Constructs a new ReadOptions. + * @memberof google.datastore.v1 + * @classdesc Represents a ReadOptions. + * @implements IReadOptions + * @constructor + * @param {google.datastore.v1.IReadOptions=} [properties] Properties to set + */ + function ReadOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * 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 = []; - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * ReadOptions readConsistency. + * @member {google.datastore.v1.ReadOptions.ReadConsistency|null|undefined} readConsistency + * @memberof google.datastore.v1.ReadOptions + * @instance + */ + ReadOptions.prototype.readConsistency = null; - /** - * 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); - }; + /** + * ReadOptions transaction. + * @member {Uint8Array|null|undefined} transaction + * @memberof google.datastore.v1.ReadOptions + * @instance + */ + ReadOptions.prototype.transaction = null; - /** - * 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; - })(); + /** + * ReadOptions readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.ReadOptions + * @instance + */ + ReadOptions.prototype.readTime = null; - return FileOptions; - })(); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReadOptions consistencyType. + * @member {"readConsistency"|"transaction"|"readTime"|undefined} consistencyType + * @memberof google.datastore.v1.ReadOptions + * @instance + */ + Object.defineProperty(ReadOptions.prototype, "consistencyType", { + get: $util.oneOfGetter($oneOfFields = ["readConsistency", "transaction", "readTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReadOptions instance using the specified properties. + * @function create + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {google.datastore.v1.IReadOptions=} [properties] Properties to set + * @returns {google.datastore.v1.ReadOptions} ReadOptions instance + */ + ReadOptions.create = function create(properties) { + return new ReadOptions(properties); + }; + + /** + * Encodes the specified ReadOptions message. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {google.datastore.v1.IReadOptions} message ReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readConsistency != null && Object.hasOwnProperty.call(message, "readConsistency")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.readConsistency); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transaction); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {google.datastore.v1.IReadOptions} message ReadOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReadOptions message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.ReadOptions} ReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReadOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readConsistency = reader.int32(); + break; + case 2: + message.transaction = reader.bytes(); + break; + case 4: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReadOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.ReadOptions} ReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReadOptions message. + * @function verify + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { + properties.consistencyType = 1; + switch (message.readConsistency) { + default: + return "readConsistency: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + if (properties.consistencyType === 1) + return "consistencyType: multiple values"; + properties.consistencyType = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.consistencyType === 1) + return "consistencyType: multiple values"; + properties.consistencyType = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + } + return null; + }; - protobuf.MessageOptions = (function() { + /** + * Creates a ReadOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.ReadOptions} ReadOptions + */ + ReadOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.ReadOptions) + return object; + var message = new $root.google.datastore.v1.ReadOptions(); + switch (object.readConsistency) { + case "READ_CONSISTENCY_UNSPECIFIED": + case 0: + message.readConsistency = 0; + break; + case "STRONG": + case 1: + message.readConsistency = 1; + break; + case "EVENTUAL": + case 2: + message.readConsistency = 2; + break; + } + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length) + message.transaction = object.transaction; + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.ReadOptions.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + return message; + }; - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - */ + /** + * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {google.datastore.v1.ReadOptions} message ReadOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { + object.readConsistency = options.enums === String ? $root.google.datastore.v1.ReadOptions.ReadConsistency[message.readConsistency] : message.readConsistency; + if (options.oneofs) + object.consistencyType = "readConsistency"; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (options.oneofs) + object.consistencyType = "transaction"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (options.oneofs) + object.consistencyType = "readTime"; + } + return object; + }; - /** - * 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]]; - } + /** + * Converts this ReadOptions to JSON. + * @function toJSON + * @memberof google.datastore.v1.ReadOptions + * @instance + * @returns {Object.} JSON object + */ + ReadOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; + /** + * ReadConsistency enum. + * @name google.datastore.v1.ReadOptions.ReadConsistency + * @enum {number} + * @property {number} READ_CONSISTENCY_UNSPECIFIED=0 READ_CONSISTENCY_UNSPECIFIED value + * @property {number} STRONG=1 STRONG value + * @property {number} EVENTUAL=2 EVENTUAL value + */ + ReadOptions.ReadConsistency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "READ_CONSISTENCY_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRONG"] = 1; + values[valuesById[2] = "EVENTUAL"] = 2; + return values; + })(); - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; + return ReadOptions; + })(); - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; + v1.TransactionOptions = (function() { - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; + /** + * Properties of a TransactionOptions. + * @memberof google.datastore.v1 + * @interface ITransactionOptions + * @property {google.datastore.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite + * @property {google.datastore.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly + */ - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Constructs a new TransactionOptions. + * @memberof google.datastore.v1 + * @classdesc Represents a TransactionOptions. + * @implements ITransactionOptions + * @constructor + * @param {google.datastore.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]]; + } - /** - * 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); - }; + /** + * TransactionOptions readWrite. + * @member {google.datastore.v1.TransactionOptions.IReadWrite|null|undefined} readWrite + * @memberof google.datastore.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.readWrite = null; - /** - * 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.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; - }; + /** + * TransactionOptions readOnly. + * @member {google.datastore.v1.TransactionOptions.IReadOnly|null|undefined} readOnly + * @memberof google.datastore.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.readOnly = null; - /** - * 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(); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messageSetWireFormat = reader.bool(); - break; - case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.mapEntry = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * TransactionOptions mode. + * @member {"readWrite"|"readOnly"|undefined} mode + * @memberof google.datastore.v1.TransactionOptions + * @instance + */ + Object.defineProperty(TransactionOptions.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["readWrite", "readOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * 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()); - }; + /** + * Creates a new TransactionOptions instance using the specified properties. + * @function create + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {google.datastore.v1.ITransactionOptions=} [properties] Properties to set + * @returns {google.datastore.v1.TransactionOptions} TransactionOptions instance + */ + TransactionOptions.create = function create(properties) { + return new TransactionOptions(properties); + }; - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + /** + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {google.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; + /** + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {google.datastore.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(); + }; - /** - * 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; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Decodes a TransactionOptions message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); + break; + case 2: + message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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()); + }; - return MessageOptions; - })(); + /** + * Verifies a TransactionOptions message. + * @function verify + * @memberof google.datastore.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.datastore.v1.TransactionOptions.ReadWrite.verify(message.readWrite); + if (error) + return "readWrite." + error; + } + } + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.datastore.v1.TransactionOptions.ReadOnly.verify(message.readOnly); + if (error) + return "readOnly." + error; + } + } + return null; + }; - protobuf.FieldOptions = (function() { + /** + * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.TransactionOptions} TransactionOptions + */ + TransactionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.TransactionOptions) + return object; + var message = new $root.google.datastore.v1.TransactionOptions(); + if (object.readWrite != null) { + if (typeof object.readWrite !== "object") + throw TypeError(".google.datastore.v1.TransactionOptions.readWrite: object expected"); + message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); + } + if (object.readOnly != null) { + if (typeof object.readOnly !== "object") + throw TypeError(".google.datastore.v1.TransactionOptions.readOnly: object expected"); + message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); + } + return message; + }; - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - */ + /** + * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {google.datastore.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 (message.readWrite != null && message.hasOwnProperty("readWrite")) { + object.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); + if (options.oneofs) + object.mode = "readWrite"; + } + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + object.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); + if (options.oneofs) + object.mode = "readOnly"; + } + return object; + }; - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this TransactionOptions to JSON. + * @function toJSON + * @memberof google.datastore.v1.TransactionOptions + * @instance + * @returns {Object.} JSON object + */ + TransactionOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; + TransactionOptions.ReadWrite = (function() { - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; + /** + * Properties of a ReadWrite. + * @memberof google.datastore.v1.TransactionOptions + * @interface IReadWrite + * @property {Uint8Array|null} [previousTransaction] ReadWrite previousTransaction + */ - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; + /** + * Constructs a new ReadWrite. + * @memberof google.datastore.v1.TransactionOptions + * @classdesc Represents a ReadWrite. + * @implements IReadWrite + * @constructor + * @param {google.datastore.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]]; + } - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; + /** + * ReadWrite previousTransaction. + * @member {Uint8Array} previousTransaction + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @instance + */ + ReadWrite.prototype.previousTransaction = $util.newBuffer([]); - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; + /** + * Creates a new ReadWrite instance using the specified properties. + * @function create + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set + * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite instance + */ + ReadWrite.create = function create(properties) { + return new ReadWrite(properties); + }; - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.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.previousTransaction != null && Object.hasOwnProperty.call(message, "previousTransaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.previousTransaction); + return writer; + }; - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.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(); + }; - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * Decodes a ReadWrite message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.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.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.previousTransaction = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a ReadWrite message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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()); + }; - /** - * 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.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { - writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.int32(message[".google.api.fieldBehavior"][i]); - writer.ldelim(); - } - return writer; - }; + /** + * Verifies a ReadWrite message. + * @function verify + * @memberof google.datastore.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.previousTransaction != null && message.hasOwnProperty("previousTransaction")) + if (!(message.previousTransaction && typeof message.previousTransaction.length === "number" || $util.isString(message.previousTransaction))) + return "previousTransaction: buffer expected"; + return null; + }; - /** - * 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(); - }; + /** + * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite + */ + ReadWrite.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadWrite) + return object; + var message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); + if (object.previousTransaction != null) + if (typeof object.previousTransaction === "string") + $util.base64.decode(object.previousTransaction, message.previousTransaction = $util.newBuffer($util.base64.length(object.previousTransaction)), 0); + else if (object.previousTransaction.length) + message.previousTransaction = object.previousTransaction; + return message; + }; - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1052: - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.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) + if (options.bytes === String) + object.previousTransaction = ""; + else { + object.previousTransaction = []; + if (options.bytes !== Array) + object.previousTransaction = $util.newBuffer(object.previousTransaction); + } + if (message.previousTransaction != null && message.hasOwnProperty("previousTransaction")) + object.previousTransaction = options.bytes === String ? $util.base64.encode(message.previousTransaction, 0, message.previousTransaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.previousTransaction) : message.previousTransaction; + return object; + }; - /** - * 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()); - }; + /** + * Converts this ReadWrite to JSON. + * @function toJSON + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @instance + * @returns {Object.} JSON object + */ + ReadWrite.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - return null; - }; + return ReadWrite; + })(); - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + TransactionOptions.ReadOnly = (function() { + + /** + * Properties of a ReadOnly. + * @memberof google.datastore.v1.TransactionOptions + * @interface IReadOnly + * @property {google.protobuf.ITimestamp|null} [readTime] ReadOnly readTime + */ + + /** + * Constructs a new ReadOnly. + * @memberof google.datastore.v1.TransactionOptions + * @classdesc Represents a ReadOnly. + * @implements IReadOnly + * @constructor + * @param {google.datastore.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]]; } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - } - } - return message; - }; - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - return object; - }; + /** + * ReadOnly readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.readTime = null; - /** - * 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); - }; + /** + * Creates a new ReadOnly instance using the specified properties. + * @function create + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.datastore.v1.TransactionOptions.IReadOnly=} [properties] Properties to set + * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly instance + */ + ReadOnly.create = function create(properties) { + return new ReadOnly(properties); + }; - /** - * 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; - })(); + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.datastore.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.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * 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; - })(); + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.datastore.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(); + }; - return FieldOptions; - })(); + /** + * Decodes a ReadOnly message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.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.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - protobuf.OneofOptions = (function() { + /** + * Decodes a ReadOnly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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()); + }; - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ + /** + * Verifies a ReadOnly message. + * @function verify + * @memberof google.datastore.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"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; + }; - /** - * 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]]; - } + /** + * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly + */ + ReadOnly.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadOnly) + return object; + var message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.TransactionOptions.ReadOnly.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + return message; + }; - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.datastore.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.readTime = null; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + return object; + }; - /** - * 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); - }; + /** + * Converts this ReadOnly to JSON. + * @function toJSON + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @instance + * @returns {Object.} JSON object + */ + ReadOnly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + return ReadOnly; + })(); + + return TransactionOptions; + })(); + + return v1; + })(); + + datastore.admin = (function() { /** - * 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 + * Namespace admin. + * @memberof google.datastore + * @namespace */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + var admin = {}; - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + admin.v1 = (function() { - /** - * 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()); - }; + /** + * Namespace v1. + * @memberof google.datastore.admin + * @namespace + */ + var v1 = {}; - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + v1.MigrationStateEvent = (function() { - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + /** + * Properties of a MigrationStateEvent. + * @memberof google.datastore.admin.v1 + * @interface IMigrationStateEvent + * @property {google.datastore.admin.v1.MigrationState|null} [state] MigrationStateEvent state + */ + + /** + * Constructs a new MigrationStateEvent. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a MigrationStateEvent. + * @implements IMigrationStateEvent + * @constructor + * @param {google.datastore.admin.v1.IMigrationStateEvent=} [properties] Properties to set + */ + function MigrationStateEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * MigrationStateEvent state. + * @member {google.datastore.admin.v1.MigrationState} state + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @instance + */ + MigrationStateEvent.prototype.state = 0; - /** - * 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); - }; + /** + * Creates a new MigrationStateEvent instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {google.datastore.admin.v1.IMigrationStateEvent=} [properties] Properties to set + * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent instance + */ + MigrationStateEvent.create = function create(properties) { + return new MigrationStateEvent(properties); + }; + + /** + * Encodes the specified MigrationStateEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {google.datastore.admin.v1.IMigrationStateEvent} message MigrationStateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationStateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + return writer; + }; + + /** + * Encodes the specified MigrationStateEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {google.datastore.admin.v1.IMigrationStateEvent} message MigrationStateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationStateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationStateEvent message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationStateEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationStateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationStateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationStateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return OneofOptions; - })(); + /** + * Verifies a MigrationStateEvent message. + * @function verify + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationStateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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; + } + return null; + }; - protobuf.EnumOptions = (function() { + /** + * Creates a MigrationStateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent + */ + MigrationStateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.MigrationStateEvent) + return object; + var message = new $root.google.datastore.admin.v1.MigrationStateEvent(); + switch (object.state) { + case "MIGRATION_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": + case 1: + message.state = 1; + break; + case "PAUSED": + case 2: + message.state = 2; + break; + case "COMPLETE": + case 3: + message.state = 3; + break; + } + return message; + }; - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ + /** + * Creates a plain object from a MigrationStateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {google.datastore.admin.v1.MigrationStateEvent} message MigrationStateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationStateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.state = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.state] : message.state; + return object; + }; - /** - * 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]]; - } + /** + * Converts this MigrationStateEvent to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @instance + * @returns {Object.} JSON object + */ + MigrationStateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; + return MigrationStateEvent; + })(); - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; + v1.MigrationProgressEvent = (function() { - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Properties of a MigrationProgressEvent. + * @memberof google.datastore.admin.v1 + * @interface IMigrationProgressEvent + * @property {google.datastore.admin.v1.MigrationStep|null} [step] MigrationProgressEvent step + * @property {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null} [prepareStepDetails] MigrationProgressEvent prepareStepDetails + * @property {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null} [redirectWritesStepDetails] MigrationProgressEvent redirectWritesStepDetails + */ - /** - * 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); - }; + /** + * Constructs a new MigrationProgressEvent. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a MigrationProgressEvent. + * @implements IMigrationProgressEvent + * @constructor + * @param {google.datastore.admin.v1.IMigrationProgressEvent=} [properties] Properties to set + */ + function MigrationProgressEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * MigrationProgressEvent step. + * @member {google.datastore.admin.v1.MigrationStep} step + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + */ + MigrationProgressEvent.prototype.step = 0; - /** - * 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(); - }; + /** + * MigrationProgressEvent prepareStepDetails. + * @member {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null|undefined} prepareStepDetails + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + */ + MigrationProgressEvent.prototype.prepareStepDetails = null; - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * MigrationProgressEvent redirectWritesStepDetails. + * @member {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null|undefined} redirectWritesStepDetails + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + */ + MigrationProgressEvent.prototype.redirectWritesStepDetails = null; - /** - * 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()); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + /** + * MigrationProgressEvent stepDetails. + * @member {"prepareStepDetails"|"redirectWritesStepDetails"|undefined} stepDetails + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + */ + Object.defineProperty(MigrationProgressEvent.prototype, "stepDetails", { + get: $util.oneOfGetter($oneOfFields = ["prepareStepDetails", "redirectWritesStepDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; + /** + * Creates a new MigrationProgressEvent instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {google.datastore.admin.v1.IMigrationProgressEvent=} [properties] Properties to set + * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent instance + */ + MigrationProgressEvent.create = function create(properties) { + return new MigrationProgressEvent(properties); + }; - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Encodes the specified MigrationProgressEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {google.datastore.admin.v1.IMigrationProgressEvent} message MigrationProgressEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationProgressEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.step != null && Object.hasOwnProperty.call(message, "step")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.step); + if (message.prepareStepDetails != null && Object.hasOwnProperty.call(message, "prepareStepDetails")) + $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.encode(message.prepareStepDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.redirectWritesStepDetails != null && Object.hasOwnProperty.call(message, "redirectWritesStepDetails")) + $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.encode(message.redirectWritesStepDetails, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MigrationProgressEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {google.datastore.admin.v1.IMigrationProgressEvent} message MigrationProgressEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationProgressEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationProgressEvent message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationProgressEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.step = reader.int32(); + break; + case 2: + message.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.decode(reader, reader.uint32()); + break; + case 3: + message.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationProgressEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationProgressEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MigrationProgressEvent message. + * @function verify + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationProgressEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.step != null && message.hasOwnProperty("step")) + switch (message.step) { + default: + return "step: enum value expected"; + case 0: + case 6: + case 1: + case 7: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { + properties.stepDetails = 1; + { + var error = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify(message.prepareStepDetails); + if (error) + return "prepareStepDetails." + error; + } + } + if (message.redirectWritesStepDetails != null && message.hasOwnProperty("redirectWritesStepDetails")) { + if (properties.stepDetails === 1) + return "stepDetails: multiple values"; + properties.stepDetails = 1; + { + var error = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify(message.redirectWritesStepDetails); + if (error) + return "redirectWritesStepDetails." + error; + } + } + return null; + }; - /** - * 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); - }; + /** + * Creates a MigrationProgressEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent + */ + MigrationProgressEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent) + return object; + var message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); + switch (object.step) { + case "MIGRATION_STEP_UNSPECIFIED": + case 0: + message.step = 0; + break; + case "PREPARE": + case 6: + message.step = 6; + break; + case "START": + case 1: + message.step = 1; + break; + case "APPLY_WRITES_SYNCHRONOUSLY": + case 7: + message.step = 7; + break; + case "COPY_AND_VERIFY": + case 2: + message.step = 2; + break; + case "REDIRECT_EVENTUALLY_CONSISTENT_READS": + case 3: + message.step = 3; + break; + case "REDIRECT_STRONGLY_CONSISTENT_READS": + case 4: + message.step = 4; + break; + case "REDIRECT_WRITES": + case 5: + message.step = 5; + break; + } + if (object.prepareStepDetails != null) { + if (typeof object.prepareStepDetails !== "object") + throw TypeError(".google.datastore.admin.v1.MigrationProgressEvent.prepareStepDetails: object expected"); + message.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.fromObject(object.prepareStepDetails); + } + if (object.redirectWritesStepDetails != null) { + if (typeof object.redirectWritesStepDetails !== "object") + throw TypeError(".google.datastore.admin.v1.MigrationProgressEvent.redirectWritesStepDetails: object expected"); + message.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.fromObject(object.redirectWritesStepDetails); + } + return message; + }; - return EnumOptions; - })(); + /** + * Creates a plain object from a MigrationProgressEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent} message MigrationProgressEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationProgressEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.step = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; + if (message.step != null && message.hasOwnProperty("step")) + object.step = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.step] : message.step; + if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { + object.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.toObject(message.prepareStepDetails, options); + if (options.oneofs) + object.stepDetails = "prepareStepDetails"; + } + if (message.redirectWritesStepDetails != null && message.hasOwnProperty("redirectWritesStepDetails")) { + object.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.toObject(message.redirectWritesStepDetails, options); + if (options.oneofs) + object.stepDetails = "redirectWritesStepDetails"; + } + return object; + }; - protobuf.EnumValueOptions = (function() { + /** + * Converts this MigrationProgressEvent to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + * @returns {Object.} JSON object + */ + MigrationProgressEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ + /** + * ConcurrencyMode enum. + * @name google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + * @enum {number} + * @property {number} CONCURRENCY_MODE_UNSPECIFIED=0 CONCURRENCY_MODE_UNSPECIFIED value + * @property {number} PESSIMISTIC=1 PESSIMISTIC value + * @property {number} OPTIMISTIC=2 OPTIMISTIC value + * @property {number} OPTIMISTIC_WITH_ENTITY_GROUPS=3 OPTIMISTIC_WITH_ENTITY_GROUPS value + */ + MigrationProgressEvent.ConcurrencyMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONCURRENCY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PESSIMISTIC"] = 1; + values[valuesById[2] = "OPTIMISTIC"] = 2; + values[valuesById[3] = "OPTIMISTIC_WITH_ENTITY_GROUPS"] = 3; + return values; + })(); - /** - * 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]]; - } + MigrationProgressEvent.PrepareStepDetails = (function() { - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; + /** + * Properties of a PrepareStepDetails. + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @interface IPrepareStepDetails + * @property {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null} [concurrencyMode] PrepareStepDetails concurrencyMode + */ - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Constructs a new PrepareStepDetails. + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @classdesc Represents a PrepareStepDetails. + * @implements IPrepareStepDetails + * @constructor + * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails=} [properties] Properties to set + */ + function PrepareStepDetails(properties) { + if (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 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); - }; + /** + * PrepareStepDetails concurrencyMode. + * @member {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} concurrencyMode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @instance + */ + PrepareStepDetails.prototype.concurrencyMode = 0; - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * Creates a new PrepareStepDetails instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails=} [properties] Properties to set + * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails instance + */ + PrepareStepDetails.create = function create(properties) { + return new PrepareStepDetails(properties); + }; - /** - * 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(); - }; + /** + * Encodes the specified PrepareStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails} message PrepareStepDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareStepDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.concurrencyMode != null && Object.hasOwnProperty.call(message, "concurrencyMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.concurrencyMode); + return writer; + }; - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified PrepareStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails} message PrepareStepDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareStepDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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()); - }; + /** + * Decodes a PrepareStepDetails message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareStepDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.concurrencyMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; + /** + * Decodes a PrepareStepDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareStepDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; + /** + * Verifies a PrepareStepDetails message. + * @function verify + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrepareStepDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) + switch (message.concurrencyMode) { + default: + return "concurrencyMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Creates a PrepareStepDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails + */ + PrepareStepDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + return object; + var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); + switch (object.concurrencyMode) { + case "CONCURRENCY_MODE_UNSPECIFIED": + case 0: + message.concurrencyMode = 0; + break; + case "PESSIMISTIC": + case 1: + message.concurrencyMode = 1; + break; + case "OPTIMISTIC": + case 2: + message.concurrencyMode = 2; + break; + case "OPTIMISTIC_WITH_ENTITY_GROUPS": + case 3: + message.concurrencyMode = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a PrepareStepDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} message PrepareStepDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrepareStepDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; + if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) + object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; + 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); - }; + /** + * Converts this PrepareStepDetails to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @instance + * @returns {Object.} JSON object + */ + PrepareStepDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return EnumValueOptions; - })(); + return PrepareStepDetails; + })(); - protobuf.ServiceOptions = (function() { + MigrationProgressEvent.RedirectWritesStepDetails = (function() { - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - */ + /** + * Properties of a RedirectWritesStepDetails. + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @interface IRedirectWritesStepDetails + * @property {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null} [concurrencyMode] RedirectWritesStepDetails concurrencyMode + */ - /** - * 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]]; - } + /** + * Constructs a new RedirectWritesStepDetails. + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @classdesc Represents a RedirectWritesStepDetails. + * @implements IRedirectWritesStepDetails + * @constructor + * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails=} [properties] Properties to set + */ + function RedirectWritesStepDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; + /** + * RedirectWritesStepDetails concurrencyMode. + * @member {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} concurrencyMode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @instance + */ + RedirectWritesStepDetails.prototype.concurrencyMode = 0; - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Creates a new RedirectWritesStepDetails instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails=} [properties] Properties to set + * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails instance + */ + RedirectWritesStepDetails.create = function create(properties) { + return new RedirectWritesStepDetails(properties); + }; - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; + /** + * Encodes the specified RedirectWritesStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails} message RedirectWritesStepDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectWritesStepDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.concurrencyMode != null && Object.hasOwnProperty.call(message, "concurrencyMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.concurrencyMode); + return writer; + }; - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + /** + * Encodes the specified RedirectWritesStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails} message RedirectWritesStepDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectWritesStepDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes a RedirectWritesStepDetails message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectWritesStepDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.concurrencyMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - return writer; - }; + /** + * Decodes a RedirectWritesStepDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectWritesStepDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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(); - }; + /** + * Verifies a RedirectWritesStepDetails message. + * @function verify + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedirectWritesStepDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) + switch (message.concurrencyMode) { + default: + return "concurrencyMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1049: - message[".google.api.defaultHost"] = reader.string(); - break; - case 1050: - message[".google.api.oauthScopes"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a RedirectWritesStepDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails + */ + RedirectWritesStepDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + return object; + var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); + switch (object.concurrencyMode) { + case "CONCURRENCY_MODE_UNSPECIFIED": + case 0: + message.concurrencyMode = 0; + break; + case "PESSIMISTIC": + case 1: + message.concurrencyMode = 1; + break; + case "OPTIMISTIC": + case 2: + message.concurrencyMode = 2; + break; + case "OPTIMISTIC_WITH_ENTITY_GROUPS": + case 3: + message.concurrencyMode = 3; + 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()); - }; + /** + * Creates a plain object from a RedirectWritesStepDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} message RedirectWritesStepDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedirectWritesStepDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; + if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) + object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; + return object; + }; - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - return null; - }; + /** + * Converts this RedirectWritesStepDetails to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @instance + * @returns {Object.} JSON object + */ + RedirectWritesStepDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - return message; - }; + return RedirectWritesStepDetails; + })(); - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - return object; - }; + return MigrationProgressEvent; + })(); - /** - * 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); - }; + /** + * MigrationState enum. + * @name google.datastore.admin.v1.MigrationState + * @enum {number} + * @property {number} MIGRATION_STATE_UNSPECIFIED=0 MIGRATION_STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} PAUSED=2 PAUSED value + * @property {number} COMPLETE=3 COMPLETE value + */ + v1.MigrationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "PAUSED"] = 2; + values[valuesById[3] = "COMPLETE"] = 3; + return values; + })(); + + /** + * MigrationStep enum. + * @name google.datastore.admin.v1.MigrationStep + * @enum {number} + * @property {number} MIGRATION_STEP_UNSPECIFIED=0 MIGRATION_STEP_UNSPECIFIED value + * @property {number} PREPARE=6 PREPARE value + * @property {number} START=1 START value + * @property {number} APPLY_WRITES_SYNCHRONOUSLY=7 APPLY_WRITES_SYNCHRONOUSLY value + * @property {number} COPY_AND_VERIFY=2 COPY_AND_VERIFY value + * @property {number} REDIRECT_EVENTUALLY_CONSISTENT_READS=3 REDIRECT_EVENTUALLY_CONSISTENT_READS value + * @property {number} REDIRECT_STRONGLY_CONSISTENT_READS=4 REDIRECT_STRONGLY_CONSISTENT_READS value + * @property {number} REDIRECT_WRITES=5 REDIRECT_WRITES value + */ + v1.MigrationStep = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATION_STEP_UNSPECIFIED"] = 0; + values[valuesById[6] = "PREPARE"] = 6; + values[valuesById[1] = "START"] = 1; + values[valuesById[7] = "APPLY_WRITES_SYNCHRONOUSLY"] = 7; + values[valuesById[2] = "COPY_AND_VERIFY"] = 2; + values[valuesById[3] = "REDIRECT_EVENTUALLY_CONSISTENT_READS"] = 3; + values[valuesById[4] = "REDIRECT_STRONGLY_CONSISTENT_READS"] = 4; + values[valuesById[5] = "REDIRECT_WRITES"] = 5; + return values; + })(); - return ServiceOptions; - })(); + v1.DatastoreAdmin = (function() { - protobuf.MethodOptions = (function() { + /** + * Constructs a new DatastoreAdmin service. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a DatastoreAdmin + * @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 DatastoreAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - */ + (DatastoreAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatastoreAdmin; - /** - * 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]]; - } + /** + * Creates new DatastoreAdmin service using the specified rpc implementation. + * @function create + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @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 {DatastoreAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + DatastoreAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#exportEntities}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef ExportEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; + /** + * Calls ExportEntities. + * @function exportEntities + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IExportEntitiesRequest} request ExportEntitiesRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.ExportEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.exportEntities = function exportEntities(request, callback) { + return this.rpcCall(exportEntities, $root.google.datastore.admin.v1.ExportEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportEntities" }); - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Calls ExportEntities. + * @function exportEntities + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IExportEntitiesRequest} request ExportEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#importEntities}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef ImportEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + /** + * Calls ImportEntities. + * @function importEntities + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IImportEntitiesRequest} request ImportEntitiesRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.ImportEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.importEntities = function importEntities(request, callback) { + return this.rpcCall(importEntities, $root.google.datastore.admin.v1.ImportEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportEntities" }); - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + /** + * Calls ImportEntities. + * @function importEntities + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IImportEntitiesRequest} request ImportEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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); - }; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#createIndex}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef CreateIndexCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * 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.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; - }; + /** + * Calls CreateIndex. + * @function createIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.ICreateIndexRequest} request CreateIndexRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.CreateIndexCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.createIndex = function createIndex(request, callback) { + return this.rpcCall(createIndex, $root.google.datastore.admin.v1.CreateIndexRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateIndex" }); - /** - * 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(); - }; + /** + * Calls CreateIndex. + * @function createIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.ICreateIndexRequest} request CreateIndexRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - case 1051: - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - case 1049: - message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#deleteIndex}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef DeleteIndexCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * 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()); - }; + /** + * Calls DeleteIndex. + * @function deleteIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IDeleteIndexRequest} request DeleteIndexRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.DeleteIndexCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.deleteIndex = function deleteIndex(request, callback) { + return this.rpcCall(deleteIndex, $root.google.datastore.admin.v1.DeleteIndexRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteIndex" }); - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { - var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); - if (error) - return ".google.api.http." + error; - } - if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { - if (!Array.isArray(message[".google.api.methodSignature"])) - return ".google.api.methodSignature: array expected"; - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - if (!$util.isString(message[".google.api.methodSignature"][i])) - return ".google.api.methodSignature: string[] expected"; - } - 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; - }; + /** + * Calls DeleteIndex. + * @function deleteIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IDeleteIndexRequest} request DeleteIndexRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - 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; - }; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#getIndex}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef GetIndexCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.admin.v1.Index} [response] Index + */ - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object[".google.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] : message.idempotencyLevel; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.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; - }; + /** + * Calls GetIndex. + * @function getIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IGetIndexRequest} request GetIndexRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.GetIndexCallback} callback Node-style callback called with the error, if any, and Index + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.getIndex = function getIndex(request, callback) { + return this.rpcCall(getIndex, $root.google.datastore.admin.v1.GetIndexRequest, $root.google.datastore.admin.v1.Index, request, callback); + }, "name", { value: "GetIndex" }); - /** - * 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); - }; + /** + * Calls GetIndex. + * @function getIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IGetIndexRequest} request GetIndexRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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; - })(); + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#listIndexes}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef ListIndexesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.admin.v1.ListIndexesResponse} [response] ListIndexesResponse + */ - return MethodOptions; - })(); + /** + * Calls ListIndexes. + * @function listIndexes + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IListIndexesRequest} request ListIndexesRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.ListIndexesCallback} callback Node-style callback called with the error, if any, and ListIndexesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.listIndexes = function listIndexes(request, callback) { + return this.rpcCall(listIndexes, $root.google.datastore.admin.v1.ListIndexesRequest, $root.google.datastore.admin.v1.ListIndexesResponse, request, callback); + }, "name", { value: "ListIndexes" }); - protobuf.UninterpretedOption = (function() { + /** + * Calls ListIndexes. + * @function listIndexes + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IListIndexesRequest} request ListIndexesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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 - */ + return DatastoreAdmin; + })(); - /** - * 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]]; - } + v1.CommonMetadata = (function() { - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; + /** + * Properties of a CommonMetadata. + * @memberof google.datastore.admin.v1 + * @interface ICommonMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] CommonMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CommonMetadata endTime + * @property {google.datastore.admin.v1.OperationType|null} [operationType] CommonMetadata operationType + * @property {Object.|null} [labels] CommonMetadata labels + * @property {google.datastore.admin.v1.CommonMetadata.State|null} [state] CommonMetadata state + */ - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; + /** + * Constructs a new CommonMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a CommonMetadata. + * @implements ICommonMetadata + * @constructor + * @param {google.datastore.admin.v1.ICommonMetadata=} [properties] Properties to set + */ + function CommonMetadata(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]]; + } - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + /** + * CommonMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.startTime = null; - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * CommonMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.endTime = null; - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; + /** + * CommonMetadata operationType. + * @member {google.datastore.admin.v1.OperationType} operationType + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.operationType = 0; - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + /** + * CommonMetadata labels. + * @member {Object.} labels + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.labels = $util.emptyObject; + + /** + * CommonMetadata state. + * @member {google.datastore.admin.v1.CommonMetadata.State} state + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.state = 0; + + /** + * Creates a new CommonMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {google.datastore.admin.v1.ICommonMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata instance + */ + CommonMetadata.create = function create(properties) { + return new CommonMetadata(properties); + }; + + /** + * Encodes the specified CommonMetadata message. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {google.datastore.admin.v1.ICommonMetadata} message CommonMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonMetadata.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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operationType); + 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(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + return writer; + }; + + /** + * Encodes the specified CommonMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {google.datastore.admin.v1.ICommonMetadata} message CommonMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; + /** + * Decodes a CommonMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.CommonMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.operationType = reader.int32(); + 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; + case 5: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a CommonMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; - }; + /** + * Verifies a CommonMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonMetadata.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.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + 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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; + + /** + * Creates a CommonMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata + */ + CommonMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.CommonMetadata) + return object; + var message = new $root.google.datastore.admin.v1.CommonMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.datastore.admin.v1.CommonMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.datastore.admin.v1.CommonMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.operationType) { + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operationType = 0; + break; + case "EXPORT_ENTITIES": + case 1: + message.operationType = 1; + break; + case "IMPORT_ENTITIES": + case 2: + message.operationType = 2; + break; + case "CREATE_INDEX": + case 3: + message.operationType = 3; + break; + case "DELETE_INDEX": + case 4: + message.operationType = 4; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.datastore.admin.v1.CommonMetadata.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.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "INITIALIZING": + case 1: + message.state = 1; + break; + case "PROCESSING": + case 2: + message.state = 2; + break; + case "CANCELLING": + case 3: + message.state = 3; + break; + case "FINALIZING": + case 4: + message.state = 4; + break; + case "SUCCESSFUL": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 7; + break; + } + return message; + }; - /** - * 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(); - }; + /** + * Creates a plain object from a CommonMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {google.datastore.admin.v1.CommonMetadata} message CommonMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.operationType = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = options.enums === String ? $root.google.datastore.admin.v1.OperationType[message.operationType] : message.operationType; + 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.datastore.admin.v1.CommonMetadata.State[message.state] : message.state; + return object; + }; - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifierValue = reader.string(); - break; - case 4: - message.positiveIntValue = reader.uint64(); - break; - case 5: - message.negativeIntValue = reader.int64(); - break; - case 6: - message.doubleValue = reader.double(); - break; - case 7: - message.stringValue = reader.bytes(); - break; - case 8: - message.aggregateValue = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this CommonMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + * @returns {Object.} JSON object + */ + CommonMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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()); - }; + /** + * State enum. + * @name google.datastore.admin.v1.CommonMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} INITIALIZING=1 INITIALIZING value + * @property {number} PROCESSING=2 PROCESSING value + * @property {number} CANCELLING=3 CANCELLING value + * @property {number} FINALIZING=4 FINALIZING value + * @property {number} SUCCESSFUL=5 SUCCESSFUL value + * @property {number} FAILED=6 FAILED value + * @property {number} CANCELLED=7 CANCELLED value + */ + CommonMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INITIALIZING"] = 1; + values[valuesById[2] = "PROCESSING"] = 2; + values[valuesById[3] = "CANCELLING"] = 3; + values[valuesById[4] = "FINALIZING"] = 4; + values[valuesById[5] = "SUCCESSFUL"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "CANCELLED"] = 7; + return values; + })(); - /** - * 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; - }; + return CommonMetadata; + })(); - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; + v1.Progress = (function() { + + /** + * Properties of a Progress. + * @memberof google.datastore.admin.v1 + * @interface IProgress + * @property {number|Long|null} [workCompleted] Progress workCompleted + * @property {number|Long|null} [workEstimated] Progress workEstimated + */ - /** - * 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); + /** + * Constructs a new Progress. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a Progress. + * @implements IProgress + * @constructor + * @param {google.datastore.admin.v1.IProgress=} [properties] Properties to set + */ + function Progress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - 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); - }; + /** + * Progress workCompleted. + * @member {number|Long} workCompleted + * @memberof google.datastore.admin.v1.Progress + * @instance + */ + Progress.prototype.workCompleted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - UninterpretedOption.NamePart = (function() { + /** + * Progress workEstimated. + * @member {number|Long} workEstimated + * @memberof google.datastore.admin.v1.Progress + * @instance + */ + Progress.prototype.workEstimated = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ + /** + * Creates a new Progress instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {google.datastore.admin.v1.IProgress=} [properties] Properties to set + * @returns {google.datastore.admin.v1.Progress} Progress instance + */ + Progress.create = function create(properties) { + return new Progress(properties); + }; - /** - * 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]]; - } + /** + * Encodes the specified Progress message. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {google.datastore.admin.v1.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workCompleted != null && Object.hasOwnProperty.call(message, "workCompleted")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.workCompleted); + if (message.workEstimated != null && Object.hasOwnProperty.call(message, "workEstimated")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.workEstimated); + return writer; + }; + + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {google.datastore.admin.v1.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Progress message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Progress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workCompleted = reader.int64(); + break; + case 2: + message.workEstimated = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Progress message. + * @function verify + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Progress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workCompleted != null && message.hasOwnProperty("workCompleted")) + if (!$util.isInteger(message.workCompleted) && !(message.workCompleted && $util.isInteger(message.workCompleted.low) && $util.isInteger(message.workCompleted.high))) + return "workCompleted: integer|Long expected"; + if (message.workEstimated != null && message.hasOwnProperty("workEstimated")) + if (!$util.isInteger(message.workEstimated) && !(message.workEstimated && $util.isInteger(message.workEstimated.low) && $util.isInteger(message.workEstimated.high))) + return "workEstimated: integer|Long expected"; + return null; + }; + + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.Progress} Progress + */ + Progress.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.Progress) + return object; + var message = new $root.google.datastore.admin.v1.Progress(); + if (object.workCompleted != null) + if ($util.Long) + (message.workCompleted = $util.Long.fromValue(object.workCompleted)).unsigned = false; + else if (typeof object.workCompleted === "string") + message.workCompleted = parseInt(object.workCompleted, 10); + else if (typeof object.workCompleted === "number") + message.workCompleted = object.workCompleted; + else if (typeof object.workCompleted === "object") + message.workCompleted = new $util.LongBits(object.workCompleted.low >>> 0, object.workCompleted.high >>> 0).toNumber(); + if (object.workEstimated != null) + if ($util.Long) + (message.workEstimated = $util.Long.fromValue(object.workEstimated)).unsigned = false; + else if (typeof object.workEstimated === "string") + message.workEstimated = parseInt(object.workEstimated, 10); + else if (typeof object.workEstimated === "number") + message.workEstimated = object.workEstimated; + else if (typeof object.workEstimated === "object") + message.workEstimated = new $util.LongBits(object.workEstimated.low >>> 0, object.workEstimated.high >>> 0).toNumber(); + return message; + }; - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {google.datastore.admin.v1.Progress} message Progress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Progress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.workCompleted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.workCompleted = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.workEstimated = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.workEstimated = options.longs === String ? "0" : 0; + } + if (message.workCompleted != null && message.hasOwnProperty("workCompleted")) + if (typeof message.workCompleted === "number") + object.workCompleted = options.longs === String ? String(message.workCompleted) : message.workCompleted; + else + object.workCompleted = options.longs === String ? $util.Long.prototype.toString.call(message.workCompleted) : options.longs === Number ? new $util.LongBits(message.workCompleted.low >>> 0, message.workCompleted.high >>> 0).toNumber() : message.workCompleted; + if (message.workEstimated != null && message.hasOwnProperty("workEstimated")) + if (typeof message.workEstimated === "number") + object.workEstimated = options.longs === String ? String(message.workEstimated) : message.workEstimated; + else + object.workEstimated = options.longs === String ? $util.Long.prototype.toString.call(message.workEstimated) : options.longs === Number ? new $util.LongBits(message.workEstimated.low >>> 0, message.workEstimated.high >>> 0).toNumber() : message.workEstimated; + return object; + }; - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; + /** + * Converts this Progress to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.Progress + * @instance + * @returns {Object.} JSON object + */ + Progress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return Progress; + })(); - /** - * 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; - }; + v1.ExportEntitiesRequest = (function() { - /** - * 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(); - }; + /** + * Properties of an ExportEntitiesRequest. + * @memberof google.datastore.admin.v1 + * @interface IExportEntitiesRequest + * @property {string|null} [projectId] ExportEntitiesRequest projectId + * @property {Object.|null} [labels] ExportEntitiesRequest labels + * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ExportEntitiesRequest entityFilter + * @property {string|null} [outputUrlPrefix] ExportEntitiesRequest outputUrlPrefix + */ - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.namePart = reader.string(); - break; - case 2: - message.isExtension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new ExportEntitiesRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ExportEntitiesRequest. + * @implements IExportEntitiesRequest + * @constructor + * @param {google.datastore.admin.v1.IExportEntitiesRequest=} [properties] Properties to set + */ + function ExportEntitiesRequest(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]]; } - 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()); - }; + /** + * ExportEntitiesRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + */ + ExportEntitiesRequest.prototype.projectId = ""; - /** - * 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; - }; + /** + * ExportEntitiesRequest labels. + * @member {Object.} labels + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + */ + ExportEntitiesRequest.prototype.labels = $util.emptyObject; - /** - * 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; - }; + /** + * ExportEntitiesRequest entityFilter. + * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + */ + ExportEntitiesRequest.prototype.entityFilter = null; + + /** + * ExportEntitiesRequest outputUrlPrefix. + * @member {string} outputUrlPrefix + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + */ + ExportEntitiesRequest.prototype.outputUrlPrefix = ""; + + /** + * Creates a new ExportEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IExportEntitiesRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest instance + */ + ExportEntitiesRequest.create = function create(properties) { + return new ExportEntitiesRequest(properties); + }; - /** - * 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; - }; + /** + * Encodes the specified ExportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IExportEntitiesRequest} message ExportEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesRequest.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.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.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) + $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputUrlPrefix != null && Object.hasOwnProperty.call(message, "outputUrlPrefix")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputUrlPrefix); + return writer; + }; - /** - * 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); - }; + /** + * Encodes the specified ExportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IExportEntitiesRequest} message ExportEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return NamePart; - })(); + /** + * Decodes an ExportEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = 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.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); + break; + case 4: + message.outputUrlPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return UninterpretedOption; - })(); + /** + * Decodes an ExportEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - protobuf.SourceCodeInfo = (function() { + /** + * Verifies an ExportEntitiesRequest message. + * @function verify + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntitiesRequest.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.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.entityFilter != null && message.hasOwnProperty("entityFilter")) { + var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); + if (error) + return "entityFilter." + error; + } + if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) + if (!$util.isString(message.outputUrlPrefix)) + return "outputUrlPrefix: string expected"; + return null; + }; - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ + /** + * Creates an ExportEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest + */ + ExportEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesRequest) + return object; + var message = new $root.google.datastore.admin.v1.ExportEntitiesRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesRequest.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.entityFilter != null) { + if (typeof object.entityFilter !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesRequest.entityFilter: object expected"); + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); + } + if (object.outputUrlPrefix != null) + message.outputUrlPrefix = String(object.outputUrlPrefix); + return message; + }; - /** - * 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]]; - } + /** + * Creates a plain object from an ExportEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.ExportEntitiesRequest} message ExportEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.projectId = ""; + object.entityFilter = null; + object.outputUrlPrefix = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + 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.entityFilter != null && message.hasOwnProperty("entityFilter")) + object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); + if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) + object.outputUrlPrefix = message.outputUrlPrefix; + return object; + }; - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; + /** + * Converts this ExportEntitiesRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + ExportEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return ExportEntitiesRequest; + })(); - /** - * 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; - }; + v1.ImportEntitiesRequest = (function() { - /** - * 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(); - }; + /** + * Properties of an ImportEntitiesRequest. + * @memberof google.datastore.admin.v1 + * @interface IImportEntitiesRequest + * @property {string|null} [projectId] ImportEntitiesRequest projectId + * @property {Object.|null} [labels] ImportEntitiesRequest labels + * @property {string|null} [inputUrl] ImportEntitiesRequest inputUrl + * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ImportEntitiesRequest entityFilter + */ - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Constructs a new ImportEntitiesRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ImportEntitiesRequest. + * @implements IImportEntitiesRequest + * @constructor + * @param {google.datastore.admin.v1.IImportEntitiesRequest=} [properties] Properties to set + */ + function ImportEntitiesRequest(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]]; } - } - 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()); - }; + /** + * ImportEntitiesRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + */ + ImportEntitiesRequest.prototype.projectId = ""; - /** - * 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; - }; + /** + * ImportEntitiesRequest labels. + * @member {Object.} labels + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + */ + ImportEntitiesRequest.prototype.labels = $util.emptyObject; - /** - * 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; - }; + /** + * ImportEntitiesRequest inputUrl. + * @member {string} inputUrl + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + */ + ImportEntitiesRequest.prototype.inputUrl = ""; - /** - * 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; - }; + /** + * ImportEntitiesRequest entityFilter. + * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + */ + ImportEntitiesRequest.prototype.entityFilter = null; + + /** + * Creates a new ImportEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IImportEntitiesRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest instance + */ + ImportEntitiesRequest.create = function create(properties) { + return new ImportEntitiesRequest(properties); + }; + + /** + * Encodes the specified ImportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IImportEntitiesRequest} message ImportEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntitiesRequest.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.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.inputUrl != null && Object.hasOwnProperty.call(message, "inputUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.inputUrl); + if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) + $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * 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); - }; + /** + * Encodes the specified ImportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IImportEntitiesRequest} message ImportEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - SourceCodeInfo.Location = (function() { + /** + * Decodes an ImportEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ImportEntitiesRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = 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.inputUrl = reader.string(); + break; + case 4: + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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 - */ + /** + * Decodes an ImportEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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]]; - } + /** + * Verifies an ImportEntitiesRequest message. + * @function verify + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntitiesRequest.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.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.inputUrl != null && message.hasOwnProperty("inputUrl")) + if (!$util.isString(message.inputUrl)) + return "inputUrl: string expected"; + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { + var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); + if (error) + return "entityFilter." + error; + } + return null; + }; - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; + /** + * Creates an ImportEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest + */ + ImportEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesRequest) + return object; + var message = new $root.google.datastore.admin.v1.ImportEntitiesRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesRequest.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.inputUrl != null) + message.inputUrl = String(object.inputUrl); + if (object.entityFilter != null) { + if (typeof object.entityFilter !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesRequest.entityFilter: object expected"); + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); + } + return message; + }; - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; + /** + * Creates a plain object from an ImportEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.ImportEntitiesRequest} message ImportEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.projectId = ""; + object.inputUrl = ""; + object.entityFilter = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + 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.inputUrl != null && message.hasOwnProperty("inputUrl")) + object.inputUrl = message.inputUrl; + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) + object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); + return object; + }; - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; + /** + * Converts this ImportEntitiesRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + ImportEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; + return ImportEntitiesRequest; + })(); - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; + v1.ExportEntitiesResponse = (function() { - /** - * 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); - }; + /** + * Properties of an ExportEntitiesResponse. + * @memberof google.datastore.admin.v1 + * @interface IExportEntitiesResponse + * @property {string|null} [outputUrl] ExportEntitiesResponse outputUrl + */ - /** - * 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(); + /** + * Constructs a new ExportEntitiesResponse. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ExportEntitiesResponse. + * @implements IExportEntitiesResponse + * @constructor + * @param {google.datastore.admin.v1.IExportEntitiesResponse=} [properties] Properties to set + */ + function ExportEntitiesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (message.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(); - }; + /** + * ExportEntitiesResponse outputUrl. + * @member {string} outputUrl + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @instance + */ + ExportEntitiesResponse.prototype.outputUrl = ""; - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leadingComments = reader.string(); - break; - case 4: - message.trailingComments = reader.string(); - break; - case 6: - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a new ExportEntitiesResponse instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {google.datastore.admin.v1.IExportEntitiesResponse=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse instance + */ + ExportEntitiesResponse.create = function create(properties) { + return new ExportEntitiesResponse(properties); + }; + + /** + * Encodes the specified ExportEntitiesResponse message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {google.datastore.admin.v1.IExportEntitiesResponse} message ExportEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUrl != null && Object.hasOwnProperty.call(message, "outputUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUrl); + return writer; + }; + + /** + * Encodes the specified ExportEntitiesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {google.datastore.admin.v1.IExportEntitiesResponse} message ExportEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEntitiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes an ExportEntitiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesResponse.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; - }; + /** + * Verifies an ExportEntitiesResponse message. + * @function verify + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntitiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUrl != null && message.hasOwnProperty("outputUrl")) + if (!$util.isString(message.outputUrl)) + return "outputUrl: 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) + /** + * Creates an ExportEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse + */ + ExportEntitiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesResponse) + return object; + var message = new $root.google.datastore.admin.v1.ExportEntitiesResponse(); + if (object.outputUrl != null) + message.outputUrl = String(object.outputUrl); + return message; + }; + + /** + * Creates a plain object from an ExportEntitiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {google.datastore.admin.v1.ExportEntitiesResponse} message ExportEntitiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntitiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUrl = ""; + if (message.outputUrl != null && message.hasOwnProperty("outputUrl")) + object.outputUrl = message.outputUrl; 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 ExportEntitiesResponse to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @instance + * @returns {Object.} JSON object + */ + ExportEntitiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return ExportEntitiesResponse; + })(); - return Location; - })(); + v1.ExportEntitiesMetadata = (function() { - return SourceCodeInfo; - })(); + /** + * Properties of an ExportEntitiesMetadata. + * @memberof google.datastore.admin.v1 + * @interface IExportEntitiesMetadata + * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] ExportEntitiesMetadata common + * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] ExportEntitiesMetadata progressEntities + * @property {google.datastore.admin.v1.IProgress|null} [progressBytes] ExportEntitiesMetadata progressBytes + * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ExportEntitiesMetadata entityFilter + * @property {string|null} [outputUrlPrefix] ExportEntitiesMetadata outputUrlPrefix + */ - protobuf.GeneratedCodeInfo = (function() { + /** + * Constructs a new ExportEntitiesMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ExportEntitiesMetadata. + * @implements IExportEntitiesMetadata + * @constructor + * @param {google.datastore.admin.v1.IExportEntitiesMetadata=} [properties] Properties to set + */ + function ExportEntitiesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ + /** + * ExportEntitiesMetadata common. + * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.common = null; + + /** + * ExportEntitiesMetadata progressEntities. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.progressEntities = null; + + /** + * ExportEntitiesMetadata progressBytes. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressBytes + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.progressBytes = null; - /** - * 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]]; - } + /** + * ExportEntitiesMetadata entityFilter. + * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.entityFilter = null; - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + /** + * ExportEntitiesMetadata outputUrlPrefix. + * @member {string} outputUrlPrefix + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.outputUrlPrefix = ""; - /** - * 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); - }; + /** + * Creates a new ExportEntitiesMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IExportEntitiesMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata instance + */ + ExportEntitiesMetadata.create = function create(properties) { + return new ExportEntitiesMetadata(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 ExportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IExportEntitiesMetadata} message ExportEntitiesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) + $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.progressBytes != null && Object.hasOwnProperty.call(message, "progressBytes")) + $root.google.datastore.admin.v1.Progress.encode(message.progressBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) + $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputUrlPrefix != null && Object.hasOwnProperty.call(message, "outputUrlPrefix")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.outputUrlPrefix); + 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(); - }; + /** + * Encodes the specified ExportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IExportEntitiesMetadata} message ExportEntitiesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an ExportEntitiesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 3: + message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 4: + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); + break; + case 5: + message.outputUrlPrefix = reader.string(); + 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()); - }; + /** + * Decodes an ExportEntitiesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEntitiesMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntitiesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); + if (error) + return "common." + error; + } + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); + if (error) + return "progressEntities." + error; + } + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes); + if (error) + return "progressBytes." + error; + } + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { + var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); + if (error) + return "entityFilter." + error; + } + if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) + if (!$util.isString(message.outputUrlPrefix)) + return "outputUrlPrefix: string expected"; + return null; + }; - /** - * 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 an ExportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata + */ + ExportEntitiesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesMetadata) + return object; + var message = new $root.google.datastore.admin.v1.ExportEntitiesMetadata(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.common: object expected"); + message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); + } + if (object.progressEntities != null) { + if (typeof object.progressEntities !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.progressEntities: object expected"); + message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); + } + if (object.progressBytes != null) { + if (typeof object.progressBytes !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.progressBytes: object expected"); + message.progressBytes = $root.google.datastore.admin.v1.Progress.fromObject(object.progressBytes); + } + if (object.entityFilter != null) { + if (typeof object.entityFilter !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.entityFilter: object expected"); + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); + } + if (object.outputUrlPrefix != null) + message.outputUrlPrefix = String(object.outputUrlPrefix); + return message; + }; - /** - * 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 an ExportEntitiesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.ExportEntitiesMetadata} message ExportEntitiesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntitiesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.progressEntities = null; + object.progressBytes = null; + object.entityFilter = null; + object.outputUrlPrefix = ""; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) + object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) + object.progressBytes = $root.google.datastore.admin.v1.Progress.toObject(message.progressBytes, options); + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) + object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); + if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) + object.outputUrlPrefix = message.outputUrlPrefix; + return object; + }; - /** - * 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 ExportEntitiesMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportEntitiesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return ExportEntitiesMetadata; + })(); - GeneratedCodeInfo.Annotation = (function() { + v1.ImportEntitiesMetadata = (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 - */ + /** + * Properties of an ImportEntitiesMetadata. + * @memberof google.datastore.admin.v1 + * @interface IImportEntitiesMetadata + * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] ImportEntitiesMetadata common + * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] ImportEntitiesMetadata progressEntities + * @property {google.datastore.admin.v1.IProgress|null} [progressBytes] ImportEntitiesMetadata progressBytes + * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ImportEntitiesMetadata entityFilter + * @property {string|null} [inputUrl] ImportEntitiesMetadata inputUrl + */ - /** - * 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]]; - } + /** + * Constructs a new ImportEntitiesMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ImportEntitiesMetadata. + * @implements IImportEntitiesMetadata + * @constructor + * @param {google.datastore.admin.v1.IImportEntitiesMetadata=} [properties] Properties to set + */ + function ImportEntitiesMetadata(properties) { + if (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; + /** + * ImportEntitiesMetadata common. + * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.common = null; - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; + /** + * ImportEntitiesMetadata progressEntities. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.progressEntities = null; - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; + /** + * ImportEntitiesMetadata progressBytes. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressBytes + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.progressBytes = null; - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; + /** + * ImportEntitiesMetadata entityFilter. + * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.entityFilter = null; - /** - * 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); - }; + /** + * ImportEntitiesMetadata inputUrl. + * @member {string} inputUrl + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.inputUrl = ""; - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - return writer; - }; + /** + * Creates a new ImportEntitiesMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IImportEntitiesMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata instance + */ + ImportEntitiesMetadata.create = function create(properties) { + return new ImportEntitiesMetadata(properties); + }; - /** - * 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(); - }; + /** + * Encodes the specified ImportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IImportEntitiesMetadata} message ImportEntitiesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntitiesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) + $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.progressBytes != null && Object.hasOwnProperty.call(message, "progressBytes")) + $root.google.datastore.admin.v1.Progress.encode(message.progressBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) + $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputUrl != null && Object.hasOwnProperty.call(message, "inputUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.inputUrl); + return writer; + }; - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified ImportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IImportEntitiesMetadata} message ImportEntitiesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntitiesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportEntitiesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntitiesMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ImportEntitiesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 3: + message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 4: + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); + break; + case 5: + message.inputUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + 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()); - }; + /** + * Decodes an ImportEntitiesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntitiesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportEntitiesMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntitiesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); + if (error) + return "common." + error; + } + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); + if (error) + return "progressEntities." + error; + } + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes); + if (error) + return "progressBytes." + error; + } + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { + var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); + if (error) + return "entityFilter." + error; + } + if (message.inputUrl != null && message.hasOwnProperty("inputUrl")) + if (!$util.isString(message.inputUrl)) + return "inputUrl: string expected"; + return null; + }; - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; + /** + * Creates an ImportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata + */ + ImportEntitiesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesMetadata) + return object; + var message = new $root.google.datastore.admin.v1.ImportEntitiesMetadata(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.common: object expected"); + message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); + } + if (object.progressEntities != null) { + if (typeof object.progressEntities !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.progressEntities: object expected"); + message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); + } + if (object.progressBytes != null) { + if (typeof object.progressBytes !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.progressBytes: object expected"); + message.progressBytes = $root.google.datastore.admin.v1.Progress.fromObject(object.progressBytes); + } + if (object.entityFilter != null) { + if (typeof object.entityFilter !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.entityFilter: object expected"); + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); + } + if (object.inputUrl != null) + message.inputUrl = String(object.inputUrl); + return message; + }; - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + /** + * Creates a plain object from an ImportEntitiesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.ImportEntitiesMetadata} message ImportEntitiesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntitiesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.progressEntities = null; + object.progressBytes = null; + object.entityFilter = null; + object.inputUrl = ""; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) + object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) + object.progressBytes = $root.google.datastore.admin.v1.Progress.toObject(message.progressBytes, options); + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) + object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); + if (message.inputUrl != null && message.hasOwnProperty("inputUrl")) + object.inputUrl = message.inputUrl; return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; + }; - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; + /** + * Converts this ImportEntitiesMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportEntitiesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return ImportEntitiesMetadata; + })(); - return Annotation; - })(); + v1.EntityFilter = (function() { - return GeneratedCodeInfo; - })(); + /** + * Properties of an EntityFilter. + * @memberof google.datastore.admin.v1 + * @interface IEntityFilter + * @property {Array.|null} [kinds] EntityFilter kinds + * @property {Array.|null} [namespaceIds] EntityFilter namespaceIds + */ - protobuf.Any = (function() { + /** + * Constructs a new EntityFilter. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an EntityFilter. + * @implements IEntityFilter + * @constructor + * @param {google.datastore.admin.v1.IEntityFilter=} [properties] Properties to set + */ + function EntityFilter(properties) { + this.kinds = []; + this.namespaceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ + /** + * EntityFilter kinds. + * @member {Array.} kinds + * @memberof google.datastore.admin.v1.EntityFilter + * @instance + */ + EntityFilter.prototype.kinds = $util.emptyArray; - /** - * 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]]; - } + /** + * EntityFilter namespaceIds. + * @member {Array.} namespaceIds + * @memberof google.datastore.admin.v1.EntityFilter + * @instance + */ + EntityFilter.prototype.namespaceIds = $util.emptyArray; + + /** + * Creates a new EntityFilter instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {google.datastore.admin.v1.IEntityFilter=} [properties] Properties to set + * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter instance + */ + EntityFilter.create = function create(properties) { + return new EntityFilter(properties); + }; - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; + /** + * Encodes the specified EntityFilter message. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {google.datastore.admin.v1.IEntityFilter} message EntityFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kinds != null && message.kinds.length) + for (var i = 0; i < message.kinds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kinds[i]); + if (message.namespaceIds != null && message.namespaceIds.length) + for (var i = 0; i < message.namespaceIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.namespaceIds[i]); + return writer; + }; - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); + /** + * Encodes the specified EntityFilter message, length delimited. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {google.datastore.admin.v1.IEntityFilter} message EntityFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes an EntityFilter message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.EntityFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.kinds && message.kinds.length)) + message.kinds = []; + message.kinds.push(reader.string()); + break; + case 2: + if (!(message.namespaceIds && message.namespaceIds.length)) + message.namespaceIds = []; + message.namespaceIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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; - }; + /** + * Decodes an EntityFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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(); - }; + /** + * Verifies an EntityFilter message. + * @function verify + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kinds != null && message.hasOwnProperty("kinds")) { + if (!Array.isArray(message.kinds)) + return "kinds: array expected"; + for (var i = 0; i < message.kinds.length; ++i) + if (!$util.isString(message.kinds[i])) + return "kinds: string[] expected"; + } + if (message.namespaceIds != null && message.hasOwnProperty("namespaceIds")) { + if (!Array.isArray(message.namespaceIds)) + return "namespaceIds: array expected"; + for (var i = 0; i < message.namespaceIds.length; ++i) + if (!$util.isString(message.namespaceIds[i])) + return "namespaceIds: string[] expected"; + } + return null; + }; - /** - * 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) { - 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(); - 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; - }; + /** + * Creates an EntityFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter + */ + EntityFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.EntityFilter) + return object; + var message = new $root.google.datastore.admin.v1.EntityFilter(); + if (object.kinds) { + if (!Array.isArray(object.kinds)) + throw TypeError(".google.datastore.admin.v1.EntityFilter.kinds: array expected"); + message.kinds = []; + for (var i = 0; i < object.kinds.length; ++i) + message.kinds[i] = String(object.kinds[i]); + } + if (object.namespaceIds) { + if (!Array.isArray(object.namespaceIds)) + throw TypeError(".google.datastore.admin.v1.EntityFilter.namespaceIds: array expected"); + message.namespaceIds = []; + for (var i = 0; i < object.namespaceIds.length; ++i) + message.namespaceIds[i] = String(object.namespaceIds[i]); + } + return message; + }; + + /** + * Creates a plain object from an EntityFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {google.datastore.admin.v1.EntityFilter} message EntityFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.kinds = []; + object.namespaceIds = []; + } + if (message.kinds && message.kinds.length) { + object.kinds = []; + for (var j = 0; j < message.kinds.length; ++j) + object.kinds[j] = message.kinds[j]; + } + if (message.namespaceIds && message.namespaceIds.length) { + object.namespaceIds = []; + for (var j = 0; j < message.namespaceIds.length; ++j) + object.namespaceIds[j] = message.namespaceIds[j]; + } + return object; + }; - /** - * 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()); - }; + /** + * Converts this EntityFilter to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.EntityFilter + * @instance + * @returns {Object.} JSON object + */ + EntityFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return EntityFilter; + })(); - /** - * 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) - message.value = object.value; - return message; - }; + v1.CreateIndexRequest = (function() { - /** - * 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; - }; + /** + * Properties of a CreateIndexRequest. + * @memberof google.datastore.admin.v1 + * @interface ICreateIndexRequest + * @property {string|null} [projectId] CreateIndexRequest projectId + * @property {google.datastore.admin.v1.IIndex|null} [index] CreateIndexRequest index + */ - /** - * 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); - }; + /** + * Constructs a new CreateIndexRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a CreateIndexRequest. + * @implements ICreateIndexRequest + * @constructor + * @param {google.datastore.admin.v1.ICreateIndexRequest=} [properties] Properties to set + */ + function CreateIndexRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return Any; - })(); + /** + * CreateIndexRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @instance + */ + CreateIndexRequest.prototype.projectId = ""; - protobuf.Duration = (function() { + /** + * CreateIndexRequest index. + * @member {google.datastore.admin.v1.IIndex|null|undefined} index + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @instance + */ + CreateIndexRequest.prototype.index = null; - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ + /** + * Creates a new CreateIndexRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {google.datastore.admin.v1.ICreateIndexRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest instance + */ + CreateIndexRequest.create = function create(properties) { + return new CreateIndexRequest(properties); + }; - /** - * 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]]; - } + /** + * Encodes the specified CreateIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {google.datastore.admin.v1.ICreateIndexRequest} message CreateIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIndexRequest.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.index != null && Object.hasOwnProperty.call(message, "index")) + $root.google.datastore.admin.v1.Index.encode(message.index, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Encodes the specified CreateIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {google.datastore.admin.v1.ICreateIndexRequest} message CreateIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; + /** + * Decodes a CreateIndexRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIndexRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.CreateIndexRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 3: + message.index = $root.google.datastore.admin.v1.Index.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a CreateIndexRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIndexRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; - }; + /** + * Verifies a CreateIndexRequest message. + * @function verify + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateIndexRequest.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.index != null && message.hasOwnProperty("index")) { + var error = $root.google.datastore.admin.v1.Index.verify(message.index); + if (error) + return "index." + error; + } + return null; + }; - /** - * 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(); - }; + /** + * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest + */ + CreateIndexRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.CreateIndexRequest) + return object; + var message = new $root.google.datastore.admin.v1.CreateIndexRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.index != null) { + if (typeof object.index !== "object") + throw TypeError(".google.datastore.admin.v1.CreateIndexRequest.index: object expected"); + message.index = $root.google.datastore.admin.v1.Index.fromObject(object.index); + } + return message; + }; - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {google.datastore.admin.v1.CreateIndexRequest} message CreateIndexRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateIndexRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.index = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.index != null && message.hasOwnProperty("index")) + object.index = $root.google.datastore.admin.v1.Index.toObject(message.index, options); + return object; + }; - /** - * 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()); - }; + /** + * Converts this CreateIndexRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @instance + * @returns {Object.} JSON object + */ + CreateIndexRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return CreateIndexRequest; + })(); - /** - * 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; - }; + v1.DeleteIndexRequest = (function() { - /** - * 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; - }; + /** + * Properties of a DeleteIndexRequest. + * @memberof google.datastore.admin.v1 + * @interface IDeleteIndexRequest + * @property {string|null} [projectId] DeleteIndexRequest projectId + * @property {string|null} [indexId] DeleteIndexRequest indexId + */ - /** - * 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); - }; + /** + * Constructs a new DeleteIndexRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a DeleteIndexRequest. + * @implements IDeleteIndexRequest + * @constructor + * @param {google.datastore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set + */ + function DeleteIndexRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return Duration; - })(); + /** + * DeleteIndexRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @instance + */ + DeleteIndexRequest.prototype.projectId = ""; - protobuf.Empty = (function() { + /** + * DeleteIndexRequest indexId. + * @member {string} indexId + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @instance + */ + DeleteIndexRequest.prototype.indexId = ""; - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ + /** + * Creates a new DeleteIndexRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {google.datastore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest instance + */ + DeleteIndexRequest.create = function create(properties) { + return new DeleteIndexRequest(properties); + }; - /** - * 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]]; - } + /** + * Encodes the specified DeleteIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {google.datastore.admin.v1.IDeleteIndexRequest} message DeleteIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIndexRequest.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); + return writer; + }; - /** - * 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 DeleteIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {google.datastore.admin.v1.IDeleteIndexRequest} message DeleteIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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; - }; + /** + * Decodes a DeleteIndexRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIndexRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.DeleteIndexRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 3: + message.indexId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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 a DeleteIndexRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIndexRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a DeleteIndexRequest message. + * @function verify + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteIndexRequest.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.indexId != null && message.hasOwnProperty("indexId")) + if (!$util.isString(message.indexId)) + return "indexId: string expected"; + return null; + }; - /** - * 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()); - }; + /** + * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest + */ + DeleteIndexRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.DeleteIndexRequest) + return object; + var message = new $root.google.datastore.admin.v1.DeleteIndexRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.indexId != null) + message.indexId = String(object.indexId); + return message; + }; - /** - * 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 a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {google.datastore.admin.v1.DeleteIndexRequest} message DeleteIndexRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteIndexRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.indexId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.indexId != null && message.hasOwnProperty("indexId")) + object.indexId = message.indexId; + return object; + }; - /** - * 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(); - }; + /** + * Converts this DeleteIndexRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteIndexRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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 {}; - }; + return DeleteIndexRequest; + })(); - /** - * 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); - }; + v1.GetIndexRequest = (function() { - return Empty; - })(); + /** + * Properties of a GetIndexRequest. + * @memberof google.datastore.admin.v1 + * @interface IGetIndexRequest + * @property {string|null} [projectId] GetIndexRequest projectId + * @property {string|null} [indexId] GetIndexRequest indexId + */ - protobuf.Timestamp = (function() { + /** + * Constructs a new GetIndexRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a GetIndexRequest. + * @implements IGetIndexRequest + * @constructor + * @param {google.datastore.admin.v1.IGetIndexRequest=} [properties] Properties to set + */ + function GetIndexRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ + /** + * GetIndexRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.GetIndexRequest + * @instance + */ + GetIndexRequest.prototype.projectId = ""; - /** - * 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]]; - } + /** + * GetIndexRequest indexId. + * @member {string} indexId + * @memberof google.datastore.admin.v1.GetIndexRequest + * @instance + */ + GetIndexRequest.prototype.indexId = ""; - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Creates a new GetIndexRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {google.datastore.admin.v1.IGetIndexRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest instance + */ + GetIndexRequest.create = function create(properties) { + return new GetIndexRequest(properties); + }; - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; + /** + * Encodes the specified GetIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {google.datastore.admin.v1.IGetIndexRequest} message GetIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIndexRequest.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); + return writer; + }; - /** - * 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 GetIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {google.datastore.admin.v1.IGetIndexRequest} message GetIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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; - }; + /** + * Decodes a GetIndexRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIndexRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.GetIndexRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 3: + message.indexId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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 GetIndexRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIndexRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a GetIndexRequest message. + * @function verify + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIndexRequest.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.indexId != null && message.hasOwnProperty("indexId")) + if (!$util.isString(message.indexId)) + return "indexId: string expected"; + return null; + }; - /** - * 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()); - }; + /** + * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest + */ + GetIndexRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.GetIndexRequest) + return object; + var message = new $root.google.datastore.admin.v1.GetIndexRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.indexId != null) + message.indexId = String(object.indexId); + return message; + }; - /** - * 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 plain object from a GetIndexRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {google.datastore.admin.v1.GetIndexRequest} message GetIndexRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIndexRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.indexId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.indexId != null && message.hasOwnProperty("indexId")) + object.indexId = message.indexId; + return object; + }; - /** - * 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; - }; + /** + * Converts this GetIndexRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.GetIndexRequest + * @instance + * @returns {Object.} JSON object + */ + GetIndexRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return GetIndexRequest; + })(); - /** - * 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); - }; + v1.ListIndexesRequest = (function() { - return Timestamp; - })(); + /** + * Properties of a ListIndexesRequest. + * @memberof google.datastore.admin.v1 + * @interface IListIndexesRequest + * @property {string|null} [projectId] ListIndexesRequest projectId + * @property {string|null} [filter] ListIndexesRequest filter + * @property {number|null} [pageSize] ListIndexesRequest pageSize + * @property {string|null} [pageToken] ListIndexesRequest pageToken + */ + + /** + * Constructs a new ListIndexesRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a ListIndexesRequest. + * @implements IListIndexesRequest + * @constructor + * @param {google.datastore.admin.v1.IListIndexesRequest=} [properties] Properties to set + */ + function ListIndexesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - protobuf.Struct = (function() { + /** + * ListIndexesRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.projectId = ""; - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ + /** + * ListIndexesRequest filter. + * @member {string} filter + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.filter = ""; - /** - * 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]]; - } + /** + * ListIndexesRequest pageSize. + * @member {number} pageSize + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.pageSize = 0; - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; + /** + * ListIndexesRequest pageToken. + * @member {string} pageToken + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.pageToken = ""; - /** - * 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); - }; + /** + * Creates a new ListIndexesRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {google.datastore.admin.v1.IListIndexesRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest instance + */ + ListIndexesRequest.create = function create(properties) { + return new ListIndexesRequest(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 ListIndexesRequest message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {google.datastore.admin.v1.IListIndexesRequest} message ListIndexesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIndexesRequest.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 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 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(); - }; + /** + * Encodes the specified ListIndexesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {google.datastore.admin.v1.IListIndexesRequest} message ListIndexesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIndexesRequest.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) { - 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(); - 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) { + /** + * Decodes a ListIndexesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIndexesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ListIndexesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - key = reader.string(); + message.projectId = reader.string(); break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + case 3: + message.filter = reader.string(); + break; + case 4: + message.pageSize = reader.int32(); + break; + case 5: + message.pageToken = reader.string(); break; default: - reader.skipType(tag2 & 7); + reader.skipType(tag & 7); break; } } - message.fields[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + 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()); - }; + /** + * Decodes a ListIndexesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIndexesRequest.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; - }; + /** + * Verifies a ListIndexesRequest message. + * @function verify + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIndexesRequest.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.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 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 ListIndexesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest + */ + ListIndexesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ListIndexesRequest) + return object; + var message = new $root.google.datastore.admin.v1.ListIndexesRequest(); + 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 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; - }; + /** + * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {google.datastore.admin.v1.ListIndexesRequest} message ListIndexesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIndexesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + 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 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); - }; + /** + * Converts this ListIndexesRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + * @returns {Object.} JSON object + */ + ListIndexesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Struct; - })(); + return ListIndexesRequest; + })(); - protobuf.Value = (function() { + v1.ListIndexesResponse = (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 - */ + /** + * Properties of a ListIndexesResponse. + * @memberof google.datastore.admin.v1 + * @interface IListIndexesResponse + * @property {Array.|null} [indexes] ListIndexesResponse indexes + * @property {string|null} [nextPageToken] ListIndexesResponse nextPageToken + */ - /** - * 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]]; - } + /** + * Constructs a new ListIndexesResponse. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a ListIndexesResponse. + * @implements IListIndexesResponse + * @constructor + * @param {google.datastore.admin.v1.IListIndexesResponse=} [properties] Properties to set + */ + function ListIndexesResponse(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]]; + } - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; + /** + * ListIndexesResponse indexes. + * @member {Array.} indexes + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @instance + */ + ListIndexesResponse.prototype.indexes = $util.emptyArray; - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; + /** + * ListIndexesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @instance + */ + ListIndexesResponse.prototype.nextPageToken = ""; - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; + /** + * Creates a new ListIndexesResponse instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {google.datastore.admin.v1.IListIndexesResponse=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse instance + */ + ListIndexesResponse.create = function create(properties) { + return new ListIndexesResponse(properties); + }; - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; + /** + * Encodes the specified ListIndexesResponse message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {google.datastore.admin.v1.IListIndexesResponse} message ListIndexesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIndexesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexes != null && message.indexes.length) + for (var i = 0; i < message.indexes.length; ++i) + $root.google.datastore.admin.v1.Index.encode(message.indexes[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; + }; - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; + /** + * Encodes the specified ListIndexesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {google.datastore.admin.v1.IListIndexesResponse} message ListIndexesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIndexesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; + /** + * Decodes a ListIndexesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIndexesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ListIndexesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.indexes && message.indexes.length)) + message.indexes = []; + message.indexes.push($root.google.datastore.admin.v1.Index.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Decodes a ListIndexesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIndexesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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) - }); + /** + * Verifies a ListIndexesResponse message. + * @function verify + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIndexesResponse.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) { + var error = $root.google.datastore.admin.v1.Index.verify(message.indexes[i]); + if (error) + return "indexes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * 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); - }; + /** + * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse + */ + ListIndexesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ListIndexesResponse) + return object; + var message = new $root.google.datastore.admin.v1.ListIndexesResponse(); + if (object.indexes) { + if (!Array.isArray(object.indexes)) + throw TypeError(".google.datastore.admin.v1.ListIndexesResponse.indexes: array expected"); + message.indexes = []; + for (var i = 0; i < object.indexes.length; ++i) { + if (typeof object.indexes[i] !== "object") + throw TypeError(".google.datastore.admin.v1.ListIndexesResponse.indexes: object expected"); + message.indexes[i] = $root.google.datastore.admin.v1.Index.fromObject(object.indexes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * 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; - }; + /** + * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {google.datastore.admin.v1.ListIndexesResponse} message ListIndexesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIndexesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.indexes && message.indexes.length) { + object.indexes = []; + for (var j = 0; j < message.indexes.length; ++j) + object.indexes[j] = $root.google.datastore.admin.v1.Index.toObject(message.indexes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * 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(); - }; + /** + * Converts this ListIndexesResponse to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @instance + * @returns {Object.} JSON object + */ + ListIndexesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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) { - 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(); - 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; - }; + return ListIndexesResponse; + })(); - /** - * 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()); - }; + v1.IndexOperationMetadata = (function() { - /** - * 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; + /** + * Properties of an IndexOperationMetadata. + * @memberof google.datastore.admin.v1 + * @interface IIndexOperationMetadata + * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] IndexOperationMetadata common + * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] IndexOperationMetadata progressEntities + * @property {string|null} [indexId] IndexOperationMetadata indexId + */ + + /** + * Constructs a new IndexOperationMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an IndexOperationMetadata. + * @implements IIndexOperationMetadata + * @constructor + * @param {google.datastore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set + */ + function IndexOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return null; - }; - /** - * Creates 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) { - 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; - }; + /** + * IndexOperationMetadata common. + * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.common = null; - /** - * 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] : 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; - }; + /** + * IndexOperationMetadata progressEntities. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.progressEntities = null; + + /** + * IndexOperationMetadata indexId. + * @member {string} indexId + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.indexId = ""; + + /** + * Creates a new IndexOperationMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {google.datastore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata instance + */ + IndexOperationMetadata.create = function create(properties) { + return new IndexOperationMetadata(properties); + }; - /** - * 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); - }; + /** + * Encodes the specified IndexOperationMetadata message. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {google.datastore.admin.v1.IIndexOperationMetadata} message IndexOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) + $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.indexId != null && Object.hasOwnProperty.call(message, "indexId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); + return writer; + }; - return Value; - })(); + /** + * Encodes the specified IndexOperationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {google.datastore.admin.v1.IIndexOperationMetadata} message IndexOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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; - })(); + /** + * Decodes an IndexOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.IndexOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 3: + message.indexId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - protobuf.ListValue = (function() { + /** + * Decodes an IndexOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ + /** + * Verifies an IndexOperationMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); + if (error) + return "common." + error; + } + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); + if (error) + return "progressEntities." + error; + } + if (message.indexId != null && message.hasOwnProperty("indexId")) + if (!$util.isString(message.indexId)) + return "indexId: string expected"; + return null; + }; - /** - * 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]]; - } + /** + * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata + */ + IndexOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.IndexOperationMetadata) + return object; + var message = new $root.google.datastore.admin.v1.IndexOperationMetadata(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.datastore.admin.v1.IndexOperationMetadata.common: object expected"); + message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); + } + if (object.progressEntities != null) { + if (typeof object.progressEntities !== "object") + throw TypeError(".google.datastore.admin.v1.IndexOperationMetadata.progressEntities: object expected"); + message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); + } + if (object.indexId != null) + message.indexId = String(object.indexId); + return message; + }; - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; + /** + * Creates a plain object from an IndexOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {google.datastore.admin.v1.IndexOperationMetadata} message IndexOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.progressEntities = null; + object.indexId = ""; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) + object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); + if (message.indexId != null && message.hasOwnProperty("indexId")) + object.indexId = message.indexId; + return object; + }; - /** - * 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); - }; + /** + * Converts this IndexOperationMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + IndexOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return IndexOperationMetadata; + })(); - /** - * 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(); - }; + v1.DatastoreFirestoreMigrationMetadata = (function() { - /** - * 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) { - 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(); - 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; + /** + * Properties of a DatastoreFirestoreMigrationMetadata. + * @memberof google.datastore.admin.v1 + * @interface IDatastoreFirestoreMigrationMetadata + * @property {google.datastore.admin.v1.MigrationState|null} [migrationState] DatastoreFirestoreMigrationMetadata migrationState + * @property {google.datastore.admin.v1.MigrationStep|null} [migrationStep] DatastoreFirestoreMigrationMetadata migrationStep + */ + + /** + * Constructs a new DatastoreFirestoreMigrationMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a DatastoreFirestoreMigrationMetadata. + * @implements IDatastoreFirestoreMigrationMetadata + * @constructor + * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata=} [properties] Properties to set + */ + function DatastoreFirestoreMigrationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Decodes a 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()); - }; + /** + * DatastoreFirestoreMigrationMetadata migrationState. + * @member {google.datastore.admin.v1.MigrationState} migrationState + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @instance + */ + DatastoreFirestoreMigrationMetadata.prototype.migrationState = 0; - /** - * 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; - }; + /** + * DatastoreFirestoreMigrationMetadata migrationStep. + * @member {google.datastore.admin.v1.MigrationStep} migrationStep + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @instance + */ + DatastoreFirestoreMigrationMetadata.prototype.migrationStep = 0; - /** - * 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 new DatastoreFirestoreMigrationMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata instance + */ + DatastoreFirestoreMigrationMetadata.create = function create(properties) { + return new DatastoreFirestoreMigrationMetadata(properties); + }; - /** - * 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; - }; + /** + * Encodes the specified DatastoreFirestoreMigrationMetadata message. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreFirestoreMigrationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migrationState != null && Object.hasOwnProperty.call(message, "migrationState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.migrationState); + if (message.migrationStep != null && Object.hasOwnProperty.call(message, "migrationStep")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.migrationStep); + return writer; + }; - /** - * 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); - }; + /** + * Encodes the specified DatastoreFirestoreMigrationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreFirestoreMigrationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return ListValue; - })(); + /** + * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreFirestoreMigrationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.migrationState = reader.int32(); + break; + case 2: + message.migrationStep = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreFirestoreMigrationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - protobuf.DoubleValue = (function() { + /** + * Verifies a DatastoreFirestoreMigrationMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatastoreFirestoreMigrationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.migrationState != null && message.hasOwnProperty("migrationState")) + switch (message.migrationState) { + default: + return "migrationState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) + switch (message.migrationStep) { + default: + return "migrationStep: enum value expected"; + case 0: + case 6: + case 1: + case 7: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ + /** + * Creates a DatastoreFirestoreMigrationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata + */ + DatastoreFirestoreMigrationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) + return object; + var message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); + switch (object.migrationState) { + case "MIGRATION_STATE_UNSPECIFIED": + case 0: + message.migrationState = 0; + break; + case "RUNNING": + case 1: + message.migrationState = 1; + break; + case "PAUSED": + case 2: + message.migrationState = 2; + break; + case "COMPLETE": + case 3: + message.migrationState = 3; + break; + } + switch (object.migrationStep) { + case "MIGRATION_STEP_UNSPECIFIED": + case 0: + message.migrationStep = 0; + break; + case "PREPARE": + case 6: + message.migrationStep = 6; + break; + case "START": + case 1: + message.migrationStep = 1; + break; + case "APPLY_WRITES_SYNCHRONOUSLY": + case 7: + message.migrationStep = 7; + break; + case "COPY_AND_VERIFY": + case 2: + message.migrationStep = 2; + break; + case "REDIRECT_EVENTUALLY_CONSISTENT_READS": + case 3: + message.migrationStep = 3; + break; + case "REDIRECT_STRONGLY_CONSISTENT_READS": + case 4: + message.migrationStep = 4; + break; + case "REDIRECT_WRITES": + case 5: + message.migrationStep = 5; + break; + } + return message; + }; - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a plain object from a DatastoreFirestoreMigrationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatastoreFirestoreMigrationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.migrationState = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; + object.migrationStep = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; + } + if (message.migrationState != null && message.hasOwnProperty("migrationState")) + object.migrationState = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.migrationState] : message.migrationState; + if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) + object.migrationStep = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] : message.migrationStep; + return object; + }; - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; + /** + * Converts this DatastoreFirestoreMigrationMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @instance + * @returns {Object.} JSON object + */ + DatastoreFirestoreMigrationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; + return DatastoreFirestoreMigrationMetadata; + })(); - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; + /** + * OperationType enum. + * @name google.datastore.admin.v1.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} EXPORT_ENTITIES=1 EXPORT_ENTITIES value + * @property {number} IMPORT_ENTITIES=2 IMPORT_ENTITIES value + * @property {number} CREATE_INDEX=3 CREATE_INDEX value + * @property {number} DELETE_INDEX=4 DELETE_INDEX value + */ + v1.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXPORT_ENTITIES"] = 1; + values[valuesById[2] = "IMPORT_ENTITIES"] = 2; + values[valuesById[3] = "CREATE_INDEX"] = 3; + values[valuesById[4] = "DELETE_INDEX"] = 4; + return values; + })(); - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v1.Index = (function() { - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Properties of an Index. + * @memberof google.datastore.admin.v1 + * @interface IIndex + * @property {string|null} [projectId] Index projectId + * @property {string|null} [indexId] Index indexId + * @property {string|null} [kind] Index kind + * @property {google.datastore.admin.v1.Index.AncestorMode|null} [ancestor] Index ancestor + * @property {Array.|null} [properties] Index properties + * @property {google.datastore.admin.v1.Index.State|null} [state] Index state + */ + + /** + * Constructs a new Index. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an Index. + * @implements IIndex + * @constructor + * @param {google.datastore.admin.v1.IIndex=} [properties] Properties to set + */ + function Index(properties) { + this.properties = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Index projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.projectId = ""; - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; + /** + * Index indexId. + * @member {string} indexId + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.indexId = ""; - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; + /** + * Index kind. + * @member {string} kind + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.kind = ""; - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; + /** + * Index ancestor. + * @member {google.datastore.admin.v1.Index.AncestorMode} ancestor + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.ancestor = 0; - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Index properties. + * @member {Array.} properties + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.properties = $util.emptyArray; - return DoubleValue; - })(); + /** + * Index state. + * @member {google.datastore.admin.v1.Index.State} state + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.state = 0; - protobuf.FloatValue = (function() { + /** + * Creates a new Index instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.Index + * @static + * @param {google.datastore.admin.v1.IIndex=} [properties] Properties to set + * @returns {google.datastore.admin.v1.Index} Index instance + */ + Index.create = function create(properties) { + return new Index(properties); + }; - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ + /** + * Encodes the specified Index message. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.Index + * @static + * @param {google.datastore.admin.v1.IIndex} message Index message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Index.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kind); + if (message.ancestor != null && Object.hasOwnProperty.call(message, "ancestor")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ancestor); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.datastore.admin.v1.Index.IndexedProperty.encode(message.properties[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + return writer; + }; - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified Index message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.Index + * @static + * @param {google.datastore.admin.v1.IIndex} message Index message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Index.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Index message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.Index + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.Index} Index + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Index.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Index(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 3: + message.indexId = reader.string(); + break; + case 4: + message.kind = reader.string(); + break; + case 5: + message.ancestor = reader.int32(); + break; + case 6: + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.datastore.admin.v1.Index.IndexedProperty.decode(reader, reader.uint32())); + break; + case 7: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; + /** + * Decodes an Index message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.Index + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.Index} Index + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Index.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; + /** + * Verifies an Index message. + * @function verify + * @memberof google.datastore.admin.v1.Index + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Index.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.indexId != null && message.hasOwnProperty("indexId")) + if (!$util.isString(message.indexId)) + return "indexId: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.ancestor != null && message.hasOwnProperty("ancestor")) + switch (message.ancestor) { + default: + return "ancestor: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.datastore.admin.v1.Index.IndexedProperty.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; + /** + * Creates an Index message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.Index + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.Index} Index + */ + Index.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.Index) + return object; + var message = new $root.google.datastore.admin.v1.Index(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.indexId != null) + message.indexId = String(object.indexId); + if (object.kind != null) + message.kind = String(object.kind); + switch (object.ancestor) { + case "ANCESTOR_MODE_UNSPECIFIED": + case 0: + message.ancestor = 0; + break; + case "NONE": + case 1: + message.ancestor = 1; + break; + case "ALL_ANCESTORS": + case 2: + message.ancestor = 2; + break; + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.datastore.admin.v1.Index.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.datastore.admin.v1.Index.properties: object expected"); + message.properties[i] = $root.google.datastore.admin.v1.Index.IndexedProperty.fromObject(object.properties[i]); + } + } + switch (object.state) { + 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 "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + return message; + }; - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from an Index message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.Index + * @static + * @param {google.datastore.admin.v1.Index} message Index + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Index.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.properties = []; + if (options.defaults) { + object.projectId = ""; + object.indexId = ""; + object.kind = ""; + object.ancestor = options.enums === String ? "ANCESTOR_MODE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.indexId != null && message.hasOwnProperty("indexId")) + object.indexId = message.indexId; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.ancestor != null && message.hasOwnProperty("ancestor")) + object.ancestor = options.enums === String ? $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] : message.ancestor; + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.datastore.admin.v1.Index.IndexedProperty.toObject(message.properties[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.datastore.admin.v1.Index.State[message.state] : message.state; + return object; + }; - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this Index to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.Index + * @instance + * @returns {Object.} JSON object + */ + Index.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * AncestorMode enum. + * @name google.datastore.admin.v1.Index.AncestorMode + * @enum {number} + * @property {number} ANCESTOR_MODE_UNSPECIFIED=0 ANCESTOR_MODE_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} ALL_ANCESTORS=2 ALL_ANCESTORS value + */ + Index.AncestorMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANCESTOR_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "ALL_ANCESTORS"] = 2; + return values; + })(); - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; + /** + * Direction enum. + * @name google.datastore.admin.v1.Index.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} ASCENDING=1 ASCENDING value + * @property {number} DESCENDING=2 DESCENDING value + */ + Index.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ASCENDING"] = 1; + values[valuesById[2] = "DESCENDING"] = 2; + return values; + })(); - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; + Index.IndexedProperty = (function() { - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; + /** + * Properties of an IndexedProperty. + * @memberof google.datastore.admin.v1.Index + * @interface IIndexedProperty + * @property {string|null} [name] IndexedProperty name + * @property {google.datastore.admin.v1.Index.Direction|null} [direction] IndexedProperty direction + */ - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new IndexedProperty. + * @memberof google.datastore.admin.v1.Index + * @classdesc Represents an IndexedProperty. + * @implements IIndexedProperty + * @constructor + * @param {google.datastore.admin.v1.Index.IIndexedProperty=} [properties] Properties to set + */ + function IndexedProperty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return FloatValue; - })(); + /** + * IndexedProperty name. + * @member {string} name + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @instance + */ + IndexedProperty.prototype.name = ""; - protobuf.Int64Value = (function() { + /** + * IndexedProperty direction. + * @member {google.datastore.admin.v1.Index.Direction} direction + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @instance + */ + IndexedProperty.prototype.direction = 0; - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ + /** + * Creates a new IndexedProperty instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {google.datastore.admin.v1.Index.IIndexedProperty=} [properties] Properties to set + * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty instance + */ + IndexedProperty.create = function create(properties) { + return new IndexedProperty(properties); + }; - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified IndexedProperty message. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {google.datastore.admin.v1.Index.IIndexedProperty} message IndexedProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexedProperty.encode = function encode(message, writer) { + 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.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); + return writer; + }; - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Encodes the specified IndexedProperty message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {google.datastore.admin.v1.Index.IIndexedProperty} message IndexedProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexedProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; + /** + * Decodes an IndexedProperty message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexedProperty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Index.IndexedProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.direction = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; + /** + * Decodes an IndexedProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexedProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies an IndexedProperty message. + * @function verify + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexedProperty.verify = function verify(message) { + if (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.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates an IndexedProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty + */ + IndexedProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.Index.IndexedProperty) + return object; + var message = new $root.google.datastore.admin.v1.Index.IndexedProperty(); + if (object.name != null) + message.name = String(object.name); + switch (object.direction) { + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "ASCENDING": + case 1: + message.direction = 1; + break; + case "DESCENDING": + case 2: + message.direction = 2; + break; + } + return message; + }; - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from an IndexedProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {google.datastore.admin.v1.Index.IndexedProperty} message IndexedProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexedProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.datastore.admin.v1.Index.Direction[message.direction] : message.direction; + return object; + }; - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; + /** + * Converts this IndexedProperty to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @instance + * @returns {Object.} JSON object + */ + IndexedProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; + return IndexedProperty; + })(); - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; + /** + * State enum. + * @name google.datastore.admin.v1.Index.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} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + */ + Index.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] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Index; + })(); - return Int64Value; + return v1; + })(); + + return admin; })(); - protobuf.UInt64Value = (function() { + return datastore; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.LatLng = (function() { /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude */ /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @param {google.type.ILatLng=} [properties] Properties to set */ - function UInt64Value(properties) { + function LatLng(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28153,75 +30427,88 @@ } /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng * @instance */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + LatLng.prototype.latitude = 0; /** - * Creates a new UInt64Value instance using the specified properties. + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a new LatLng instance using the specified properties. * @function create - * @memberof google.protobuf.UInt64Value + * @memberof google.type.LatLng * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); + LatLng.create = function create(properties) { + return new LatLng(properties); }; /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. * @function encode - * @memberof google.protobuf.UInt64Value + * @memberof google.type.LatLng * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {google.type.ILatLng} message LatLng message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt64Value.encode = function encode(message, writer) { + LatLng.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); return writer; }; /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UInt64Value + * @memberof google.type.LatLng * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {google.type.ILatLng} message LatLng message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + LatLng.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UInt64Value message from the specified reader or buffer. + * Decodes a LatLng message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UInt64Value + * @memberof google.type.LatLng * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value + * @returns {google.type.LatLng} LatLng * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UInt64Value.decode = function decode(reader, length) { + LatLng.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.value = reader.uint64(); + message.latitude = reader.double(); + break; + case 2: + message.longitude = reader.double(); break; default: reader.skipType(tag & 7); @@ -28232,121 +30519,156 @@ }; /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * Decodes a LatLng message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UInt64Value + * @memberof google.type.LatLng * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value + * @returns {google.type.LatLng} LatLng * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { + LatLng.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UInt64Value message. + * Verifies a LatLng message. * @function verify - * @memberof google.protobuf.UInt64Value + * @memberof google.type.LatLng * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UInt64Value.verify = function verify(message) { + LatLng.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; return null; }; /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UInt64Value + * @memberof google.type.LatLng * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value + * @returns {google.type.LatLng} LatLng */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); return message; }; /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * Creates a plain object from a LatLng message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UInt64Value + * @memberof google.type.LatLng * @static - * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {google.type.LatLng} message LatLng * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UInt64Value.toObject = function toObject(message, options) { + LatLng.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; return object; }; /** - * Converts this UInt64Value to JSON. + * Converts this LatLng to JSON. * @function toJSON - * @memberof google.protobuf.UInt64Value + * @memberof google.type.LatLng * @instance * @returns {Object.} JSON object */ - UInt64Value.prototype.toJSON = function toJSON() { + LatLng.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UInt64Value; + return LatLng; })(); - protobuf.Int32Value = (function() { + return type; + })(); - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value + 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 + */ + 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; + 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 Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function Int32Value(properties) { + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28354,75 +30676,91 @@ } /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - Int32Value.prototype.value = 0; + Http.prototype.rules = $util.emptyArray; /** - * Creates a new Int32Value instance using the specified properties. + * 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.protobuf.Int32Value + * @memberof google.api.Http * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.protobuf.Int32Value + * @memberof google.api.Http * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Int32Value.encode = function encode(message, writer) { + Http.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + 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 Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Int32Value + * @memberof google.api.Http * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Int32Value message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Int32Value + * @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.protobuf.Int32Value} Int32Value + * @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 */ - Int32Value.decode = function decode(reader, length) { + Http.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.value = reader.int32(); + 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); @@ -28433,183 +30771,353 @@ }; /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Int32Value + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value + * @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 */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Int32Value message. + * Verifies a Http message. * @function verify - * @memberof google.protobuf.Int32Value + * @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 */ - Int32Value.verify = function verify(message) { + Http.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; + 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 an Int32Value message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Int32Value + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value + * @returns {google.api.Http} Http */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; + 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 an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|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 */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; + HttpRule.prototype.patch = null; /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule * @instance - * @returns {Object.} JSON object */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Int32Value; - })(); + HttpRule.prototype.custom = null; - protobuf.UInt32Value = (function() { + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance */ + HttpRule.prototype.responseBody = ""; /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule * @instance */ - UInt32Value.prototype.value = 0; + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new UInt32Value instance using the specified properties. + * Creates a new HttpRule instance using the specified properties. * @function create - * @memberof google.protobuf.UInt32Value + * @memberof google.api.HttpRule * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.protobuf.UInt32Value + * @memberof google.api.HttpRule * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt32Value.encode = function encode(message, writer) { + HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + 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 UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.UInt32Value + * @memberof google.api.HttpRule * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a UInt32Value message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.UInt32Value + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value + * @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 */ - UInt32Value.decode = function decode(reader, length) { + HttpRule.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.value = reader.uint32(); + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -28620,107 +31128,240 @@ }; /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.UInt32Value + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value + * @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 */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a UInt32Value message. + * Verifies a HttpRule message. * @function verify - * @memberof google.protobuf.UInt32Value + * @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 */ - UInt32Value.verify = function verify(message) { + HttpRule.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; + 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 UInt32Value message from a plain object. Also converts values to their respective internal types. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.UInt32Value + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value + * @returns {google.api.HttpRule} HttpRule */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; + 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 UInt32Value message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.UInt32Value + * @memberof google.api.HttpRule * @static - * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UInt32Value.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; + 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 UInt32Value to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.protobuf.UInt32Value + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - UInt32Value.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UInt32Value; + return HttpRule; })(); - protobuf.BoolValue = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function BoolValue(properties) { + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -28728,75 +31369,88 @@ } /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - BoolValue.prototype.value = false; + CustomHttpPattern.prototype.kind = ""; /** - * Creates a new BoolValue instance using the specified properties. + * 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.protobuf.BoolValue + * @memberof google.api.CustomHttpPattern * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.protobuf.BoolValue + * @memberof google.api.CustomHttpPattern * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoolValue.encode = function encode(message, writer) { + CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + 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 BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.BoolValue + * @memberof google.api.CustomHttpPattern * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BoolValue message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.BoolValue + * @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.protobuf.BoolValue} BoolValue + * @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 */ - BoolValue.decode = function decode(reader, length) { + CustomHttpPattern.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.value = reader.bool(); + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -28807,107 +31461,124 @@ }; /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.BoolValue + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue + * @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 */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BoolValue message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.protobuf.BoolValue + * @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 */ - BoolValue.verify = function verify(message) { + CustomHttpPattern.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; + 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 BoolValue message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.BoolValue + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); + 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 BoolValue message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.BoolValue + * @memberof google.api.CustomHttpPattern * @static - * @param {google.protobuf.BoolValue} message BoolValue + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BoolValue.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; + 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 BoolValue to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.protobuf.BoolValue + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - BoolValue.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BoolValue; + return CustomHttpPattern; })(); - protobuf.StringValue = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value + * 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 StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function StringValue(properties) { + 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) @@ -28915,75 +31586,167 @@ } /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - StringValue.prototype.value = ""; + ResourceDescriptor.prototype.type = ""; /** - * Creates a new StringValue instance using the specified properties. + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. * @function create - * @memberof google.protobuf.StringValue + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - StringValue.create = function create(properties) { - return new StringValue(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.protobuf.StringValue + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StringValue.encode = function encode(message, writer) { + ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + 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 StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.StringValue + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StringValue message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.StringValue + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue + * @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 */ - StringValue.decode = function decode(reader, length) { + ResourceDescriptor.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.value = reader.string(); + 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); @@ -28994,107 +31757,246 @@ }; /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.StringValue + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue + * @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 */ - StringValue.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StringValue message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.protobuf.StringValue + * @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 */ - StringValue.verify = function verify(message) { + ResourceDescriptor.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; + 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 StringValue message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.StringValue + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + 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 StringValue message. Also converts values to other types if specified. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.StringValue + * @memberof google.api.ResourceDescriptor * @static - * @param {google.protobuf.StringValue} message StringValue + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StringValue.toObject = function toObject(message, options) { + ResourceDescriptor.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } return object; }; /** - * Converts this StringValue to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.protobuf.StringValue + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - StringValue.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StringValue; + /** + * 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; })(); - protobuf.BytesValue = (function() { + api.ResourceReference = (function() { /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function BytesValue(properties) { + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29102,75 +32004,88 @@ } /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - BytesValue.prototype.value = $util.newBuffer([]); + ResourceReference.prototype.type = ""; /** - * Creates a new BytesValue instance using the specified properties. + * 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.protobuf.BytesValue + * @memberof google.api.ResourceReference * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.protobuf.BytesValue + * @memberof google.api.ResourceReference * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BytesValue.encode = function encode(message, writer) { + ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + 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 BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.BytesValue + * @memberof google.api.ResourceReference * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BytesValue message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.BytesValue + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue + * @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 */ - BytesValue.decode = function decode(reader, length) { + ResourceReference.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.value = reader.bytes(); + message.type = reader.string(); + break; + case 2: + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -29181,99 +32096,99 @@ }; /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.BytesValue + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue + * @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 */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BytesValue message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.protobuf.BytesValue + * @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 */ - BytesValue.verify = function verify(message) { + ResourceReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; + 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 BytesValue message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.BytesValue + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue + * @returns {google.api.ResourceReference} ResourceReference */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; + 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 BytesValue message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.BytesValue + * @memberof google.api.ResourceReference * @static - * @param {google.protobuf.BytesValue} message BytesValue + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BytesValue.toObject = function toObject(message, options) { + ResourceReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + 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 BytesValue to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.protobuf.BytesValue + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - BytesValue.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BytesValue; + return ResourceReference; })(); - return protobuf; + return api; })(); google.longrunning = (function() { @@ -31424,349 +34339,855 @@ /** * 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); - }; - - return Status; - })(); - - return rpc; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.LatLng = (function() { - - /** - * Properties of a LatLng. - * @memberof google.type - * @interface ILatLng - * @property {number|null} [latitude] LatLng latitude - * @property {number|null} [longitude] LatLng longitude - */ - - /** - * Constructs a new LatLng. - * @memberof google.type - * @classdesc Represents a LatLng. - * @implements ILatLng - * @constructor - * @param {google.type.ILatLng=} [properties] Properties to set - */ - function LatLng(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * LatLng latitude. - * @member {number} latitude - * @memberof google.type.LatLng - * @instance - */ - LatLng.prototype.latitude = 0; - - /** - * LatLng longitude. - * @member {number} longitude - * @memberof google.type.LatLng - * @instance - */ - LatLng.prototype.longitude = 0; - - /** - * Creates a new LatLng instance using the specified properties. - * @function create - * @memberof google.type.LatLng - * @static - * @param {google.type.ILatLng=} [properties] Properties to set - * @returns {google.type.LatLng} LatLng instance - */ - LatLng.create = function create(properties) { - return new LatLng(properties); - }; - - /** - * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. - * @function encode - * @memberof google.type.LatLng - * @static - * @param {google.type.ILatLng} message LatLng message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LatLng.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); - if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); - return writer; - }; - - /** - * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. - * @function encodeDelimited - * @memberof google.type.LatLng - * @static - * @param {google.type.ILatLng} message LatLng message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LatLng.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LatLng message from the specified reader or buffer. - * @function decode - * @memberof google.type.LatLng - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.type.LatLng} LatLng - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LatLng.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.latitude = reader.double(); - break; - case 2: - message.longitude = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a LatLng message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.type.LatLng + * @memberof google.rpc.Status * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.LatLng} LatLng + * @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 */ - LatLng.decodeDelimited = function decodeDelimited(reader) { + Status.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LatLng message. + * Verifies a Status message. * @function verify - * @memberof google.type.LatLng + * @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 */ - LatLng.verify = function verify(message) { + Status.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.latitude != null && message.hasOwnProperty("latitude")) - if (typeof message.latitude !== "number") - return "latitude: number expected"; - if (message.longitude != null && message.hasOwnProperty("longitude")) - if (typeof message.longitude !== "number") - return "longitude: number 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 LatLng message from a plain object. Also converts values to their respective internal types. + * Creates a Status message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.type.LatLng + * @memberof google.rpc.Status * @static * @param {Object.} object Plain object - * @returns {google.type.LatLng} LatLng + * @returns {google.rpc.Status} Status */ - LatLng.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.LatLng) + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) return object; - var message = new $root.google.type.LatLng(); - if (object.latitude != null) - message.latitude = Number(object.latitude); - if (object.longitude != null) - message.longitude = Number(object.longitude); + 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 LatLng message. Also converts values to other types if specified. + * Creates a plain object from a Status message. Also converts values to other types if specified. * @function toObject - * @memberof google.type.LatLng + * @memberof google.rpc.Status * @static - * @param {google.type.LatLng} message LatLng + * @param {google.rpc.Status} message Status * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LatLng.toObject = function toObject(message, options) { + Status.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.details = []; if (options.defaults) { - object.latitude = 0; - object.longitude = 0; + 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); } - if (message.latitude != null && message.hasOwnProperty("latitude")) - object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; - if (message.longitude != null && message.hasOwnProperty("longitude")) - object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; return object; }; /** - * Converts this LatLng to JSON. + * Converts this Status to JSON. * @function toJSON - * @memberof google.type.LatLng + * @memberof google.rpc.Status * @instance * @returns {Object.} JSON object */ - LatLng.prototype.toJSON = function toJSON() { + Status.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LatLng; + return Status; })(); - return type; + return rpc; + })(); + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + return cloud; })(); return google; })(); + + $root.Reference = (function() { + + /** + * Properties of a Reference. + * @exports IReference + * @interface IReference + * @property {string} app Reference app + * @property {string|null} [namespace] Reference namespace + * @property {IPath} path Reference path + * @property {string|null} [databaseId] Reference databaseId + */ + + /** + * Constructs a new Reference. + * @exports Reference + * @classdesc Represents a Reference. + * @implements IReference + * @constructor + * @param {IReference=} [properties] Properties to set + */ + function Reference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Reference app. + * @member {string} app + * @memberof Reference + * @instance + */ + Reference.prototype.app = ""; + + /** + * Reference namespace. + * @member {string} namespace + * @memberof Reference + * @instance + */ + Reference.prototype.namespace = ""; + + /** + * Reference path. + * @member {IPath} path + * @memberof Reference + * @instance + */ + Reference.prototype.path = null; + + /** + * Reference databaseId. + * @member {string} databaseId + * @memberof Reference + * @instance + */ + Reference.prototype.databaseId = ""; + + /** + * Creates a new Reference instance using the specified properties. + * @function create + * @memberof Reference + * @static + * @param {IReference=} [properties] Properties to set + * @returns {Reference} Reference instance + */ + Reference.create = function create(properties) { + return new Reference(properties); + }; + + /** + * Encodes the specified Reference message. Does not implicitly {@link Reference.verify|verify} messages. + * @function encode + * @memberof Reference + * @static + * @param {IReference} message Reference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 13, wireType 2 =*/106).string(message.app); + $root.Path.encode(message.path, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.namespace); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.databaseId); + return writer; + }; + + /** + * Encodes the specified Reference message, length delimited. Does not implicitly {@link Reference.verify|verify} messages. + * @function encodeDelimited + * @memberof Reference + * @static + * @param {IReference} message Reference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Reference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Reference message from the specified reader or buffer. + * @function decode + * @memberof Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Reference} Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Reference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 13: + message.app = reader.string(); + break; + case 20: + message.namespace = reader.string(); + break; + case 14: + message.path = $root.Path.decode(reader, reader.uint32()); + break; + case 23: + message.databaseId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("app")) + throw $util.ProtocolError("missing required 'app'", { instance: message }); + if (!message.hasOwnProperty("path")) + throw $util.ProtocolError("missing required 'path'", { instance: message }); + return message; + }; + + /** + * Decodes a Reference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Reference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Reference} Reference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Reference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Reference message. + * @function verify + * @memberof Reference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Reference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.app)) + return "app: string expected"; + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + { + var error = $root.Path.verify(message.path); + if (error) + return "path." + error; + } + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + return null; + }; + + /** + * Creates a Reference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Reference + * @static + * @param {Object.} object Plain object + * @returns {Reference} Reference + */ + Reference.fromObject = function fromObject(object) { + if (object instanceof $root.Reference) + return object; + var message = new $root.Reference(); + if (object.app != null) + message.app = String(object.app); + if (object.namespace != null) + message.namespace = String(object.namespace); + if (object.path != null) { + if (typeof object.path !== "object") + throw TypeError(".Reference.path: object expected"); + message.path = $root.Path.fromObject(object.path); + } + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + return message; + }; + + /** + * Creates a plain object from a Reference message. Also converts values to other types if specified. + * @function toObject + * @memberof Reference + * @static + * @param {Reference} message Reference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Reference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.app = ""; + object.path = null; + object.namespace = ""; + object.databaseId = ""; + } + if (message.app != null && message.hasOwnProperty("app")) + object.app = message.app; + if (message.path != null && message.hasOwnProperty("path")) + object.path = $root.Path.toObject(message.path, options); + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + return object; + }; + + /** + * Converts this Reference to JSON. + * @function toJSON + * @memberof Reference + * @instance + * @returns {Object.} JSON object + */ + Reference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Reference; + })(); + + $root.Path = (function() { + + /** + * Properties of a Path. + * @exports IPath + * @interface IPath + * @property {Array.|null} [element] Path element + */ + + /** + * Constructs a new Path. + * @exports Path + * @classdesc Represents a Path. + * @implements IPath + * @constructor + * @param {IPath=} [properties] Properties to set + */ + function Path(properties) { + this.element = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Path element. + * @member {Array.} element + * @memberof Path + * @instance + */ + Path.prototype.element = $util.emptyArray; + + /** + * Creates a new Path instance using the specified properties. + * @function create + * @memberof Path + * @static + * @param {IPath=} [properties] Properties to set + * @returns {Path} Path instance + */ + Path.create = function create(properties) { + return new Path(properties); + }; + + /** + * Encodes the specified Path message. Does not implicitly {@link Path.verify|verify} messages. + * @function encode + * @memberof Path + * @static + * @param {IPath} message Path message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Path.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.element != null && message.element.length) + for (var i = 0; i < message.element.length; ++i) + $root.Path.Element.encode(message.element[i], writer.uint32(/* id 1, wireType 3 =*/11)).uint32(/* id 1, wireType 4 =*/12); + return writer; + }; + + /** + * Encodes the specified Path message, length delimited. Does not implicitly {@link Path.verify|verify} messages. + * @function encodeDelimited + * @memberof Path + * @static + * @param {IPath} message Path message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Path.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Path message from the specified reader or buffer. + * @function decode + * @memberof Path + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Path} Path + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Path.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Path(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.element && message.element.length)) + message.element = []; + message.element.push($root.Path.Element.decode(reader)); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Path message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Path + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Path} Path + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Path.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Path message. + * @function verify + * @memberof Path + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Path.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.element != null && message.hasOwnProperty("element")) { + if (!Array.isArray(message.element)) + return "element: array expected"; + for (var i = 0; i < message.element.length; ++i) { + var error = $root.Path.Element.verify(message.element[i]); + if (error) + return "element." + error; + } + } + return null; + }; + + /** + * Creates a Path message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Path + * @static + * @param {Object.} object Plain object + * @returns {Path} Path + */ + Path.fromObject = function fromObject(object) { + if (object instanceof $root.Path) + return object; + var message = new $root.Path(); + if (object.element) { + if (!Array.isArray(object.element)) + throw TypeError(".Path.element: array expected"); + message.element = []; + for (var i = 0; i < object.element.length; ++i) { + if (typeof object.element[i] !== "object") + throw TypeError(".Path.element: object expected"); + message.element[i] = $root.Path.Element.fromObject(object.element[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Path message. Also converts values to other types if specified. + * @function toObject + * @memberof Path + * @static + * @param {Path} message Path + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Path.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.element = []; + if (message.element && message.element.length) { + object.element = []; + for (var j = 0; j < message.element.length; ++j) + object.element[j] = $root.Path.Element.toObject(message.element[j], options); + } + return object; + }; + + /** + * Converts this Path to JSON. + * @function toJSON + * @memberof Path + * @instance + * @returns {Object.} JSON object + */ + Path.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Path.Element = (function() { + + /** + * Properties of an Element. + * @memberof Path + * @interface IElement + * @property {string} type Element type + * @property {number|Long|null} [id] Element id + * @property {string|null} [name] Element name + */ + + /** + * Constructs a new Element. + * @memberof Path + * @classdesc Represents an Element. + * @implements IElement + * @constructor + * @param {Path.IElement=} [properties] Properties to set + */ + function Element(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Element type. + * @member {string} type + * @memberof Path.Element + * @instance + */ + Element.prototype.type = ""; + + /** + * Element id. + * @member {number|Long} id + * @memberof Path.Element + * @instance + */ + Element.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Element name. + * @member {string} name + * @memberof Path.Element + * @instance + */ + Element.prototype.name = ""; + + /** + * Creates a new Element instance using the specified properties. + * @function create + * @memberof Path.Element + * @static + * @param {Path.IElement=} [properties] Properties to set + * @returns {Path.Element} Element instance + */ + Element.create = function create(properties) { + return new Element(properties); + }; + + /** + * Encodes the specified Element message. Does not implicitly {@link Path.Element.verify|verify} messages. + * @function encode + * @memberof Path.Element + * @static + * @param {Path.IElement} message Element message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Element.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; + + /** + * Encodes the specified Element message, length delimited. Does not implicitly {@link Path.Element.verify|verify} messages. + * @function encodeDelimited + * @memberof Path.Element + * @static + * @param {Path.IElement} message Element message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Element.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Element message from the specified reader or buffer. + * @function decode + * @memberof Path.Element + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {Path.Element} Element + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Element.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Path.Element(); + while (reader.pos < end) { + var tag = reader.uint32(); + if ((tag & 7) === 4) + break; + switch (tag >>> 3) { + case 2: + message.type = reader.string(); + break; + case 3: + message.id = reader.int64(); + break; + case 4: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("type")) + throw $util.ProtocolError("missing required 'type'", { instance: message }); + return message; + }; + + /** + * Decodes an Element message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof Path.Element + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {Path.Element} Element + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Element.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Element message. + * @function verify + * @memberof Path.Element + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Element.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an Element message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof Path.Element + * @static + * @param {Object.} object Plain object + * @returns {Path.Element} Element + */ + Element.fromObject = function fromObject(object) { + if (object instanceof $root.Path.Element) + return object; + var message = new $root.Path.Element(); + if (object.type != null) + message.type = String(object.type); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = false; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an Element message. Also converts values to other types if specified. + * @function toObject + * @memberof Path.Element + * @static + * @param {Path.Element} message Element + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Element.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.id = options.longs === String ? "0" : 0; + object.name = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.id != null && message.hasOwnProperty("id")) + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Element to JSON. + * @function toJSON + * @memberof Path.Element + * @instance + * @returns {Object.} JSON object + */ + Element.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Element; + })(); + + return Path; + })(); return $root; }); diff --git a/protos/protos.json b/protos/protos.json index f40ddedcc..18bb2bde5 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -613,12 +613,531 @@ "csharp_namespace": "Google.Cloud.Datastore.V1", "go_package": "google.golang.org/genproto/googleapis/datastore/v1;datastore", "java_multiple_files": true, - "java_outer_classname": "QueryProto", + "java_outer_classname": "DatastoreProto", "java_package": "com.google.datastore.v1", "php_namespace": "Google\\Cloud\\Datastore\\V1", "ruby_package": "Google::Cloud::Datastore::V1" }, "nested": { + "AggregationResult": { + "fields": { + "aggregateProperties": { + "keyType": "string", + "type": "Value", + "id": 2 + } + } + }, + "AggregationResultBatch": { + "fields": { + "aggregationResults": { + "rule": "repeated", + "type": "AggregationResult", + "id": 1 + }, + "moreResults": { + "type": "QueryResultBatch.MoreResultsType", + "id": 2 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 3 + } + } + }, + "PartitionId": { + "fields": { + "projectId": { + "type": "string", + "id": 2 + }, + "databaseId": { + "type": "string", + "id": 3 + }, + "namespaceId": { + "type": "string", + "id": 4 + } + } + }, + "Key": { + "fields": { + "partitionId": { + "type": "PartitionId", + "id": 1 + }, + "path": { + "rule": "repeated", + "type": "PathElement", + "id": 2 + } + }, + "nested": { + "PathElement": { + "oneofs": { + "idType": { + "oneof": [ + "id", + "name" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "id": { + "type": "int64", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + } + } + } + }, + "ArrayValue": { + "fields": { + "values": { + "rule": "repeated", + "type": "Value", + "id": 1 + } + } + }, + "Value": { + "oneofs": { + "valueType": { + "oneof": [ + "nullValue", + "booleanValue", + "integerValue", + "doubleValue", + "timestampValue", + "keyValue", + "stringValue", + "blobValue", + "geoPointValue", + "entityValue", + "arrayValue" + ] + } + }, + "fields": { + "nullValue": { + "type": "google.protobuf.NullValue", + "id": 11 + }, + "booleanValue": { + "type": "bool", + "id": 1 + }, + "integerValue": { + "type": "int64", + "id": 2 + }, + "doubleValue": { + "type": "double", + "id": 3 + }, + "timestampValue": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "keyValue": { + "type": "Key", + "id": 5 + }, + "stringValue": { + "type": "string", + "id": 17 + }, + "blobValue": { + "type": "bytes", + "id": 18 + }, + "geoPointValue": { + "type": "google.type.LatLng", + "id": 8 + }, + "entityValue": { + "type": "Entity", + "id": 6 + }, + "arrayValue": { + "type": "ArrayValue", + "id": 9 + }, + "meaning": { + "type": "int32", + "id": 14 + }, + "excludeFromIndexes": { + "type": "bool", + "id": 19 + } + } + }, + "Entity": { + "fields": { + "key": { + "type": "Key", + "id": 1 + }, + "properties": { + "keyType": "string", + "type": "Value", + "id": 3 + } + } + }, + "EntityResult": { + "fields": { + "entity": { + "type": "Entity", + "id": 1 + }, + "version": { + "type": "int64", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "cursor": { + "type": "bytes", + "id": 3 + } + }, + "nested": { + "ResultType": { + "values": { + "RESULT_TYPE_UNSPECIFIED": 0, + "FULL": 1, + "PROJECTION": 2, + "KEY_ONLY": 3 + } + } + } + }, + "Query": { + "fields": { + "projection": { + "rule": "repeated", + "type": "Projection", + "id": 2 + }, + "kind": { + "rule": "repeated", + "type": "KindExpression", + "id": 3 + }, + "filter": { + "type": "Filter", + "id": 4 + }, + "order": { + "rule": "repeated", + "type": "PropertyOrder", + "id": 5 + }, + "distinctOn": { + "rule": "repeated", + "type": "PropertyReference", + "id": 6 + }, + "startCursor": { + "type": "bytes", + "id": 7 + }, + "endCursor": { + "type": "bytes", + "id": 8 + }, + "offset": { + "type": "int32", + "id": 10 + }, + "limit": { + "type": "google.protobuf.Int32Value", + "id": 12 + } + } + }, + "AggregationQuery": { + "oneofs": { + "queryType": { + "oneof": [ + "nestedQuery" + ] + } + }, + "fields": { + "nestedQuery": { + "type": "Query", + "id": 1 + }, + "aggregations": { + "rule": "repeated", + "type": "Aggregation", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Aggregation": { + "oneofs": { + "operator": { + "oneof": [ + "count" + ] + } + }, + "fields": { + "count": { + "type": "Count", + "id": 1 + }, + "alias": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Count": { + "fields": { + "upTo": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "KindExpression": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "PropertyReference": { + "fields": { + "name": { + "type": "string", + "id": 2 + } + } + }, + "Projection": { + "fields": { + "property": { + "type": "PropertyReference", + "id": 1 + } + } + }, + "PropertyOrder": { + "fields": { + "property": { + "type": "PropertyReference", + "id": 1 + }, + "direction": { + "type": "Direction", + "id": 2 + } + }, + "nested": { + "Direction": { + "values": { + "DIRECTION_UNSPECIFIED": 0, + "ASCENDING": 1, + "DESCENDING": 2 + } + } + } + }, + "Filter": { + "oneofs": { + "filterType": { + "oneof": [ + "compositeFilter", + "propertyFilter" + ] + } + }, + "fields": { + "compositeFilter": { + "type": "CompositeFilter", + "id": 1 + }, + "propertyFilter": { + "type": "PropertyFilter", + "id": 2 + } + } + }, + "CompositeFilter": { + "fields": { + "op": { + "type": "Operator", + "id": 1 + }, + "filters": { + "rule": "repeated", + "type": "Filter", + "id": 2 + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "AND": 1, + "OR": 2 + } + } + } + }, + "PropertyFilter": { + "fields": { + "property": { + "type": "PropertyReference", + "id": 1 + }, + "op": { + "type": "Operator", + "id": 2 + }, + "value": { + "type": "Value", + "id": 3 + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "LESS_THAN": 1, + "LESS_THAN_OR_EQUAL": 2, + "GREATER_THAN": 3, + "GREATER_THAN_OR_EQUAL": 4, + "EQUAL": 5, + "IN": 6, + "NOT_EQUAL": 9, + "HAS_ANCESTOR": 11, + "NOT_IN": 13 + } + } + } + }, + "GqlQuery": { + "fields": { + "queryString": { + "type": "string", + "id": 1 + }, + "allowLiterals": { + "type": "bool", + "id": 2 + }, + "namedBindings": { + "keyType": "string", + "type": "GqlQueryParameter", + "id": 5 + }, + "positionalBindings": { + "rule": "repeated", + "type": "GqlQueryParameter", + "id": 4 + } + } + }, + "GqlQueryParameter": { + "oneofs": { + "parameterType": { + "oneof": [ + "value", + "cursor" + ] + } + }, + "fields": { + "value": { + "type": "Value", + "id": 2 + }, + "cursor": { + "type": "bytes", + "id": 3 + } + } + }, + "QueryResultBatch": { + "fields": { + "skippedResults": { + "type": "int32", + "id": 6 + }, + "skippedCursor": { + "type": "bytes", + "id": 3 + }, + "entityResultType": { + "type": "EntityResult.ResultType", + "id": 1 + }, + "entityResults": { + "rule": "repeated", + "type": "EntityResult", + "id": 2 + }, + "endCursor": { + "type": "bytes", + "id": 4 + }, + "moreResults": { + "type": "MoreResultsType", + "id": 5 + }, + "snapshotVersion": { + "type": "int64", + "id": 7 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + } + }, + "nested": { + "MoreResultsType": { + "values": { + "MORE_RESULTS_TYPE_UNSPECIFIED": 0, + "NOT_FINISHED": 1, + "MORE_RESULTS_AFTER_LIMIT": 2, + "MORE_RESULTS_AFTER_CURSOR": 4, + "NO_MORE_RESULTS": 3 + } + } + } + }, "Datastore": { "options": { "(google.api.default_host)": "datastore.googleapis.com", @@ -661,6 +1180,22 @@ } ] }, + "RunAggregationQuery": { + "requestType": "RunAggregationQueryRequest", + "responseType": "RunAggregationQueryResponse", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}:runAggregationQuery", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}:runAggregationQuery", + "body": "*" + } + } + ] + }, "BeginTransaction": { "requestType": "BeginTransactionRequest", "responseType": "BeginTransactionResponse", @@ -725,270 +1260,48 @@ ] }, "AllocateIds": { - "requestType": "AllocateIdsRequest", - "responseType": "AllocateIdsResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:allocateIds", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id,keys" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:allocateIds", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id,keys" - } - ] - }, - "ReserveIds": { - "requestType": "ReserveIdsRequest", - "responseType": "ReserveIdsResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:reserveIds", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id,keys" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:reserveIds", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id,keys" - } - ] - } - } - }, - "LookupRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "readOptions": { - "type": "ReadOptions", - "id": 1 - }, - "keys": { - "rule": "repeated", - "type": "Key", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "LookupResponse": { - "fields": { - "found": { - "rule": "repeated", - "type": "EntityResult", - "id": 1 - }, - "missing": { - "rule": "repeated", - "type": "EntityResult", - "id": 2 - }, - "deferred": { - "rule": "repeated", - "type": "Key", - "id": 3 - }, - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 7 - } - } - }, - "RunQueryRequest": { - "oneofs": { - "queryType": { - "oneof": [ - "query", - "gqlQuery" - ] - } - }, - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "partitionId": { - "type": "PartitionId", - "id": 2 - }, - "readOptions": { - "type": "ReadOptions", - "id": 1 - }, - "query": { - "type": "Query", - "id": 3 - }, - "gqlQuery": { - "type": "GqlQuery", - "id": 7 - } - } - }, - "RunQueryResponse": { - "fields": { - "batch": { - "type": "QueryResultBatch", - "id": 1 - }, - "query": { - "type": "Query", - "id": 2 - } - } - }, - "BeginTransactionRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "transactionOptions": { - "type": "TransactionOptions", - "id": 10 - } - } - }, - "BeginTransactionResponse": { - "fields": { - "transaction": { - "type": "bytes", - "id": 1 - } - } - }, - "RollbackRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "transaction": { - "type": "bytes", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RollbackResponse": { - "fields": {} - }, - "CommitRequest": { - "oneofs": { - "transactionSelector": { - "oneof": [ - "transaction" - ] - } - }, - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "mode": { - "type": "Mode", - "id": 5 - }, - "transaction": { - "type": "bytes", - "id": 1 - }, - "mutations": { - "rule": "repeated", - "type": "Mutation", - "id": 6 - } - }, - "nested": { - "Mode": { - "values": { - "MODE_UNSPECIFIED": 0, - "TRANSACTIONAL": 1, - "NON_TRANSACTIONAL": 2 - } - } - } - }, - "CommitResponse": { - "fields": { - "mutationResults": { - "rule": "repeated", - "type": "MutationResult", - "id": 3 - }, - "indexUpdates": { - "type": "int32", - "id": 4 - }, - "commitTime": { - "type": "google.protobuf.Timestamp", - "id": 8 - } - } - }, - "AllocateIdsRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 8, + "requestType": "AllocateIdsRequest", + "responseType": "AllocateIdsResponse", "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "(google.api.http).post": "/v1/projects/{project_id}:allocateIds", + "(google.api.http).body": "*", + "(google.api.method_signature)": "project_id,keys" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}:allocateIds", + "body": "*" + } + }, + { + "(google.api.method_signature)": "project_id,keys" + } + ] }, - "keys": { - "rule": "repeated", - "type": "Key", - "id": 1, + "ReserveIds": { + "requestType": "ReserveIdsRequest", + "responseType": "ReserveIdsResponse", "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AllocateIdsResponse": { - "fields": { - "keys": { - "rule": "repeated", - "type": "Key", - "id": 1 + "(google.api.http).post": "/v1/projects/{project_id}:reserveIds", + "(google.api.http).body": "*", + "(google.api.method_signature)": "project_id,keys" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}:reserveIds", + "body": "*" + } + }, + { + "(google.api.method_signature)": "project_id,keys" + } + ] } } }, - "ReserveIdsRequest": { + "LookupRequest": { "fields": { "projectId": { "type": "string", @@ -1001,579 +1314,448 @@ "type": "string", "id": 9 }, + "readOptions": { + "type": "ReadOptions", + "id": 1 + }, "keys": { "rule": "repeated", "type": "Key", - "id": 1, + "id": 3, "options": { "(google.api.field_behavior)": "REQUIRED" } } } }, - "ReserveIdsResponse": { - "fields": {} - }, - "Mutation": { - "oneofs": { - "operation": { - "oneof": [ - "insert", - "update", - "upsert", - "delete" - ] - }, - "conflictDetectionStrategy": { - "oneof": [ - "baseVersion", - "updateTime" - ] - } - }, + "LookupResponse": { "fields": { - "insert": { - "type": "Entity", - "id": 4 - }, - "update": { - "type": "Entity", - "id": 5 - }, - "upsert": { - "type": "Entity", - "id": 6 - }, - "delete": { - "type": "Key", - "id": 7 + "found": { + "rule": "repeated", + "type": "EntityResult", + "id": 1 }, - "baseVersion": { - "type": "int64", - "id": 8 + "missing": { + "rule": "repeated", + "type": "EntityResult", + "id": 2 }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 11 - } - } - }, - "MutationResult": { - "fields": { - "key": { + "deferred": { + "rule": "repeated", "type": "Key", "id": 3 }, - "version": { - "type": "int64", - "id": 4 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6 - }, - "conflictDetected": { - "type": "bool", - "id": 5 - } - } - }, - "ReadOptions": { - "oneofs": { - "consistencyType": { - "oneof": [ - "readConsistency", - "transaction", - "readTime" - ] - } - }, - "fields": { - "readConsistency": { - "type": "ReadConsistency", - "id": 1 - }, - "transaction": { - "type": "bytes", - "id": 2 - }, "readTime": { "type": "google.protobuf.Timestamp", - "id": 4 - } - }, - "nested": { - "ReadConsistency": { - "values": { - "READ_CONSISTENCY_UNSPECIFIED": 0, - "STRONG": 1, - "EVENTUAL": 2 - } + "id": 7 } } }, - "TransactionOptions": { + "RunQueryRequest": { "oneofs": { - "mode": { + "queryType": { "oneof": [ - "readWrite", - "readOnly" + "query", + "gqlQuery" ] } }, - "fields": { - "readWrite": { - "type": "ReadWrite", - "id": 1 - }, - "readOnly": { - "type": "ReadOnly", - "id": 2 - } - }, - "nested": { - "ReadWrite": { - "fields": { - "previousTransaction": { - "type": "bytes", - "id": 1 - } - } - }, - "ReadOnly": { - "fields": { - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - } - } - } - } - }, - "PartitionId": { "fields": { "projectId": { "type": "string", - "id": 2 + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "namespaceId": { + "databaseId": { "type": "string", - "id": 4 - } - } - }, - "Key": { - "fields": { + "id": 9 + }, "partitionId": { "type": "PartitionId", + "id": 2 + }, + "readOptions": { + "type": "ReadOptions", "id": 1 }, - "path": { - "rule": "repeated", - "type": "PathElement", - "id": 2 - } - }, - "nested": { - "PathElement": { - "oneofs": { - "idType": { - "oneof": [ - "id", - "name" - ] - } - }, - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "id": { - "type": "int64", - "id": 2 - }, - "name": { - "type": "string", - "id": 3 - } - } + "query": { + "type": "Query", + "id": 3 + }, + "gqlQuery": { + "type": "GqlQuery", + "id": 7 } } }, - "ArrayValue": { + "RunQueryResponse": { "fields": { - "values": { - "rule": "repeated", - "type": "Value", + "batch": { + "type": "QueryResultBatch", "id": 1 + }, + "query": { + "type": "Query", + "id": 2 } } }, - "Value": { + "RunAggregationQueryRequest": { "oneofs": { - "valueType": { + "queryType": { "oneof": [ - "nullValue", - "booleanValue", - "integerValue", - "doubleValue", - "timestampValue", - "keyValue", - "stringValue", - "blobValue", - "geoPointValue", - "entityValue", - "arrayValue" + "aggregationQuery", + "gqlQuery" ] } }, "fields": { - "nullValue": { - "type": "google.protobuf.NullValue", - "id": 11 + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "booleanValue": { - "type": "bool", - "id": 1 + "databaseId": { + "type": "string", + "id": 9 }, - "integerValue": { - "type": "int64", + "partitionId": { + "type": "PartitionId", "id": 2 }, - "doubleValue": { - "type": "double", - "id": 3 + "readOptions": { + "type": "ReadOptions", + "id": 1 }, - "timestampValue": { - "type": "google.protobuf.Timestamp", - "id": 10 + "aggregationQuery": { + "type": "AggregationQuery", + "id": 3 }, - "keyValue": { - "type": "Key", - "id": 5 + "gqlQuery": { + "type": "GqlQuery", + "id": 7 + } + } + }, + "RunAggregationQueryResponse": { + "fields": { + "batch": { + "type": "AggregationResultBatch", + "id": 1 }, - "stringValue": { + "query": { + "type": "AggregationQuery", + "id": 2 + } + } + }, + "BeginTransactionRequest": { + "fields": { + "projectId": { "type": "string", - "id": 17 - }, - "blobValue": { - "type": "bytes", - "id": 18 - }, - "geoPointValue": { - "type": "google.type.LatLng", - "id": 8 - }, - "entityValue": { - "type": "Entity", - "id": 6 + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "arrayValue": { - "type": "ArrayValue", + "databaseId": { + "type": "string", "id": 9 }, - "meaning": { - "type": "int32", - "id": 14 - }, - "excludeFromIndexes": { - "type": "bool", - "id": 19 + "transactionOptions": { + "type": "TransactionOptions", + "id": 10 } } }, - "Entity": { + "BeginTransactionResponse": { "fields": { - "key": { - "type": "Key", + "transaction": { + "type": "bytes", "id": 1 + } + } + }, + "RollbackRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "properties": { - "keyType": "string", - "type": "Value", - "id": 3 + "databaseId": { + "type": "string", + "id": 9 + }, + "transaction": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "EntityResult": { + "RollbackResponse": { + "fields": {} + }, + "CommitRequest": { + "oneofs": { + "transactionSelector": { + "oneof": [ + "transaction" + ] + } + }, "fields": { - "entity": { - "type": "Entity", - "id": 1 + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "version": { - "type": "int64", - "id": 4 + "databaseId": { + "type": "string", + "id": 9 }, - "updateTime": { - "type": "google.protobuf.Timestamp", + "mode": { + "type": "Mode", "id": 5 }, - "cursor": { + "transaction": { "type": "bytes", - "id": 3 + "id": 1 + }, + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 6 } }, "nested": { - "ResultType": { + "Mode": { "values": { - "RESULT_TYPE_UNSPECIFIED": 0, - "FULL": 1, - "PROJECTION": 2, - "KEY_ONLY": 3 + "MODE_UNSPECIFIED": 0, + "TRANSACTIONAL": 1, + "NON_TRANSACTIONAL": 2 } } } }, - "Query": { + "CommitResponse": { "fields": { - "projection": { - "rule": "repeated", - "type": "Projection", - "id": 2 - }, - "kind": { + "mutationResults": { "rule": "repeated", - "type": "KindExpression", + "type": "MutationResult", "id": 3 }, - "filter": { - "type": "Filter", + "indexUpdates": { + "type": "int32", "id": 4 }, - "order": { - "rule": "repeated", - "type": "PropertyOrder", - "id": 5 - }, - "distinctOn": { - "rule": "repeated", - "type": "PropertyReference", - "id": 6 - }, - "startCursor": { - "type": "bytes", - "id": 7 - }, - "endCursor": { - "type": "bytes", + "commitTime": { + "type": "google.protobuf.Timestamp", "id": 8 - }, - "offset": { - "type": "int32", - "id": 10 - }, - "limit": { - "type": "google.protobuf.Int32Value", - "id": 12 } } }, - "KindExpression": { + "AllocateIdsRequest": { "fields": { - "name": { + "projectId": { "type": "string", - "id": 1 - } - } - }, - "PropertyReference": { - "fields": { - "name": { + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "databaseId": { "type": "string", - "id": 2 + "id": 9 + }, + "keys": { + "rule": "repeated", + "type": "Key", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "Projection": { + "AllocateIdsResponse": { "fields": { - "property": { - "type": "PropertyReference", + "keys": { + "rule": "repeated", + "type": "Key", "id": 1 } } }, - "PropertyOrder": { + "ReserveIdsRequest": { "fields": { - "property": { - "type": "PropertyReference", - "id": 1 + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "direction": { - "type": "Direction", - "id": 2 - } - }, - "nested": { - "Direction": { - "values": { - "DIRECTION_UNSPECIFIED": 0, - "ASCENDING": 1, - "DESCENDING": 2 + "databaseId": { + "type": "string", + "id": 9 + }, + "keys": { + "rule": "repeated", + "type": "Key", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" } } } }, - "Filter": { + "ReserveIdsResponse": { + "fields": {} + }, + "Mutation": { "oneofs": { - "filterType": { + "operation": { "oneof": [ - "compositeFilter", - "propertyFilter" + "insert", + "update", + "upsert", + "delete" + ] + }, + "conflictDetectionStrategy": { + "oneof": [ + "baseVersion", + "updateTime" ] } }, "fields": { - "compositeFilter": { - "type": "CompositeFilter", - "id": 1 + "insert": { + "type": "Entity", + "id": 4 }, - "propertyFilter": { - "type": "PropertyFilter", - "id": 2 + "update": { + "type": "Entity", + "id": 5 + }, + "upsert": { + "type": "Entity", + "id": 6 + }, + "delete": { + "type": "Key", + "id": 7 + }, + "baseVersion": { + "type": "int64", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 } } }, - "CompositeFilter": { + "MutationResult": { "fields": { - "op": { - "type": "Operator", - "id": 1 + "key": { + "type": "Key", + "id": 3 }, - "filters": { - "rule": "repeated", - "type": "Filter", - "id": 2 - } - }, - "nested": { - "Operator": { - "values": { - "OPERATOR_UNSPECIFIED": 0, - "AND": 1 - } + "version": { + "type": "int64", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "conflictDetected": { + "type": "bool", + "id": 5 } } }, - "PropertyFilter": { + "ReadOptions": { + "oneofs": { + "consistencyType": { + "oneof": [ + "readConsistency", + "transaction", + "readTime" + ] + } + }, "fields": { - "property": { - "type": "PropertyReference", + "readConsistency": { + "type": "ReadConsistency", "id": 1 }, - "op": { - "type": "Operator", + "transaction": { + "type": "bytes", "id": 2 }, - "value": { - "type": "Value", - "id": 3 + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 4 } }, "nested": { - "Operator": { + "ReadConsistency": { "values": { - "OPERATOR_UNSPECIFIED": 0, - "LESS_THAN": 1, - "LESS_THAN_OR_EQUAL": 2, - "GREATER_THAN": 3, - "GREATER_THAN_OR_EQUAL": 4, - "EQUAL": 5, - "IN": 6, - "NOT_EQUAL": 9, - "HAS_ANCESTOR": 11, - "NOT_IN": 13 + "READ_CONSISTENCY_UNSPECIFIED": 0, + "STRONG": 1, + "EVENTUAL": 2 } } } }, - "GqlQuery": { - "fields": { - "queryString": { - "type": "string", - "id": 1 - }, - "allowLiterals": { - "type": "bool", - "id": 2 - }, - "namedBindings": { - "keyType": "string", - "type": "GqlQueryParameter", - "id": 5 - }, - "positionalBindings": { - "rule": "repeated", - "type": "GqlQueryParameter", - "id": 4 - } - } - }, - "GqlQueryParameter": { + "TransactionOptions": { "oneofs": { - "parameterType": { + "mode": { "oneof": [ - "value", - "cursor" + "readWrite", + "readOnly" ] } }, "fields": { - "value": { - "type": "Value", - "id": 2 - }, - "cursor": { - "type": "bytes", - "id": 3 - } - } - }, - "QueryResultBatch": { - "fields": { - "skippedResults": { - "type": "int32", - "id": 6 - }, - "skippedCursor": { - "type": "bytes", - "id": 3 - }, - "entityResultType": { - "type": "EntityResult.ResultType", + "readWrite": { + "type": "ReadWrite", "id": 1 }, - "entityResults": { - "rule": "repeated", - "type": "EntityResult", + "readOnly": { + "type": "ReadOnly", "id": 2 - }, - "endCursor": { - "type": "bytes", - "id": 4 - }, - "moreResults": { - "type": "MoreResultsType", - "id": 5 - }, - "snapshotVersion": { - "type": "int64", - "id": 7 - }, - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 8 } }, "nested": { - "MoreResultsType": { - "values": { - "MORE_RESULTS_TYPE_UNSPECIFIED": 0, - "NOT_FINISHED": 1, - "MORE_RESULTS_AFTER_LIMIT": 2, - "MORE_RESULTS_AFTER_CURSOR": 4, - "NO_MORE_RESULTS": 3 + "ReadWrite": { + "fields": { + "previousTransaction": { + "type": "bytes", + "id": 1 + } + } + }, + "ReadOnly": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + } } } } @@ -2325,6 +2507,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, From 83586e7d5d052f94ce8fd3c49600efbfd5f4ec07 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Thu, 28 Jul 2022 17:07:20 -0400 Subject: [PATCH 08/67] old package.json --- package.json | 72 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index ee45794f8..c30bf2e3e 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,7 @@ { "name": "@google-cloud/datastore", - "version": "0.1.0", - "description": "Datastore client for Node.js", - "repository": "googleapis/nodejs-datastore", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], + "version": "7.0.0", + "description": "Cloud Datastore Client Library for Node.js", "keywords": [ "google apis client", "google api client", @@ -20,45 +12,71 @@ "google cloud", "cloud", "google datastore", - "datastore", "datastore" ], + "repository": "googleapis/nodejs-datastore", + "license": "Apache-2.0", + "author": "Google LLC.", + "main": "build/src/index.js", + "files": [ + "build/protos", + "build/src" + ], "scripts": { "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", + "compile": "tsc -p . && cp -r proto* build/ && cp -r system-test/data build/system-test", "compile-protos": "compileProtos src", "docs": "jsdoc -c .jsdoc.js", "predocs-test": "npm run docs", "docs-test": "linkinator docs", "fix": "gts fix", + "prelint": "cd samples; npm link ../; npm install", "lint": "gts check", "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" + "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", + "presystem-test": "npm run compile", + "system-test": "mocha build/system-test --timeout 600000", + "pretest": "npm run compile", + "test": "c8 mocha build/test", + "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.1.1" + "@google-cloud/promisify": "^3.0.0", + "arrify": "^2.0.1", + "concat-stream": "^2.0.0", + "extend": "^3.0.2", + "google-gax": "^3.0.1", + "is": "^3.3.0", + "split-array-stream": "^2.0.0", + "stream-events": "^1.0.5" }, "devDependencies": { - "@types/mocha": "^9.1.0", + "@google-cloud/storage": "^6.0.0", + "@types/extend": "^3.0.1", + "@types/is": "0.0.21", + "@types/js-yaml": "^4.0.0", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", - "@types/sinon": "^10.0.8", - "c8": "^7.11.0", + "@types/proxyquire": "^1.3.28", + "@types/sinon": "^10.0.0", + "c8": "^7.1.0", "gts": "^3.1.0", - "jsdoc": "^3.6.7", + "js-yaml": "^4.0.0", + "jsdoc": "^3.6.3", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^3.0.0", - "mocha": "^10.0.0", - "null-loader": "^4.0.1", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "p-queue": "^6.6.1", "pack-n-play": "^1.0.0-2", + "proxyquire": "^2.1.3", "sinon": "^14.0.0", - "ts-loader": "^9.2.6", - "typescript": "^4.5.5", - "webpack": "^5.67.0", - "webpack-cli": "^4.9.1" + "ts-loader": "^8.0.0", + "typescript": "^4.6.4", + "webpack-cli": "^4.0.0" }, "engines": { - "node": ">=v12" + "node": ">=12.0.0" } } From 0f2bd32b830d3e17aabc074104e21974c0efe659 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 8 Aug 2022 09:50:02 -0400 Subject: [PATCH 09/67] aggregation query request --- src/request.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/request.ts b/src/request.ts index f65b11782..cacb432c8 100644 --- a/src/request.ts +++ b/src/request.ts @@ -772,18 +772,16 @@ class DatastoreRequest { ); } else { const aggregationQueryOptions: AggregationQueryOptions = { - query_type: { - nested_query: queryProto, - }, + nestedQuery: queryProto, aggregations: query.aggregations }; const reqOpts: RunAggregationQueryRequest = Object.assign( sharedQueryOpts, - {query_type: + // {query_type: { - aggregation_query: aggregationQueryOptions + aggregationQuery: aggregationQueryOptions } - } + // } ); console.log('Aggregate'); console.log(reqOpts); @@ -1123,14 +1121,12 @@ export interface RequestOptions extends SharedQueryOptions{ entityFilter?: google.datastore.admin.v1.IEntityFilter; } export interface RunAggregationQueryRequest extends SharedQueryOptions{ - query_type: { - aggregation_query: AggregationQueryOptions - } + // query_type: { + aggregationQuery: AggregationQueryOptions + // } } export interface AggregationQueryOptions { - query_type: { - nested_query: QueryProto, - } + nestedQuery: QueryProto, aggregations: Array } export type RunQueryStreamOptions = RunQueryOptions; From 5469ebc88d14ed7fbfacd81c2bc8baf014ae46b8 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 8 Aug 2022 10:06:12 -0400 Subject: [PATCH 10/67] Commit so I can revert --- src/index.ts | 3 ++- system-test/datastore.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 48ec56d95..f2a769f69 100644 --- a/src/index.ts +++ b/src/index.ts @@ -482,7 +482,8 @@ class Datastore extends DatastoreRequest { options.projectId = options.projectId || process.env.DATASTORE_PROJECT_ID; - this.defaultBaseUrl_ = 'datastore.googleapis.com'; + // this.defaultBaseUrl_ = 'datastore.googleapis.com'; // TODO: Add this back in when ready + this.defaultBaseUrl_ = 'nightly-datastore.sandbox.googleapis.com/' this.determineBaseUrl_(options.apiEndpoint); const scopes: string[] = Array.from( diff --git a/system-test/datastore.ts b/system-test/datastore.ts index b622613cc..f2b70262b 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -797,7 +797,8 @@ describe('Datastore', () => { const [entities] = await datastore.runQuery(q); assert.strictEqual(entities!.length, 6); }); - it('should do a count aggregate filter', async () => { + // TODO: Remove only + it.only('should do a count aggregate filter', async () => { // TODO: count with alias & up_to and also multiple count filters console.log('running stream'); const q = datastore From 173307231db8aa9bbff0f6178d8e9fad35068d08 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 8 Aug 2022 10:06:44 -0400 Subject: [PATCH 11/67] Revert "aggregation query request" This reverts commit 0f2bd32b830d3e17aabc074104e21974c0efe659. --- src/request.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/request.ts b/src/request.ts index cacb432c8..f65b11782 100644 --- a/src/request.ts +++ b/src/request.ts @@ -772,16 +772,18 @@ class DatastoreRequest { ); } else { const aggregationQueryOptions: AggregationQueryOptions = { - nestedQuery: queryProto, + query_type: { + nested_query: queryProto, + }, aggregations: query.aggregations }; const reqOpts: RunAggregationQueryRequest = Object.assign( sharedQueryOpts, - // {query_type: + {query_type: { - aggregationQuery: aggregationQueryOptions + aggregation_query: aggregationQueryOptions } - // } + } ); console.log('Aggregate'); console.log(reqOpts); @@ -1121,12 +1123,14 @@ export interface RequestOptions extends SharedQueryOptions{ entityFilter?: google.datastore.admin.v1.IEntityFilter; } export interface RunAggregationQueryRequest extends SharedQueryOptions{ - // query_type: { - aggregationQuery: AggregationQueryOptions - // } + query_type: { + aggregation_query: AggregationQueryOptions + } } export interface AggregationQueryOptions { - nestedQuery: QueryProto, + query_type: { + nested_query: QueryProto, + } aggregations: Array } export type RunQueryStreamOptions = RunQueryOptions; From 7a99e8c10993a7e441077f87fe8ee74ad6a725f5 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 8 Aug 2022 10:08:17 -0400 Subject: [PATCH 12/67] Revert "Revert "aggregation query request"" This reverts commit 173307231db8aa9bbff0f6178d8e9fad35068d08. --- src/request.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/request.ts b/src/request.ts index f65b11782..cacb432c8 100644 --- a/src/request.ts +++ b/src/request.ts @@ -772,18 +772,16 @@ class DatastoreRequest { ); } else { const aggregationQueryOptions: AggregationQueryOptions = { - query_type: { - nested_query: queryProto, - }, + nestedQuery: queryProto, aggregations: query.aggregations }; const reqOpts: RunAggregationQueryRequest = Object.assign( sharedQueryOpts, - {query_type: + // {query_type: { - aggregation_query: aggregationQueryOptions + aggregationQuery: aggregationQueryOptions } - } + // } ); console.log('Aggregate'); console.log(reqOpts); @@ -1123,14 +1121,12 @@ export interface RequestOptions extends SharedQueryOptions{ entityFilter?: google.datastore.admin.v1.IEntityFilter; } export interface RunAggregationQueryRequest extends SharedQueryOptions{ - query_type: { - aggregation_query: AggregationQueryOptions - } + // query_type: { + aggregationQuery: AggregationQueryOptions + // } } export interface AggregationQueryOptions { - query_type: { - nested_query: QueryProto, - } + nestedQuery: QueryProto, aggregations: Array } export type RunQueryStreamOptions = RunQueryOptions; From 7e4d53ae49336c29385b1ed3ee5349b94d1b046f Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 22 Aug 2022 17:37:50 -0400 Subject: [PATCH 13/67] Added a parser --- src/request.ts | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/request.ts b/src/request.ts index cacb432c8..2790e6d71 100644 --- a/src/request.ts +++ b/src/request.ts @@ -43,7 +43,7 @@ import { EntityProto, KeyProto, ResponseResult, - Entities, + Entities, ValueProto, } from './entity'; import { Query, @@ -792,10 +792,33 @@ class DatastoreRequest { reqOpts, gaxOpts: options.gaxOptions, }, - onResultSet + onAggregateResultSet ); } }; + function onAggregateResultSet(err?: Error | null, resp?: Entity) { + if (err) { + stream.destroy(err); + return; + } + if (resp.batch.aggregationResults) { + try { + const results = resp.batch.aggregationResults; + const finalResults = results + .map((aggregationResult: any) => aggregationResult.aggregateProperties) + .map((aggregateProperties: any) => { + aggregateProperties.reduce((newValues:any, [property, value]:[any, any]) => { + newValues[property] = entity.decodeValueProto(value); + return newValues; + }) + }); + split(finalResults, stream); + } catch (err) { + stream.destroy(err); + return; + } + } + } function onResultSet(err?: Error | null, resp?: Entity) { if (err) { From 7290af7ce5fcd8eaef287858ad3820b136f428a3 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 23 Aug 2022 10:51:04 -0400 Subject: [PATCH 14/67] Comment out filters --- system-test/datastore.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system-test/datastore.ts b/system-test/datastore.ts index f2b70262b..aa5ecf590 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -803,13 +803,13 @@ describe('Datastore', () => { console.log('running stream'); const q = datastore .createQuery('Character') - .hasAncestor(ancestor) - .filter('family', 'Stark') - .filter('appearances', '>=', 20) + // .hasAncestor(ancestor) + // .filter('family', 'Stark') + // .filter('appearances', '>=', 20) .count(); const result = await datastore.runQuery(q); console.log('result'); - console.log(result); + console.log(JSON.stringify(result)); assert.strictEqual(result, 6); }); From efe08268a8967a6a6c63a63126cf36574a7e7ce4 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 23 Aug 2022 11:29:52 -0400 Subject: [PATCH 15/67] Fixed parser --- src/request.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/request.ts b/src/request.ts index 2790e6d71..fd58245af 100644 --- a/src/request.ts +++ b/src/request.ts @@ -806,12 +806,15 @@ class DatastoreRequest { const results = resp.batch.aggregationResults; const finalResults = results .map((aggregationResult: any) => aggregationResult.aggregateProperties) - .map((aggregateProperties: any) => { - aggregateProperties.reduce((newValues:any, [property, value]:[any, any]) => { - newValues[property] = entity.decodeValueProto(value); - return newValues; - }) - }); + .map((aggregateProperties: any) => + Object.fromEntries( + new Map( + Object.keys(aggregateProperties).map(key => + [key, entity.decodeValueProto(aggregateProperties[key])] + ) + ) + ) + ); split(finalResults, stream); } catch (err) { stream.destroy(err); From 6aa110c861f24ddfae4e66cbb95c10b8ba3d2335 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 23 Aug 2022 15:33:28 -0400 Subject: [PATCH 16/67] Add info --- src/request.ts | 19 ++++++++++++++++++- system-test/datastore.ts | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/request.ts b/src/request.ts index fd58245af..2152cecdb 100644 --- a/src/request.ts +++ b/src/request.ts @@ -801,6 +801,12 @@ class DatastoreRequest { stream.destroy(err); return; } + const info: RunQueryInfo = { + moreResults: resp.batch.moreResults, + }; + if (resp.batch.endCursor) { + info.endCursor = resp.batch.endCursor.toString('base64'); + } if (resp.batch.aggregationResults) { try { const results = resp.batch.aggregationResults; @@ -815,7 +821,18 @@ class DatastoreRequest { ) ) ); - split(finalResults, stream); + split(finalResults, stream).then(streamEnded => { + if (streamEnded) { + return; + } + if (resp.batch.moreResults !== 'NOT_FINISHED') { + stream.emit('info', info); + stream.push(null); + return; + } + stream.end(); + return; + }); } catch (err) { stream.destroy(err); return; diff --git a/system-test/datastore.ts b/system-test/datastore.ts index aa5ecf590..32abc8437 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -794,6 +794,8 @@ describe('Datastore', () => { .hasAncestor(ancestor) .filter('family', 'Stark') .filter('appearances', '>=', 20); + // TODO: Remove later + const returnValue = await datastore.runQuery(q); const [entities] = await datastore.runQuery(q); assert.strictEqual(entities!.length, 6); }); From 2de1518281cd34aad5d3765e6075a7a2c4e53221 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 24 Aug 2022 11:06:46 -0400 Subject: [PATCH 17/67] more tests, adding alias --- src/query.ts | 4 +-- src/request.ts | 12 +++------ system-test/datastore.ts | 57 +++++++++++++++++++++++++++++----------- 3 files changed, 46 insertions(+), 27 deletions(-) diff --git a/src/query.ts b/src/query.ts index cae4e5921..05761364a 100644 --- a/src/query.ts +++ b/src/query.ts @@ -167,9 +167,9 @@ class Query { this.aggregations = []; } - count(maximum?: number, alias?: string) { + count(maximum?: number | null, alias?: string) { const count = Object.assign({}, maximum ? {up_to: maximum} : null); - const aggregation = Object.assign({count}, alias ? {} : null) + const aggregation = Object.assign({count}, alias ? {alias} : null) this.aggregations.push(aggregation); return this; } diff --git a/src/request.ts b/src/request.ts index 2152cecdb..3db6dcbba 100644 --- a/src/request.ts +++ b/src/request.ts @@ -759,8 +759,6 @@ class DatastoreRequest { if (query.aggregations.length === 0) { const reqOpts: RequestOptions = sharedQueryOpts; reqOpts.query = queryProto; - console.log('Non aggregate'); - console.log(reqOpts); this.request_( { client: 'DatastoreClient', @@ -777,14 +775,10 @@ class DatastoreRequest { }; const reqOpts: RunAggregationQueryRequest = Object.assign( sharedQueryOpts, - // {query_type: - { - aggregationQuery: aggregationQueryOptions - } - // } + { + aggregationQuery: aggregationQueryOptions + } ); - console.log('Aggregate'); - console.log(reqOpts); this.request_( { client: 'DatastoreClient', diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 32abc8437..aec828b65 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -794,27 +794,52 @@ describe('Datastore', () => { .hasAncestor(ancestor) .filter('family', 'Stark') .filter('appearances', '>=', 20); - // TODO: Remove later - const returnValue = await datastore.runQuery(q); const [entities] = await datastore.runQuery(q); assert.strictEqual(entities!.length, 6); }); - // TODO: Remove only - it.only('should do a count aggregate filter', async () => { + describe('with a count filter', () => { + // TODO: Remove only + it('should do a count aggregate filter', async () => { + // TODO: count with alias & up_to and also multiple count filters + const q = datastore + .createQuery('Character') + .count(); + const [results] = await datastore.runQuery(q); + assert.strictEqual(results.length, 1); + assert.strictEqual(results[0].property_1, 8); + }); + it.only('should do a count aggregate filter with other filters', async () => { + // TODO: count with alias & up_to and also multiple count filters + const q = datastore + .createQuery('Character') + .filter('family', 'Stark') + .filter('appearances', '>=', 20) + .count(null, 'total'); + const [results] = await datastore.runQuery(q); + assert.strictEqual(results.length, 1); + assert.strictEqual(results[0].total, 6); + }); // TODO: count with alias & up_to and also multiple count filters - console.log('running stream'); - const q = datastore - .createQuery('Character') - // .hasAncestor(ancestor) - // .filter('family', 'Stark') - // .filter('appearances', '>=', 20) - .count(); - const result = await datastore.runQuery(q); - console.log('result'); - console.log(JSON.stringify(result)); - assert.strictEqual(result, 6); + // TODO: test with filters + it('should do a count aggregate filter with an alias', async () => { + const q = datastore + .createQuery('Character') + .count(null, 'total'); + const [results] = await datastore.runQuery(q); + assert.strictEqual(results.length, 1); + assert.strictEqual(results[0].total, 8); + }); + it('should do multiple count filters', async () => { + const q = datastore + .createQuery('Character') + .count(4, 'total') + .count(4, 'total2'); + const [results] = await datastore.runQuery(q); + assert.strictEqual(results.length, 1); + assert.strictEqual(results[0].total, 8); + assert.strictEqual(results[0].total2, 8); + }); }); - it('should filter by ancestor', async () => { const q = datastore.createQuery('Character').hasAncestor(ancestor); const [entities] = await datastore.runQuery(q); From e36dcde796ebc6ff4f124fe20d119aef1a90941b Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 24 Aug 2022 11:10:46 -0400 Subject: [PATCH 18/67] use deep strict equal instead --- system-test/datastore.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/system-test/datastore.ts b/system-test/datastore.ts index aec828b65..8a8a820ba 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -799,16 +799,15 @@ describe('Datastore', () => { }); describe('with a count filter', () => { // TODO: Remove only - it('should do a count aggregate filter', async () => { + it.only('should do a count aggregate filter', async () => { // TODO: count with alias & up_to and also multiple count filters const q = datastore .createQuery('Character') .count(); const [results] = await datastore.runQuery(q); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].property_1, 8); + assert.deepStrictEqual(results, [{property_1: 8}]); }); - it.only('should do a count aggregate filter with other filters', async () => { + it('should do a count aggregate filter with other filters', async () => { // TODO: count with alias & up_to and also multiple count filters const q = datastore .createQuery('Character') @@ -816,8 +815,7 @@ describe('Datastore', () => { .filter('appearances', '>=', 20) .count(null, 'total'); const [results] = await datastore.runQuery(q); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].total, 6); + assert.deepStrictEqual(results, [{total: 6}]); }); // TODO: count with alias & up_to and also multiple count filters // TODO: test with filters @@ -826,8 +824,7 @@ describe('Datastore', () => { .createQuery('Character') .count(null, 'total'); const [results] = await datastore.runQuery(q); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].total, 8); + assert.deepStrictEqual(results, [{total: 8}]); }); it('should do multiple count filters', async () => { const q = datastore @@ -835,9 +832,7 @@ describe('Datastore', () => { .count(4, 'total') .count(4, 'total2'); const [results] = await datastore.runQuery(q); - assert.strictEqual(results.length, 1); - assert.strictEqual(results[0].total, 8); - assert.strictEqual(results[0].total2, 8); + assert.deepStrictEqual(results, [{total: 8, total2: 8}]); }); }); it('should filter by ancestor', async () => { From 6e856124fbb69ca1b19d9ac982110bcc58b9f4c4 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 24 Aug 2022 13:57:53 -0400 Subject: [PATCH 19/67] Work on passing in buffered input. --- src/query.ts | 2 +- system-test/datastore.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/query.ts b/src/query.ts index 05761364a..35ac1c809 100644 --- a/src/query.ts +++ b/src/query.ts @@ -168,7 +168,7 @@ class Query { } count(maximum?: number | null, alias?: string) { - const count = Object.assign({}, maximum ? {up_to: maximum} : null); + const count = Object.assign({}, maximum ? {up_to: Buffer.from(maximum, 'base64')} : null); const aggregation = Object.assign({count}, alias ? {alias} : null) this.aggregations.push(aggregation); return this; diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 8a8a820ba..44c0da31f 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -799,14 +799,20 @@ describe('Datastore', () => { }); describe('with a count filter', () => { // TODO: Remove only - it.only('should do a count aggregate filter', async () => { - // TODO: count with alias & up_to and also multiple count filters + it('should do a count aggregate filter', async () => { const q = datastore .createQuery('Character') .count(); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{property_1: 8}]); }); + it.only('should do a count aggregate filter with a maximum', async () => { + const q = datastore + .createQuery('Character') + .count(4); + const [results] = await datastore.runQuery(q); + assert.deepStrictEqual(results, [{property_1: 4}]); + }); it('should do a count aggregate filter with other filters', async () => { // TODO: count with alias & up_to and also multiple count filters const q = datastore From 7e87274ae9b00a90dff17cb156213a734d388e15 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Thu, 25 Aug 2022 11:19:14 -0400 Subject: [PATCH 20/67] Convert to buffer --- src/query.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/query.ts b/src/query.ts index 35ac1c809..1861bed76 100644 --- a/src/query.ts +++ b/src/query.ts @@ -15,6 +15,7 @@ */ import arrify = require('arrify'); +import * as Long from 'long'; import {Key} from 'readline'; import {Datastore} from '.'; import {Entity} from './entity'; @@ -168,7 +169,8 @@ class Query { } count(maximum?: number | null, alias?: string) { - const count = Object.assign({}, maximum ? {up_to: Buffer.from(maximum, 'base64')} : null); + const convertedMaximum = maximum ? {up_to: new Float64Array(Buffer.from(Long.fromNumber(maximum as number).toString(), 'base64'))} : null; + const count = Object.assign({}, convertedMaximum); const aggregation = Object.assign({count}, alias ? {alias} : null) this.aggregations.push(aggregation); return this; From 477a199e88fa75ef9d923c9f571f62ff2dbe2201 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Thu, 25 Aug 2022 11:24:01 -0400 Subject: [PATCH 21/67] Add alias --- system-test/datastore.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 44c0da31f..f3ba78931 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -809,9 +809,9 @@ describe('Datastore', () => { it.only('should do a count aggregate filter with a maximum', async () => { const q = datastore .createQuery('Character') - .count(4); + .count(4, 'total'); const [results] = await datastore.runQuery(q); - assert.deepStrictEqual(results, [{property_1: 4}]); + assert.deepStrictEqual(results, [{total: 4}]); }); it('should do a count aggregate filter with other filters', async () => { // TODO: count with alias & up_to and also multiple count filters From 5ffafd6d585dcb89bf573bde723272662882781c Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 26 Aug 2022 13:51:48 -0400 Subject: [PATCH 22/67] Add the aggregate function --- src/aggregate.ts | 33 +++++++++++++++++++++++++++++++++ src/query.ts | 8 +++----- system-test/datastore.ts | 19 ++++++++----------- 3 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 src/aggregate.ts diff --git a/src/aggregate.ts b/src/aggregate.ts new file mode 100644 index 000000000..813de3977 --- /dev/null +++ b/src/aggregate.ts @@ -0,0 +1,33 @@ +import * as Long from 'long'; + +abstract class AggregateField { + alias_?: string; + + static count(): Count { + return new Count(); + } + + alias(alias: string): AggregateField { + this.alias_ = alias; + return this; + } + + abstract toProto(): any +} + +class Count extends AggregateField { + maximum_?: number + + maximum(maximum: number): AggregateField { + this.maximum_ = maximum; + return this; + } + + toProto(): any { + const convertedMaximum = this.maximum_ ? {up_to: this.maximum_} : null; + const count = Object.assign({}, convertedMaximum); + return Object.assign({count}, this.alias_ ? {alias: this.alias_} : null); + } +} + +export {AggregateField} \ No newline at end of file diff --git a/src/query.ts b/src/query.ts index 1861bed76..804d2604d 100644 --- a/src/query.ts +++ b/src/query.ts @@ -22,6 +22,7 @@ import {Entity} from './entity'; import {Transaction} from './transaction'; import {CallOptions} from 'google-gax'; import {RunQueryStreamOptions} from '../src/request'; +import {AggregateField} from './aggregate'; export type Operator = | '=' @@ -168,11 +169,8 @@ class Query { this.aggregations = []; } - count(maximum?: number | null, alias?: string) { - const convertedMaximum = maximum ? {up_to: new Float64Array(Buffer.from(Long.fromNumber(maximum as number).toString(), 'base64'))} : null; - const count = Object.assign({}, convertedMaximum); - const aggregation = Object.assign({count}, alias ? {alias} : null) - this.aggregations.push(aggregation); + aggregate(aggregate: AggregateField) { + this.aggregations.push(aggregate.toProto()); return this; } diff --git a/system-test/datastore.ts b/system-test/datastore.ts index f3ba78931..845a50cc4 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -20,6 +20,7 @@ import * as yaml from 'js-yaml'; import {Datastore, Index} from '../src'; import {google} from '../protos/protos'; import {Storage} from '@google-cloud/storage'; +import {AggregateField} from '../src/aggregate'; describe('Datastore', () => { const testKinds: string[] = []; @@ -798,45 +799,41 @@ describe('Datastore', () => { assert.strictEqual(entities!.length, 6); }); describe('with a count filter', () => { - // TODO: Remove only it('should do a count aggregate filter', async () => { const q = datastore .createQuery('Character') - .count(); + .aggregate(AggregateField.count()); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{property_1: 8}]); }); - it.only('should do a count aggregate filter with a maximum', async () => { + it('should do a count aggregate filter with a maximum', async () => { const q = datastore .createQuery('Character') - .count(4, 'total'); + .aggregate(AggregateField.count().maximum(4).alias('total')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 4}]); }); it('should do a count aggregate filter with other filters', async () => { - // TODO: count with alias & up_to and also multiple count filters const q = datastore .createQuery('Character') .filter('family', 'Stark') .filter('appearances', '>=', 20) - .count(null, 'total'); + .aggregate(AggregateField.count().alias('total')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 6}]); }); - // TODO: count with alias & up_to and also multiple count filters - // TODO: test with filters it('should do a count aggregate filter with an alias', async () => { const q = datastore .createQuery('Character') - .count(null, 'total'); + .aggregate(AggregateField.count().alias('total')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 8}]); }); it('should do multiple count filters', async () => { const q = datastore .createQuery('Character') - .count(4, 'total') - .count(4, 'total2'); + .aggregate(AggregateField.count().alias('total')) + .aggregate(AggregateField.count().alias('total2')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 8, total2: 8}]); }); From cc602be0324f2a5862fc4f1475ab9bd46b907312 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 26 Aug 2022 14:19:42 -0400 Subject: [PATCH 23/67] change test descriptions --- system-test/datastore.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 845a50cc4..25289ab97 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -799,21 +799,21 @@ describe('Datastore', () => { assert.strictEqual(entities!.length, 6); }); describe('with a count filter', () => { - it('should do a count aggregate filter', async () => { + it('should run a count aggregation', async () => { const q = datastore .createQuery('Character') .aggregate(AggregateField.count()); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{property_1: 8}]); }); - it('should do a count aggregate filter with a maximum', async () => { + it('should run a count aggregation having a maximum', async () => { const q = datastore .createQuery('Character') .aggregate(AggregateField.count().maximum(4).alias('total')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 4}]); }); - it('should do a count aggregate filter with other filters', async () => { + it('should run a count aggregation having other filters', async () => { const q = datastore .createQuery('Character') .filter('family', 'Stark') @@ -822,14 +822,14 @@ describe('Datastore', () => { const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 6}]); }); - it('should do a count aggregate filter with an alias', async () => { + it('should run a count aggregate filter with an alias', async () => { const q = datastore .createQuery('Character') .aggregate(AggregateField.count().alias('total')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 8}]); }); - it('should do multiple count filters', async () => { + it('should do multiple count aggregations', async () => { const q = datastore .createQuery('Character') .aggregate(AggregateField.count().alias('total')) From 5de6f5c9c56d5cd69d7a4f02a580671e4f7599f4 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 26 Aug 2022 14:20:33 -0400 Subject: [PATCH 24/67] Add a unit test --- test/query.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/query.ts b/test/query.ts index 10959256c..3d965ef47 100644 --- a/test/query.ts +++ b/test/query.ts @@ -18,6 +18,7 @@ import {beforeEach, describe, it} from 'mocha'; const {Query} = require('../src/query'); // eslint-disable-next-line @typescript-eslint/no-var-requires import {Datastore} from '../src'; +import {AggregateField} from '../src/aggregate'; describe('Query', () => { const SCOPE = {} as Datastore; @@ -55,6 +56,16 @@ describe('Query', () => { assert.strictEqual(query.namespace, null); }); }); + + it('should create a query with a count aggregation', () => { + const query = new Query(['kind1']) + .aggregate(AggregateField.count().maximum(4).alias('total')) + .aggregate(AggregateField.count().maximum(6).alias('total2')); + assert.deepStrictEqual(query.aggregations, [ + {alias: 'total', count: {up_to: 4}}, + {alias: 'total2', count: {up_to: 6}} + ]); + }) }); describe('filter', () => { From 5639d42f6ed3a0313fe272e709bf087384516113 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 26 Aug 2022 14:44:46 -0400 Subject: [PATCH 25/67] Revert "Files copied over" This reverts commit fe55548b42f4940b4ef306ff9fa8a3e4bc07facc. # Conflicts: # src/index.ts --- README.md | 187 +- .../datastore/v1/aggregation_result.proto | 61 - protos/google/datastore/v1/datastore.proto | 91 +- protos/google/datastore/v1/entity.proto | 4 - protos/google/datastore/v1/query.proto | 63 +- .../generated/v1/datastore.allocate_ids.js | 70 - .../v1/datastore.begin_transaction.js | 68 - samples/generated/v1/datastore.commit.js | 87 - samples/generated/v1/datastore.lookup.js | 73 - samples/generated/v1/datastore.reserve_ids.js | 70 - samples/generated/v1/datastore.rollback.js | 70 - .../v1/datastore.run_aggregation_query.js | 83 - samples/generated/v1/datastore.run_query.js | 83 - .../snippet_metadata.google.datastore.v1.json | 435 ---- src/index.ts | 3 +- src/v1/datastore_client.ts | 1331 +++++------ src/v1/datastore_client_config.json | 5 - src/v1/datastore_proto_list.json | 1 - src/v1/gapic_metadata.json | 82 +- src/v1/index.ts | 3 +- system-test/fixtures/sample/src/index.js | 3 +- system-test/fixtures/sample/src/index.ts | 10 +- system-test/install.ts | 24 +- test/gapic_datastore_v1.ts | 2047 ++++++++--------- webpack.config.js | 14 +- 25 files changed, 1749 insertions(+), 3219 deletions(-) delete mode 100644 protos/google/datastore/v1/aggregation_result.proto delete mode 100644 samples/generated/v1/datastore.allocate_ids.js delete mode 100644 samples/generated/v1/datastore.begin_transaction.js delete mode 100644 samples/generated/v1/datastore.commit.js delete mode 100644 samples/generated/v1/datastore.lookup.js delete mode 100644 samples/generated/v1/datastore.reserve_ids.js delete mode 100644 samples/generated/v1/datastore.rollback.js delete mode 100644 samples/generated/v1/datastore.run_aggregation_query.js delete mode 100644 samples/generated/v1/datastore.run_query.js delete mode 100644 samples/generated/v1/snippet_metadata.google.datastore.v1.json diff --git a/README.md b/README.md index 85e311e00..b4b902f00 100644 --- a/README.md +++ b/README.md @@ -1 +1,186 @@ -Datastore: Nodejs Client +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Datastore: Node.js Client](https://github.com/googleapis/nodejs-datastore) + +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/datastore.svg)](https://www.npmjs.org/package/@google-cloud/datastore) + + + + +Cloud Datastore Client Library for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-datastore/blob/main/CHANGELOG.md). + +* [Google Cloud Datastore Node.js Client API Reference][client-docs] +* [Google Cloud Datastore Documentation][product-docs] +* [github.com/googleapis/nodejs-datastore](https://github.com/googleapis/nodejs-datastore) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable the Google Cloud Datastore API][enable_api]. +1. [Set up authentication with a service account][auth] so you can access the + API from your local workstation. + +### Installing the client library + +```bash +npm install @google-cloud/datastore +``` + + +### Using the client library + +```javascript +// Imports the Google Cloud client library +const {Datastore} = require('@google-cloud/datastore'); + +// Creates a client +const datastore = new Datastore(); + +async function quickstart() { + // The kind for the new entity + const kind = 'Task'; + + // The name/ID for the new entity + const name = 'sampletask1'; + + // The Cloud Datastore key for the new entity + const taskKey = datastore.key([kind, name]); + + // Prepares the new entity + const task = { + key: taskKey, + data: { + description: 'Buy milk', + }, + }; + + // Saves the entity + await datastore.save(task); + console.log(`Saved ${task.key.name}: ${task.data.description}`); +} +quickstart(); + +``` +### Troubleshooting +#### Emulator returning `DEADLINE_EXCEEDED`, `java.lang.OutOfMemoryError` +*Reference Issue: [#95](https://github.com/googleapis/nodejs-datastore/issues/95)* + +When using the emulator, you may experience errors such as "DEADLINE_EXCEEDED" within your application, corresponding to an error in the emulator: "java.lang.OutOfMemoryError". These errors are unique to the emulator environment and will not persist in production. + +A workaround is available, provided by [@ohmpatel1997](https://github.com/ohmpatel1997) [here](https://github.com/googleapis/nodejs-datastore/issues/95#issuecomment-554387312). + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-datastore/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Concepts | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/concepts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/concepts.js,samples/README.md) | +| Error | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/error.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/error.js,samples/README.md) | +| Export | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/export.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/export.js,samples/README.md) | +| Import | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/import.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/import.js,samples/README.md) | +| Indexes.get | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/indexes.get.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/indexes.get.js,samples/README.md) | +| Indexes.list | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/indexes.list.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/indexes.list.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-datastore/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-datastore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Add Task | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.add.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.add.js,samples/README.md) | +| Delete Task | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.delete.js,samples/README.md) | +| Legacy Samples | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.js,samples/README.md) | +| List Tasks | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.list.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.list.js,samples/README.md) | +| Update Task | [source code](https://github.com/googleapis/nodejs-datastore/blob/main/samples/tasks.markdone.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-datastore&page=editor&open_in_editor=samples/tasks.markdone.js,samples/README.md) | + + + +The [Google Cloud Datastore Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Supported Node.js Versions + +Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/). +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/datastore@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. + + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-datastore/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-datastore/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/datastore/latest +[product-docs]: https://cloud.google.com/datastore/docs +[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=datastore.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/protos/google/datastore/v1/aggregation_result.proto b/protos/google/datastore/v1/aggregation_result.proto deleted file mode 100644 index e9c1d4940..000000000 --- a/protos/google/datastore/v1/aggregation_result.proto +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT 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.datastore.v1; - -import "google/datastore/v1/entity.proto"; -import "google/datastore/v1/query.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Datastore.V1"; -option go_package = "google.golang.org/genproto/googleapis/datastore/v1;datastore"; -option java_multiple_files = true; -option java_outer_classname = "AggregationResultProto"; -option java_package = "com.google.datastore.v1"; -option php_namespace = "Google\\Cloud\\Datastore\\V1"; -option ruby_package = "Google::Cloud::Datastore::V1"; - -// The result of a single bucket from a Datastore aggregation query. -// -// The keys of `aggregate_properties` are the same for all results in an -// aggregation query, unlike entity queries which can have different fields -// present for each result. -message AggregationResult { - // The result of the aggregation functions, ex: `COUNT(*) AS total_entities`. - // - // The key is the [alias][google.datastore.v1.AggregationQuery.Aggregation.alias] - // assigned to the aggregation function on input and the size of this map - // equals the number of aggregation functions in the query. - map aggregate_properties = 2; -} - -// A batch of aggregation results produced by an aggregation query. -message AggregationResultBatch { - // The aggregation results for this batch. - repeated AggregationResult aggregation_results = 1; - - // The state of the query after the current batch. - // Only COUNT(*) aggregations are supported in the initial launch. Therefore, - // expected result type is limited to `NO_MORE_RESULTS`. - QueryResultBatch.MoreResultsType more_results = 2; - - // Read timestamp this batch was returned from. - // - // In a single transaction, subsequent query result batches for the same query - // can have a greater timestamp. Each batch's read timestamp - // is valid for all preceding batches. - google.protobuf.Timestamp read_time = 3; -} diff --git a/protos/google/datastore/v1/datastore.proto b/protos/google/datastore/v1/datastore.proto index 1eb65e536..22d930ad0 100644 --- a/protos/google/datastore/v1/datastore.proto +++ b/protos/google/datastore/v1/datastore.proto @@ -19,7 +19,6 @@ package google.datastore.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; -import "google/datastore/v1/aggregation_result.proto"; import "google/datastore/v1/entity.proto"; import "google/datastore/v1/query.proto"; import "google/protobuf/timestamp.proto"; @@ -62,14 +61,6 @@ service Datastore { }; } - // Runs an aggregation query. - rpc RunAggregationQuery(RunAggregationQueryRequest) returns (RunAggregationQueryResponse) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:runAggregationQuery" - body: "*" - }; - } - // Begins a new transaction. rpc BeginTransaction(BeginTransactionRequest) returns (BeginTransactionResponse) { option (google.api.http) = { @@ -125,12 +116,6 @@ message LookupRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; - // The ID of the database against which to make the request. - // - // '(default)' is not allowed; please use empty string '' to refer the default - // database. - string database_id = 9; - // The options for this lookup request. ReadOptions read_options = 1; @@ -164,12 +149,6 @@ message RunQueryRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; - // The ID of the database against which to make the request. - // - // '(default)' is not allowed; please use empty string '' to refer the default - // database. - string database_id = 9; - // Entities are partitioned into subsets, identified by a partition ID. // Queries are scoped to a single partition. // This partition ID is normalized with the standard default context @@ -184,7 +163,7 @@ message RunQueryRequest { // The query to run. Query query = 3; - // The GQL query to run. This query must be a non-aggregation query. + // The GQL query to run. GqlQuery gql_query = 7; } } @@ -198,56 +177,11 @@ message RunQueryResponse { Query query = 2; } -// The request for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery]. -message RunAggregationQueryRequest { - // Required. The ID of the project against which to make the request. - string project_id = 8 [(google.api.field_behavior) = REQUIRED]; - - // The ID of the database against which to make the request. - // - // '(default)' is not allowed; please use empty string '' to refer the default - // database. - string database_id = 9; - - // Entities are partitioned into subsets, identified by a partition ID. - // Queries are scoped to a single partition. - // This partition ID is normalized with the standard default context - // partition ID. - PartitionId partition_id = 2; - - // The options for this query. - ReadOptions read_options = 1; - - // The type of query. - oneof query_type { - // The query to run. - AggregationQuery aggregation_query = 3; - - // The GQL query to run. This query must be an aggregation query. - GqlQuery gql_query = 7; - } -} - -// The response for [Datastore.RunAggregationQuery][google.datastore.v1.Datastore.RunAggregationQuery]. -message RunAggregationQueryResponse { - // A batch of aggregation results. Always present. - AggregationResultBatch batch = 1; - - // The parsed form of the `GqlQuery` from the request, if it was set. - AggregationQuery query = 2; -} - // The request for [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. message BeginTransactionRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; - // The ID of the database against which to make the request. - // - // '(default)' is not allowed; please use empty string '' to refer the default - // database. - string database_id = 9; - // Options for a new transaction. TransactionOptions transaction_options = 10; } @@ -263,12 +197,6 @@ message RollbackRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; - // The ID of the database against which to make the request. - // - // '(default)' is not allowed; please use empty string '' to refer the default - // database. - string database_id = 9; - // Required. The transaction identifier, returned by a call to // [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. bytes transaction = 1 [(google.api.field_behavior) = REQUIRED]; @@ -299,12 +227,6 @@ message CommitRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; - // The ID of the database against which to make the request. - // - // '(default)' is not allowed; please use empty string '' to refer the default - // database. - string database_id = 9; - // The type of commit to perform. Defaults to `TRANSACTIONAL`. Mode mode = 5; @@ -351,12 +273,6 @@ message AllocateIdsRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; - // The ID of the database against which to make the request. - // - // '(default)' is not allowed; please use empty string '' to refer the default - // database. - string database_id = 9; - // Required. A list of keys with incomplete key paths for which to allocate IDs. // No key may be reserved/read-only. repeated Key keys = 1 [(google.api.field_behavior) = REQUIRED]; @@ -374,10 +290,7 @@ message ReserveIdsRequest { // Required. The ID of the project against which to make the request. string project_id = 8 [(google.api.field_behavior) = REQUIRED]; - // The ID of the database against which to make the request. - // - // '(default)' is not allowed; please use empty string '' to refer the default - // database. + // If not empty, the ID of the database against which to make the request. string database_id = 9; // Required. A list of keys with complete key paths whose numeric IDs should not be diff --git a/protos/google/datastore/v1/entity.proto b/protos/google/datastore/v1/entity.proto index 010f1b3af..55d7b64fe 100644 --- a/protos/google/datastore/v1/entity.proto +++ b/protos/google/datastore/v1/entity.proto @@ -51,10 +51,6 @@ message PartitionId { // The ID of the project to which the entities belong. string project_id = 2; - // If not empty, the ID of the database to which the entities - // belong. - string database_id = 3; - // If not empty, the ID of the namespace to which the entities belong. string namespace_id = 4; } diff --git a/protos/google/datastore/v1/query.proto b/protos/google/datastore/v1/query.proto index 2f4b0bb99..00c020021 100644 --- a/protos/google/datastore/v1/query.proto +++ b/protos/google/datastore/v1/query.proto @@ -16,7 +16,6 @@ syntax = "proto3"; package google.datastore.v1; -import "google/api/field_behavior.proto"; import "google/datastore/v1/entity.proto"; import "google/protobuf/timestamp.proto"; import "google/protobuf/wrappers.proto"; @@ -118,60 +117,6 @@ message Query { google.protobuf.Int32Value limit = 12; } -// Datastore query for running an aggregation over a [Query][google.datastore.v1.Query]. -message AggregationQuery { - // Defines a aggregation that produces a single result. - message Aggregation { - // Count of entities that match the query. - // - // The `COUNT(*)` aggregation function operates on the entire entity - // so it does not require a field reference. - message Count { - // Optional. Optional constraint on the maximum number of entities to count. - // - // This provides a way to set an upper bound on the number of entities - // to scan, limiting latency and cost. - // - // High-Level Example: - // - // ``` - // SELECT COUNT_UP_TO(1000) FROM ( SELECT * FROM k ); - // ``` - // - // Requires: - // - // * Must be greater than zero when present. - int32 up_to = 1 [(google.api.field_behavior) = OPTIONAL]; - } - - // The type of aggregation to perform, required. - oneof operator { - // Count aggregator. - Count count = 1; - } - - // Optional. The name of the property to store the result of the aggregation into. If - // not provided, a default alias `property_` will be used. - // For example: property_1, property_2 - // - // Requires: - // - // * Must be unique across all aggregation aliases. - // * Conform to existing [entity property name][google.datastore.v1.Entity.properties] - // limitations. - string alias = 7 [(google.api.field_behavior) = OPTIONAL]; - } - - // The base query to aggregate over. - oneof query_type { - // Nested query for aggregation - Query nested_query = 1; - } - - // Optional. Series of aggregations to apply on top of the base query. - repeated Aggregation aggregations = 3 [(google.api.field_behavior) = OPTIONAL]; -} - // A representation of a kind. message KindExpression { // The name of the kind. @@ -233,19 +178,13 @@ message CompositeFilter { // The results are required to satisfy each of the combined filters. AND = 1; - - // Documents are required to satisfy at least one of the combined filters. - OR = 2; } // The operator for combining multiple filters. Operator op = 1; // The list of filters to combine. - // - // Requires: - // - // * At least one filter is present. + // Must contain at least one filter. repeated Filter filters = 2; } diff --git a/samples/generated/v1/datastore.allocate_ids.js b/samples/generated/v1/datastore.allocate_ids.js deleted file mode 100644 index 54ab84b95..000000000 --- a/samples/generated/v1/datastore.allocate_ids.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, keys) { - // [START datastore_v1_generated_Datastore_AllocateIds_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the project against which to make the request. - */ - // const projectId = 'abc123' - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - */ - // const databaseId = 'abc123' - /** - * Required. A list of keys with incomplete key paths for which to allocate IDs. - * No key may be reserved/read-only. - */ - // const keys = 1234 - - // Imports the Datastore library - const {DatastoreClient} = require('@google-cloud/datastore').v1; - - // Instantiates a client - const datastoreClient = new DatastoreClient(); - - async function callAllocateIds() { - // Construct request - const request = { - projectId, - keys, - }; - - // Run request - const response = await datastoreClient.allocateIds(request); - console.log(response); - } - - callAllocateIds(); - // [END datastore_v1_generated_Datastore_AllocateIds_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.begin_transaction.js b/samples/generated/v1/datastore.begin_transaction.js deleted file mode 100644 index d2b32bff0..000000000 --- a/samples/generated/v1/datastore.begin_transaction.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId) { - // [START datastore_v1_generated_Datastore_BeginTransaction_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the project against which to make the request. - */ - // const projectId = 'abc123' - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - */ - // const databaseId = 'abc123' - /** - * Options for a new transaction. - */ - // const transactionOptions = {} - - // Imports the Datastore library - const {DatastoreClient} = require('@google-cloud/datastore').v1; - - // Instantiates a client - const datastoreClient = new DatastoreClient(); - - async function callBeginTransaction() { - // Construct request - const request = { - projectId, - }; - - // Run request - const response = await datastoreClient.beginTransaction(request); - console.log(response); - } - - callBeginTransaction(); - // [END datastore_v1_generated_Datastore_BeginTransaction_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.commit.js b/samples/generated/v1/datastore.commit.js deleted file mode 100644 index f55c04d22..000000000 --- a/samples/generated/v1/datastore.commit.js +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId) { - // [START datastore_v1_generated_Datastore_Commit_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the project against which to make the request. - */ - // const projectId = 'abc123' - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - */ - // const databaseId = 'abc123' - /** - * The type of commit to perform. Defaults to `TRANSACTIONAL`. - */ - // const mode = {} - /** - * The identifier of the transaction associated with the commit. A - * transaction identifier is returned by a call to - * Datastore.BeginTransaction google.datastore.v1.Datastore.BeginTransaction. - */ - // const transaction = 'Buffer.from('string')' - /** - * The mutations to perform. - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - */ - // const mutations = 1234 - - // Imports the Datastore library - const {DatastoreClient} = require('@google-cloud/datastore').v1; - - // Instantiates a client - const datastoreClient = new DatastoreClient(); - - async function callCommit() { - // Construct request - const request = { - projectId, - }; - - // Run request - const response = await datastoreClient.commit(request); - console.log(response); - } - - callCommit(); - // [END datastore_v1_generated_Datastore_Commit_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.lookup.js b/samples/generated/v1/datastore.lookup.js deleted file mode 100644 index 35f26e90a..000000000 --- a/samples/generated/v1/datastore.lookup.js +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, keys) { - // [START datastore_v1_generated_Datastore_Lookup_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the project against which to make the request. - */ - // const projectId = 'abc123' - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - */ - // const databaseId = 'abc123' - /** - * The options for this lookup request. - */ - // const readOptions = {} - /** - * Required. Keys of entities to look up. - */ - // const keys = 1234 - - // Imports the Datastore library - const {DatastoreClient} = require('@google-cloud/datastore').v1; - - // Instantiates a client - const datastoreClient = new DatastoreClient(); - - async function callLookup() { - // Construct request - const request = { - projectId, - keys, - }; - - // Run request - const response = await datastoreClient.lookup(request); - console.log(response); - } - - callLookup(); - // [END datastore_v1_generated_Datastore_Lookup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.reserve_ids.js b/samples/generated/v1/datastore.reserve_ids.js deleted file mode 100644 index 1f0d22720..000000000 --- a/samples/generated/v1/datastore.reserve_ids.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, keys) { - // [START datastore_v1_generated_Datastore_ReserveIds_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the project against which to make the request. - */ - // const projectId = 'abc123' - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - */ - // const databaseId = 'abc123' - /** - * Required. A list of keys with complete key paths whose numeric IDs should not be - * auto-allocated. - */ - // const keys = 1234 - - // Imports the Datastore library - const {DatastoreClient} = require('@google-cloud/datastore').v1; - - // Instantiates a client - const datastoreClient = new DatastoreClient(); - - async function callReserveIds() { - // Construct request - const request = { - projectId, - keys, - }; - - // Run request - const response = await datastoreClient.reserveIds(request); - console.log(response); - } - - callReserveIds(); - // [END datastore_v1_generated_Datastore_ReserveIds_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.rollback.js b/samples/generated/v1/datastore.rollback.js deleted file mode 100644 index f42c6f482..000000000 --- a/samples/generated/v1/datastore.rollback.js +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId, transaction) { - // [START datastore_v1_generated_Datastore_Rollback_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the project against which to make the request. - */ - // const projectId = 'abc123' - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - */ - // const databaseId = 'abc123' - /** - * Required. The transaction identifier, returned by a call to - * Datastore.BeginTransaction google.datastore.v1.Datastore.BeginTransaction. - */ - // const transaction = 'Buffer.from('string')' - - // Imports the Datastore library - const {DatastoreClient} = require('@google-cloud/datastore').v1; - - // Instantiates a client - const datastoreClient = new DatastoreClient(); - - async function callRollback() { - // Construct request - const request = { - projectId, - transaction, - }; - - // Run request - const response = await datastoreClient.rollback(request); - console.log(response); - } - - callRollback(); - // [END datastore_v1_generated_Datastore_Rollback_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.run_aggregation_query.js b/samples/generated/v1/datastore.run_aggregation_query.js deleted file mode 100644 index 0911fa7de..000000000 --- a/samples/generated/v1/datastore.run_aggregation_query.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId) { - // [START datastore_v1_generated_Datastore_RunAggregationQuery_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the project against which to make the request. - */ - // const projectId = 'abc123' - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - */ - // const databaseId = 'abc123' - /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - */ - // const partitionId = {} - /** - * The options for this query. - */ - // const readOptions = {} - /** - * The query to run. - */ - // const aggregationQuery = {} - /** - * The GQL query to run. This query must be an aggregation query. - */ - // const gqlQuery = {} - - // Imports the Datastore library - const {DatastoreClient} = require('@google-cloud/datastore').v1; - - // Instantiates a client - const datastoreClient = new DatastoreClient(); - - async function callRunAggregationQuery() { - // Construct request - const request = { - projectId, - }; - - // Run request - const response = await datastoreClient.runAggregationQuery(request); - console.log(response); - } - - callRunAggregationQuery(); - // [END datastore_v1_generated_Datastore_RunAggregationQuery_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v1/datastore.run_query.js b/samples/generated/v1/datastore.run_query.js deleted file mode 100644 index 52649bbe5..000000000 --- a/samples/generated/v1/datastore.run_query.js +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(projectId) { - // [START datastore_v1_generated_Datastore_RunQuery_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The ID of the project against which to make the request. - */ - // const projectId = 'abc123' - /** - * The ID of the database against which to make the request. - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - */ - // const databaseId = 'abc123' - /** - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - */ - // const partitionId = {} - /** - * The options for this query. - */ - // const readOptions = {} - /** - * The query to run. - */ - // const query = {} - /** - * The GQL query to run. This query must be a non-aggregation query. - */ - // const gqlQuery = {} - - // Imports the Datastore library - const {DatastoreClient} = require('@google-cloud/datastore').v1; - - // Instantiates a client - const datastoreClient = new DatastoreClient(); - - async function callRunQuery() { - // Construct request - const request = { - projectId, - }; - - // Run request - const response = await datastoreClient.runQuery(request); - console.log(response); - } - - callRunQuery(); - // [END datastore_v1_generated_Datastore_RunQuery_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/samples/generated/v1/snippet_metadata.google.datastore.v1.json b/samples/generated/v1/snippet_metadata.google.datastore.v1.json deleted file mode 100644 index d922d59e9..000000000 --- a/samples/generated/v1/snippet_metadata.google.datastore.v1.json +++ /dev/null @@ -1,435 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-datastore", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.datastore.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "datastore_v1_generated_Datastore_Lookup_async", - "title": "Datastore lookup Sample", - "origin": "API_DEFINITION", - "description": " Looks up entities by key.", - "canonical": true, - "file": "datastore.lookup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 65, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "Lookup", - "fullName": "google.datastore.v1.Datastore.Lookup", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "read_options", - "type": ".google.datastore.v1.ReadOptions" - }, - { - "name": "keys", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.datastore.v1.LookupResponse", - "client": { - "shortName": "DatastoreClient", - "fullName": "google.datastore.v1.DatastoreClient" - }, - "method": { - "shortName": "Lookup", - "fullName": "google.datastore.v1.Datastore.Lookup", - "service": { - "shortName": "Datastore", - "fullName": "google.datastore.v1.Datastore" - } - } - } - }, - { - "regionTag": "datastore_v1_generated_Datastore_RunQuery_async", - "title": "Datastore runQuery Sample", - "origin": "API_DEFINITION", - "description": " Queries for entities.", - "canonical": true, - "file": "datastore.run_query.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunQuery", - "fullName": "google.datastore.v1.Datastore.RunQuery", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "partition_id", - "type": ".google.datastore.v1.PartitionId" - }, - { - "name": "read_options", - "type": ".google.datastore.v1.ReadOptions" - }, - { - "name": "query", - "type": ".google.datastore.v1.Query" - }, - { - "name": "gql_query", - "type": ".google.datastore.v1.GqlQuery" - } - ], - "resultType": ".google.datastore.v1.RunQueryResponse", - "client": { - "shortName": "DatastoreClient", - "fullName": "google.datastore.v1.DatastoreClient" - }, - "method": { - "shortName": "RunQuery", - "fullName": "google.datastore.v1.Datastore.RunQuery", - "service": { - "shortName": "Datastore", - "fullName": "google.datastore.v1.Datastore" - } - } - } - }, - { - "regionTag": "datastore_v1_generated_Datastore_RunAggregationQuery_async", - "title": "Datastore runAggregationQuery Sample", - "origin": "API_DEFINITION", - "description": " Runs an aggregation query.", - "canonical": true, - "file": "datastore.run_aggregation_query.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 75, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RunAggregationQuery", - "fullName": "google.datastore.v1.Datastore.RunAggregationQuery", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "partition_id", - "type": ".google.datastore.v1.PartitionId" - }, - { - "name": "read_options", - "type": ".google.datastore.v1.ReadOptions" - }, - { - "name": "aggregation_query", - "type": ".google.datastore.v1.AggregationQuery" - }, - { - "name": "gql_query", - "type": ".google.datastore.v1.GqlQuery" - } - ], - "resultType": ".google.datastore.v1.RunAggregationQueryResponse", - "client": { - "shortName": "DatastoreClient", - "fullName": "google.datastore.v1.DatastoreClient" - }, - "method": { - "shortName": "RunAggregationQuery", - "fullName": "google.datastore.v1.Datastore.RunAggregationQuery", - "service": { - "shortName": "Datastore", - "fullName": "google.datastore.v1.Datastore" - } - } - } - }, - { - "regionTag": "datastore_v1_generated_Datastore_BeginTransaction_async", - "title": "Datastore beginTransaction Sample", - "origin": "API_DEFINITION", - "description": " Begins a new transaction.", - "canonical": true, - "file": "datastore.begin_transaction.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 60, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "BeginTransaction", - "fullName": "google.datastore.v1.Datastore.BeginTransaction", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "transaction_options", - "type": ".google.datastore.v1.TransactionOptions" - } - ], - "resultType": ".google.datastore.v1.BeginTransactionResponse", - "client": { - "shortName": "DatastoreClient", - "fullName": "google.datastore.v1.DatastoreClient" - }, - "method": { - "shortName": "BeginTransaction", - "fullName": "google.datastore.v1.Datastore.BeginTransaction", - "service": { - "shortName": "Datastore", - "fullName": "google.datastore.v1.Datastore" - } - } - } - }, - { - "regionTag": "datastore_v1_generated_Datastore_Commit_async", - "title": "Datastore commit Sample", - "origin": "API_DEFINITION", - "description": " Commits a transaction, optionally creating, deleting or modifying some entities.", - "canonical": true, - "file": "datastore.commit.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "Commit", - "fullName": "google.datastore.v1.Datastore.Commit", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "mode", - "type": ".google.datastore.v1.CommitRequest.Mode" - }, - { - "name": "transaction", - "type": "TYPE_BYTES" - }, - { - "name": "mutations", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.datastore.v1.CommitResponse", - "client": { - "shortName": "DatastoreClient", - "fullName": "google.datastore.v1.DatastoreClient" - }, - "method": { - "shortName": "Commit", - "fullName": "google.datastore.v1.Datastore.Commit", - "service": { - "shortName": "Datastore", - "fullName": "google.datastore.v1.Datastore" - } - } - } - }, - { - "regionTag": "datastore_v1_generated_Datastore_Rollback_async", - "title": "Datastore rollback Sample", - "origin": "API_DEFINITION", - "description": " Rolls back a transaction.", - "canonical": true, - "file": "datastore.rollback.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "Rollback", - "fullName": "google.datastore.v1.Datastore.Rollback", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "transaction", - "type": "TYPE_BYTES" - } - ], - "resultType": ".google.datastore.v1.RollbackResponse", - "client": { - "shortName": "DatastoreClient", - "fullName": "google.datastore.v1.DatastoreClient" - }, - "method": { - "shortName": "Rollback", - "fullName": "google.datastore.v1.Datastore.Rollback", - "service": { - "shortName": "Datastore", - "fullName": "google.datastore.v1.Datastore" - } - } - } - }, - { - "regionTag": "datastore_v1_generated_Datastore_AllocateIds_async", - "title": "Datastore allocateIds Sample", - "origin": "API_DEFINITION", - "description": " Allocates IDs for the given keys, which is useful for referencing an entity before it is inserted.", - "canonical": true, - "file": "datastore.allocate_ids.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AllocateIds", - "fullName": "google.datastore.v1.Datastore.AllocateIds", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "keys", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.datastore.v1.AllocateIdsResponse", - "client": { - "shortName": "DatastoreClient", - "fullName": "google.datastore.v1.DatastoreClient" - }, - "method": { - "shortName": "AllocateIds", - "fullName": "google.datastore.v1.Datastore.AllocateIds", - "service": { - "shortName": "Datastore", - "fullName": "google.datastore.v1.Datastore" - } - } - } - }, - { - "regionTag": "datastore_v1_generated_Datastore_ReserveIds_async", - "title": "Datastore reserveIds Sample", - "origin": "API_DEFINITION", - "description": " Prevents the supplied keys' IDs from being auto-allocated by Cloud Datastore.", - "canonical": true, - "file": "datastore.reserve_ids.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ReserveIds", - "fullName": "google.datastore.v1.Datastore.ReserveIds", - "async": true, - "parameters": [ - { - "name": "project_id", - "type": "TYPE_STRING" - }, - { - "name": "database_id", - "type": "TYPE_STRING" - }, - { - "name": "keys", - "type": "TYPE_MESSAGE[]" - } - ], - "resultType": ".google.datastore.v1.ReserveIdsResponse", - "client": { - "shortName": "DatastoreClient", - "fullName": "google.datastore.v1.DatastoreClient" - }, - "method": { - "shortName": "ReserveIds", - "fullName": "google.datastore.v1.Datastore.ReserveIds", - "service": { - "shortName": "Datastore", - "fullName": "google.datastore.v1.Datastore" - } - } - } - } - ] -} diff --git a/src/index.ts b/src/index.ts index f2a769f69..48ec56d95 100644 --- a/src/index.ts +++ b/src/index.ts @@ -482,8 +482,7 @@ class Datastore extends DatastoreRequest { options.projectId = options.projectId || process.env.DATASTORE_PROJECT_ID; - // this.defaultBaseUrl_ = 'datastore.googleapis.com'; // TODO: Add this back in when ready - this.defaultBaseUrl_ = 'nightly-datastore.sandbox.googleapis.com/' + this.defaultBaseUrl_ = 'datastore.googleapis.com'; this.determineBaseUrl_(options.apiEndpoint); const scopes: string[] = Array.from( diff --git a/src/v1/datastore_client.ts b/src/v1/datastore_client.ts index aca273848..d75cf5a15 100644 --- a/src/v1/datastore_client.ts +++ b/src/v1/datastore_client.ts @@ -18,7 +18,7 @@ /* global window */ import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, GrpcClientOptions} from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -28,7 +28,7 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './datastore_client_config.json'; -import { operationsProtos } from 'google-gax'; + const version = require('../../../package.json').version; /** @@ -59,7 +59,6 @@ export class DatastoreClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; - operationsClient: gax.OperationsClient; datastoreStub?: Promise<{[name: string]: Function}>; /** @@ -98,11 +97,16 @@ export class DatastoreClient { constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof DatastoreClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!( + opts?.servicePath || opts?.apiEndpoint + ); const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + 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. @@ -120,7 +124,7 @@ export class DatastoreClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -134,10 +138,7 @@ export class DatastoreClient { } // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -145,7 +146,7 @@ export class DatastoreClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { + } else if (opts.fallback === 'rest') { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -154,27 +155,13 @@ export class DatastoreClient { // Load the applicable protos. this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(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 === 'rest') { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/operations/*}:cancel',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - - this.descriptors.longrunning = { - }; - // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.datastore.v1.Datastore', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.datastore.v1.Datastore', + 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 @@ -205,31 +192,43 @@ export class DatastoreClient { // Put together the "service stub" for // google.datastore.v1.Datastore. this.datastoreStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.datastore.v1.Datastore') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.datastore.v1.Datastore' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.datastore.v1.Datastore, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + 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 datastoreStubMethods = - ['lookup', 'runQuery', 'runAggregationQuery', 'beginTransaction', 'commit', 'rollback', 'allocateIds', 'reserveIds']; + const datastoreStubMethods = [ + 'lookup', + 'runQuery', + 'beginTransaction', + 'commit', + 'rollback', + 'allocateIds', + 'reserveIds', + ]; for (const methodName of datastoreStubMethods) { const callPromise = this.datastoreStub.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) => () => { + 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 = - undefined; + const descriptor = undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -275,7 +274,7 @@ export class DatastoreClient { static get scopes() { return [ 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/datastore' + 'https://www.googleapis.com/auth/datastore', ]; } @@ -285,8 +284,9 @@ export class DatastoreClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -297,853 +297,641 @@ export class DatastoreClient { // ------------------- // -- Service calls -- // ------------------- -/** - * Looks up entities by key. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {string} request.databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @param {google.datastore.v1.ReadOptions} request.readOptions - * The options for this lookup request. - * @param {number[]} request.keys - * Required. Keys of entities to look up. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [LookupResponse]{@link google.datastore.v1.LookupResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.lookup.js - * region_tag:datastore_v1_generated_Datastore_Lookup_async - */ + /** + * Looks up entities by key. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {google.datastore.v1.ReadOptions} request.readOptions + * The options for this lookup request. + * @param {number[]} request.keys + * Required. Keys of entities to look up. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [LookupResponse]{@link google.datastore.v1.LookupResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.lookup.js + * region_tag:datastore_v1_generated_Datastore_Lookup_async + */ lookup( - request?: protos.google.datastore.v1.ILookupRequest, - options?: CallOptions): - Promise<[ - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest|undefined, {}|undefined - ]>; + request?: protos.google.datastore.v1.ILookupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest | undefined, + {} | undefined + ] + >; lookup( - request: protos.google.datastore.v1.ILookupRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.ILookupRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest | null | undefined, + {} | null | undefined + > + ): void; lookup( - request: protos.google.datastore.v1.ILookupRequest, - callback: Callback< - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.ILookupRequest, + callback: Callback< + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest | null | undefined, + {} | null | undefined + > + ): void; lookup( - request?: protos.google.datastore.v1.ILookupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.datastore.v1.ILookupRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest|undefined, {}|undefined - ]>|void { + protos.google.datastore.v1.ILookupRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.datastore.v1.ILookupResponse, + protos.google.datastore.v1.ILookupRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.lookup(request, options, callback); } -/** - * Queries for entities. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {string} request.databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @param {google.datastore.v1.PartitionId} request.partitionId - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * @param {google.datastore.v1.ReadOptions} request.readOptions - * The options for this query. - * @param {google.datastore.v1.Query} request.query - * The query to run. - * @param {google.datastore.v1.GqlQuery} request.gqlQuery - * The GQL query to run. This query must be a non-aggregation query. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RunQueryResponse]{@link google.datastore.v1.RunQueryResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.run_query.js - * region_tag:datastore_v1_generated_Datastore_RunQuery_async - */ + /** + * Queries for entities. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {google.datastore.v1.PartitionId} request.partitionId + * Entities are partitioned into subsets, identified by a partition ID. + * Queries are scoped to a single partition. + * This partition ID is normalized with the standard default context + * partition ID. + * @param {google.datastore.v1.ReadOptions} request.readOptions + * The options for this query. + * @param {google.datastore.v1.Query} request.query + * The query to run. + * @param {google.datastore.v1.GqlQuery} request.gqlQuery + * The GQL query to run. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RunQueryResponse]{@link google.datastore.v1.RunQueryResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.run_query.js + * region_tag:datastore_v1_generated_Datastore_RunQuery_async + */ runQuery( - request?: protos.google.datastore.v1.IRunQueryRequest, - options?: CallOptions): - Promise<[ - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest|undefined, {}|undefined - ]>; + request?: protos.google.datastore.v1.IRunQueryRequest, + options?: CallOptions + ): Promise< + [ + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest | undefined, + {} | undefined + ] + >; runQuery( - request: protos.google.datastore.v1.IRunQueryRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IRunQueryRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest | null | undefined, + {} | null | undefined + > + ): void; runQuery( - request: protos.google.datastore.v1.IRunQueryRequest, - callback: Callback< - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IRunQueryRequest, + callback: Callback< + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest | null | undefined, + {} | null | undefined + > + ): void; runQuery( - request?: protos.google.datastore.v1.IRunQueryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.datastore.v1.IRunQueryRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest|undefined, {}|undefined - ]>|void { + protos.google.datastore.v1.IRunQueryRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.datastore.v1.IRunQueryResponse, + protos.google.datastore.v1.IRunQueryRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.runQuery(request, options, callback); } -/** - * Runs an aggregation query. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {string} request.databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @param {google.datastore.v1.PartitionId} request.partitionId - * Entities are partitioned into subsets, identified by a partition ID. - * Queries are scoped to a single partition. - * This partition ID is normalized with the standard default context - * partition ID. - * @param {google.datastore.v1.ReadOptions} request.readOptions - * The options for this query. - * @param {google.datastore.v1.AggregationQuery} request.aggregationQuery - * The query to run. - * @param {google.datastore.v1.GqlQuery} request.gqlQuery - * The GQL query to run. This query must be an aggregation query. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RunAggregationQueryResponse]{@link google.datastore.v1.RunAggregationQueryResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.run_aggregation_query.js - * region_tag:datastore_v1_generated_Datastore_RunAggregationQuery_async - */ - runAggregationQuery( - request?: protos.google.datastore.v1.IRunAggregationQueryRequest, - options?: CallOptions): - Promise<[ - protos.google.datastore.v1.IRunAggregationQueryResponse, - protos.google.datastore.v1.IRunAggregationQueryRequest|undefined, {}|undefined - ]>; - runAggregationQuery( - request: protos.google.datastore.v1.IRunAggregationQueryRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IRunAggregationQueryResponse, - protos.google.datastore.v1.IRunAggregationQueryRequest|null|undefined, - {}|null|undefined>): void; - runAggregationQuery( - request: protos.google.datastore.v1.IRunAggregationQueryRequest, - callback: Callback< - protos.google.datastore.v1.IRunAggregationQueryResponse, - protos.google.datastore.v1.IRunAggregationQueryRequest|null|undefined, - {}|null|undefined>): void; - runAggregationQuery( - request?: protos.google.datastore.v1.IRunAggregationQueryRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.datastore.v1.IRunAggregationQueryResponse, - protos.google.datastore.v1.IRunAggregationQueryRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.datastore.v1.IRunAggregationQueryResponse, - protos.google.datastore.v1.IRunAggregationQueryRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.datastore.v1.IRunAggregationQueryResponse, - protos.google.datastore.v1.IRunAggregationQueryRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); - this.initialize(); - return this.innerApiCalls.runAggregationQuery(request, options, callback); - } -/** - * Begins a new transaction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {string} request.databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @param {google.datastore.v1.TransactionOptions} request.transactionOptions - * Options for a new transaction. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [BeginTransactionResponse]{@link google.datastore.v1.BeginTransactionResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.begin_transaction.js - * region_tag:datastore_v1_generated_Datastore_BeginTransaction_async - */ + /** + * Begins a new transaction. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {google.datastore.v1.TransactionOptions} request.transactionOptions + * Options for a new transaction. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [BeginTransactionResponse]{@link google.datastore.v1.BeginTransactionResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.begin_transaction.js + * region_tag:datastore_v1_generated_Datastore_BeginTransaction_async + */ beginTransaction( - request?: protos.google.datastore.v1.IBeginTransactionRequest, - options?: CallOptions): - Promise<[ - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest|undefined, {}|undefined - ]>; + request?: protos.google.datastore.v1.IBeginTransactionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest | undefined, + {} | undefined + ] + >; beginTransaction( - request: protos.google.datastore.v1.IBeginTransactionRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IBeginTransactionRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest | null | undefined, + {} | null | undefined + > + ): void; beginTransaction( - request: protos.google.datastore.v1.IBeginTransactionRequest, - callback: Callback< - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IBeginTransactionRequest, + callback: Callback< + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest | null | undefined, + {} | null | undefined + > + ): void; beginTransaction( - request?: protos.google.datastore.v1.IBeginTransactionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.datastore.v1.IBeginTransactionRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest|undefined, {}|undefined - ]>|void { + | protos.google.datastore.v1.IBeginTransactionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.datastore.v1.IBeginTransactionResponse, + protos.google.datastore.v1.IBeginTransactionRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.beginTransaction(request, options, callback); } -/** - * Commits a transaction, optionally creating, deleting or modifying some - * entities. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {string} request.databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @param {google.datastore.v1.CommitRequest.Mode} request.mode - * The type of commit to perform. Defaults to `TRANSACTIONAL`. - * @param {Buffer} request.transaction - * The identifier of the transaction associated with the commit. A - * transaction identifier is returned by a call to - * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. - * @param {number[]} request.mutations - * The mutations to perform. - * - * When mode is `TRANSACTIONAL`, mutations affecting a single entity are - * applied in order. The following sequences of mutations affecting a single - * entity are not permitted in a single `Commit` request: - * - * - `insert` followed by `insert` - * - `update` followed by `insert` - * - `upsert` followed by `insert` - * - `delete` followed by `update` - * - * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single - * entity. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [CommitResponse]{@link google.datastore.v1.CommitResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.commit.js - * region_tag:datastore_v1_generated_Datastore_Commit_async - */ + /** + * Commits a transaction, optionally creating, deleting or modifying some + * entities. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {google.datastore.v1.CommitRequest.Mode} request.mode + * The type of commit to perform. Defaults to `TRANSACTIONAL`. + * @param {Buffer} request.transaction + * The identifier of the transaction associated with the commit. A + * transaction identifier is returned by a call to + * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. + * @param {number[]} request.mutations + * The mutations to perform. + * + * When mode is `TRANSACTIONAL`, mutations affecting a single entity are + * applied in order. The following sequences of mutations affecting a single + * entity are not permitted in a single `Commit` request: + * + * - `insert` followed by `insert` + * - `update` followed by `insert` + * - `upsert` followed by `insert` + * - `delete` followed by `update` + * + * When mode is `NON_TRANSACTIONAL`, no two mutations may affect a single + * entity. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [CommitResponse]{@link google.datastore.v1.CommitResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.commit.js + * region_tag:datastore_v1_generated_Datastore_Commit_async + */ commit( - request?: protos.google.datastore.v1.ICommitRequest, - options?: CallOptions): - Promise<[ - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest|undefined, {}|undefined - ]>; + request?: protos.google.datastore.v1.ICommitRequest, + options?: CallOptions + ): Promise< + [ + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest | undefined, + {} | undefined + ] + >; commit( - request: protos.google.datastore.v1.ICommitRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.ICommitRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest | null | undefined, + {} | null | undefined + > + ): void; commit( - request: protos.google.datastore.v1.ICommitRequest, - callback: Callback< - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.ICommitRequest, + callback: Callback< + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest | null | undefined, + {} | null | undefined + > + ): void; commit( - request?: protos.google.datastore.v1.ICommitRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.datastore.v1.ICommitRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest|undefined, {}|undefined - ]>|void { + protos.google.datastore.v1.ICommitRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.datastore.v1.ICommitResponse, + protos.google.datastore.v1.ICommitRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.commit(request, options, callback); } -/** - * Rolls back a transaction. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {string} request.databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @param {Buffer} request.transaction - * Required. The transaction identifier, returned by a call to - * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RollbackResponse]{@link google.datastore.v1.RollbackResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.rollback.js - * region_tag:datastore_v1_generated_Datastore_Rollback_async - */ + /** + * Rolls back a transaction. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {Buffer} request.transaction + * Required. The transaction identifier, returned by a call to + * {@link google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [RollbackResponse]{@link google.datastore.v1.RollbackResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.rollback.js + * region_tag:datastore_v1_generated_Datastore_Rollback_async + */ rollback( - request?: protos.google.datastore.v1.IRollbackRequest, - options?: CallOptions): - Promise<[ - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest|undefined, {}|undefined - ]>; + request?: protos.google.datastore.v1.IRollbackRequest, + options?: CallOptions + ): Promise< + [ + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest | undefined, + {} | undefined + ] + >; rollback( - request: protos.google.datastore.v1.IRollbackRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IRollbackRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest | null | undefined, + {} | null | undefined + > + ): void; rollback( - request: protos.google.datastore.v1.IRollbackRequest, - callback: Callback< - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IRollbackRequest, + callback: Callback< + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest | null | undefined, + {} | null | undefined + > + ): void; rollback( - request?: protos.google.datastore.v1.IRollbackRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.datastore.v1.IRollbackRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest|undefined, {}|undefined - ]>|void { + protos.google.datastore.v1.IRollbackRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.datastore.v1.IRollbackResponse, + protos.google.datastore.v1.IRollbackRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.rollback(request, options, callback); } -/** - * Allocates IDs for the given keys, which is useful for referencing an entity - * before it is inserted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {string} request.databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @param {number[]} request.keys - * Required. A list of keys with incomplete key paths for which to allocate IDs. - * No key may be reserved/read-only. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [AllocateIdsResponse]{@link google.datastore.v1.AllocateIdsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.allocate_ids.js - * region_tag:datastore_v1_generated_Datastore_AllocateIds_async - */ + /** + * Allocates IDs for the given keys, which is useful for referencing an entity + * before it is inserted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {number[]} request.keys + * Required. A list of keys with incomplete key paths for which to allocate IDs. + * No key may be reserved/read-only. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AllocateIdsResponse]{@link google.datastore.v1.AllocateIdsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.allocate_ids.js + * region_tag:datastore_v1_generated_Datastore_AllocateIds_async + */ allocateIds( - request?: protos.google.datastore.v1.IAllocateIdsRequest, - options?: CallOptions): - Promise<[ - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest|undefined, {}|undefined - ]>; + request?: protos.google.datastore.v1.IAllocateIdsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest | undefined, + {} | undefined + ] + >; allocateIds( - request: protos.google.datastore.v1.IAllocateIdsRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IAllocateIdsRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, + {} | null | undefined + > + ): void; allocateIds( - request: protos.google.datastore.v1.IAllocateIdsRequest, - callback: Callback< - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IAllocateIdsRequest, + callback: Callback< + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, + {} | null | undefined + > + ): void; allocateIds( - request?: protos.google.datastore.v1.IAllocateIdsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.datastore.v1.IAllocateIdsRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest|undefined, {}|undefined - ]>|void { + protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.datastore.v1.IAllocateIdsResponse, + protos.google.datastore.v1.IAllocateIdsRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.allocateIds(request, options, callback); } -/** - * Prevents the supplied keys' IDs from being auto-allocated by Cloud - * Datastore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. The ID of the project against which to make the request. - * @param {string} request.databaseId - * The ID of the database against which to make the request. - * - * '(default)' is not allowed; please use empty string '' to refer the default - * database. - * @param {number[]} request.keys - * Required. A list of keys with complete key paths whose numeric IDs should not be - * auto-allocated. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ReserveIdsResponse]{@link google.datastore.v1.ReserveIdsResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example include:samples/generated/v1/datastore.reserve_ids.js - * region_tag:datastore_v1_generated_Datastore_ReserveIds_async - */ + /** + * Prevents the supplied keys' IDs from being auto-allocated by Cloud + * Datastore. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.projectId + * Required. The ID of the project against which to make the request. + * @param {string} request.databaseId + * If not empty, the ID of the database against which to make the request. + * @param {number[]} request.keys + * Required. A list of keys with complete key paths whose numeric IDs should not be + * auto-allocated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [ReserveIdsResponse]{@link google.datastore.v1.ReserveIdsResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/datastore.reserve_ids.js + * region_tag:datastore_v1_generated_Datastore_ReserveIds_async + */ reserveIds( - request?: protos.google.datastore.v1.IReserveIdsRequest, - options?: CallOptions): - Promise<[ - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest|undefined, {}|undefined - ]>; + request?: protos.google.datastore.v1.IReserveIdsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest | undefined, + {} | undefined + ] + >; reserveIds( - request: protos.google.datastore.v1.IReserveIdsRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IReserveIdsRequest, + options: CallOptions, + callback: Callback< + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest | null | undefined, + {} | null | undefined + > + ): void; reserveIds( - request: protos.google.datastore.v1.IReserveIdsRequest, - callback: Callback< - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.datastore.v1.IReserveIdsRequest, + callback: Callback< + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest | null | undefined, + {} | null | undefined + > + ): void; reserveIds( - request?: protos.google.datastore.v1.IReserveIdsRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.datastore.v1.IReserveIdsRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest|undefined, {}|undefined - ]>|void { + protos.google.datastore.v1.IReserveIdsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.datastore.v1.IReserveIdsResponse, + protos.google.datastore.v1.IReserveIdsRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'project_id': request.projectId || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + project_id: request.projectId || '', + }); this.initialize(); return this.innerApiCalls.reserveIds(request, options, callback); } -/** - * 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 [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#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 - * [google.longrunning.Operation]{@link - * external:"google.longrunning.Operation"}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * [google.longrunning.Operation]{@link - * external:"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, - options?: - | 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]> { - 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 [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#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. - * - * @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 { - 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 [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#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, - options?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.CancelOperationRequest, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - 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 [gax.CallOptions]{@link - * https://googleapis.github.io/gax-nodejs/global.html#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, - options?: - | 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 { - return this.operationsClient.deleteOperation(request, options, callback); - } - - /** * Terminate the gRPC channel and close the client. * @@ -1155,7 +943,6 @@ export class DatastoreClient { return this.datastoreStub.then(stub => { this._terminated = true; stub.close(); - this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/src/v1/datastore_client_config.json b/src/v1/datastore_client_config.json index 00d94ed6e..37bd1c737 100644 --- a/src/v1/datastore_client_config.json +++ b/src/v1/datastore_client_config.json @@ -30,11 +30,6 @@ "retry_codes_name": "idempotent", "retry_params_name": "default" }, - "RunAggregationQuery": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, "BeginTransaction": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/src/v1/datastore_proto_list.json b/src/v1/datastore_proto_list.json index 87f7c47cc..0636f1215 100644 --- a/src/v1/datastore_proto_list.json +++ b/src/v1/datastore_proto_list.json @@ -1,5 +1,4 @@ [ - "../../protos/google/datastore/v1/aggregation_result.proto", "../../protos/google/datastore/v1/datastore.proto", "../../protos/google/datastore/v1/entity.proto", "../../protos/google/datastore/v1/query.proto" diff --git a/src/v1/gapic_metadata.json b/src/v1/gapic_metadata.json index 89f84dcae..2b53e796b 100644 --- a/src/v1/gapic_metadata.json +++ b/src/v1/gapic_metadata.json @@ -2,97 +2,81 @@ "schema": "1.0", "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", - "protoPackage": "google.datastore.v1", - "libraryPackage": "@google-cloud/datastore", + "protoPackage": "google.datastore.admin.v1", + "libraryPackage": "@google-cloud/datastore-admin", "services": { - "Datastore": { + "DatastoreAdmin": { "clients": { "grpc": { - "libraryClient": "DatastoreClient", + "libraryClient": "DatastoreAdminClient", "rpcs": { - "Lookup": { + "GetIndex": { "methods": [ - "lookup" + "getIndex" ] }, - "RunQuery": { + "ExportEntities": { "methods": [ - "runQuery" + "exportEntities" ] }, - "RunAggregationQuery": { + "ImportEntities": { "methods": [ - "runAggregationQuery" + "importEntities" ] }, - "BeginTransaction": { + "CreateIndex": { "methods": [ - "beginTransaction" + "createIndex" ] }, - "Commit": { + "DeleteIndex": { "methods": [ - "commit" + "deleteIndex" ] }, - "Rollback": { + "ListIndexes": { "methods": [ - "rollback" - ] - }, - "AllocateIds": { - "methods": [ - "allocateIds" - ] - }, - "ReserveIds": { - "methods": [ - "reserveIds" + "listIndexes", + "listIndexesStream", + "listIndexesAsync" ] } } }, "grpc-fallback": { - "libraryClient": "DatastoreClient", + "libraryClient": "DatastoreAdminClient", "rpcs": { - "Lookup": { - "methods": [ - "lookup" - ] - }, - "RunQuery": { - "methods": [ - "runQuery" - ] - }, - "RunAggregationQuery": { + "GetIndex": { "methods": [ - "runAggregationQuery" + "getIndex" ] }, - "BeginTransaction": { + "ExportEntities": { "methods": [ - "beginTransaction" + "exportEntities" ] }, - "Commit": { + "ImportEntities": { "methods": [ - "commit" + "importEntities" ] }, - "Rollback": { + "CreateIndex": { "methods": [ - "rollback" + "createIndex" ] }, - "AllocateIds": { + "DeleteIndex": { "methods": [ - "allocateIds" + "deleteIndex" ] }, - "ReserveIds": { + "ListIndexes": { "methods": [ - "reserveIds" + "listIndexes", + "listIndexesStream", + "listIndexesAsync" ] } } diff --git a/src/v1/index.ts b/src/v1/index.ts index cb6cd3a7a..cba4bf594 100644 --- a/src/v1/index.ts +++ b/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,5 +16,6 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +export {DatastoreAdminClient} from './datastore_admin_client'; export {DatastoreClient} from './datastore_client'; export {DatastoreAdminClient} from './datastore_admin_client'; diff --git a/system-test/fixtures/sample/src/index.js b/system-test/fixtures/sample/src/index.js index 5dbaf7a7b..44c29691c 100644 --- a/system-test/fixtures/sample/src/index.js +++ b/system-test/fixtures/sample/src/index.js @@ -16,12 +16,11 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** - /* eslint-disable node/no-missing-require, no-unused-vars */ const datastore = require('@google-cloud/datastore'); function main() { - const datastoreClient = new datastore.DatastoreClient(); + const datastoreClient = new datastore.Datastore(); } main(); diff --git a/system-test/fixtures/sample/src/index.ts b/system-test/fixtures/sample/src/index.ts index 28b7ce4d6..97fdbf6f7 100644 --- a/system-test/fixtures/sample/src/index.ts +++ b/system-test/fixtures/sample/src/index.ts @@ -16,17 +16,17 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {DatastoreClient} from '@google-cloud/datastore'; +import {Datastore} from '@google-cloud/datastore'; // check that the client class type name can be used -function doStuffWithDatastoreClient(client: DatastoreClient) { - client.close(); +function doStuffWithDatastore(client: Datastore) { + // client.close(); } function main() { // check that the client instance can be created - const datastoreClient = new DatastoreClient(); - doStuffWithDatastoreClient(datastoreClient); + const datastoreClient = new Datastore(); + doStuffWithDatastore(datastoreClient); } main(); diff --git a/system-test/install.ts b/system-test/install.ts index 8ec452229..6dd1eaada 100644 --- a/system-test/install.ts +++ b/system-test/install.ts @@ -16,34 +16,36 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { + it('TypeScript code', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), sample: { description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, }; await packNTest(options); }); - it('JavaScript code', async function() { + it('JavaScript code', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), sample: { description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, }; await packNTest(options); }); - }); diff --git a/test/gapic_datastore_v1.ts b/test/gapic_datastore_v1.ts index 89e282eda..722a27d04 100644 --- a/test/gapic_datastore_v1.ts +++ b/test/gapic_datastore_v1.ts @@ -20,1167 +20,998 @@ 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 {describe, it} from 'mocha'; import * as datastoreModule from '../src'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import {protobuf} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; + 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]); + 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 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); +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); } describe('v1.DatastoreClient', () => { - it('has servicePath', () => { - const servicePath = datastoreModule.v1.DatastoreClient.servicePath; - assert(servicePath); + it('has servicePath', () => { + const servicePath = datastoreModule.v1.DatastoreClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datastoreModule.v1.DatastoreClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datastoreModule.v1.DatastoreClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datastoreModule.v1.DatastoreClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datastoreModule.v1.DatastoreClient({ + fallback: true, }); + assert(client); + }); - it('has apiEndpoint', () => { - const apiEndpoint = datastoreModule.v1.DatastoreClient.apiEndpoint; - assert(apiEndpoint); + it('has initialize method and supports deferred initialization', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('has port', () => { - const port = datastoreModule.v1.DatastoreClient.port; - assert(port); - assert(typeof port === 'number'); + assert.strictEqual(client.datastoreStub, undefined); + await client.initialize(); + assert(client.datastoreStub); + }); + + it('has close method for the initialized client', done => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('should create a client with no option', () => { - const client = new datastoreModule.v1.DatastoreClient(); - assert(client); + client.initialize(); + assert(client.datastoreStub); + client.close().then(() => { + done(); }); + }); - it('should create a client with gRPC fallback', () => { - const client = new datastoreModule.v1.DatastoreClient({ - fallback: true, - }); - assert(client); + it('has close method for the non-initialized client', done => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.datastoreStub, undefined); - await client.initialize(); - assert(client.datastoreStub); + assert.strictEqual(client.datastoreStub, undefined); + client.close().then(() => { + done(); }); + }); - it('has close method for the initialized client', done => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - assert(client.datastoreStub); - client.close().then(() => { - done(); - }); + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('has close method for the non-initialized client', done => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.datastoreStub, undefined); - client.close().then(() => { - done(); - }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('lookup', () => { + it('invokes lookup without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.LookupRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.LookupResponse() + ); + client.innerApiCalls.lookup = stubSimpleCall(expectedResponse); + const [response] = await client.lookup(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.lookup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('lookup', () => { - it('invokes lookup without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.LookupRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.LookupResponse()); - client.innerApiCalls.lookup = stubSimpleCall(expectedResponse); - const [response] = await client.lookup(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.lookup as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes lookup without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.LookupRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.LookupResponse()); - client.innerApiCalls.lookup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.lookup( - request, - (err?: Error|null, result?: protos.google.datastore.v1.ILookupResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.lookup as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes lookup with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.LookupRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.lookup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookup(request), expectedError); - assert((client.innerApiCalls.lookup as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes lookup with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.LookupRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.lookup(request), expectedError); - }); + it('invokes lookup without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.LookupRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.LookupResponse() + ); + client.innerApiCalls.lookup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.lookup( + request, + ( + err?: Error | null, + result?: protos.google.datastore.v1.ILookupResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.lookup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('runQuery', () => { - it('invokes runQuery without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RunQueryRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RunQueryResponse()); - client.innerApiCalls.runQuery = stubSimpleCall(expectedResponse); - const [response] = await client.runQuery(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runQuery as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runQuery without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RunQueryRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RunQueryResponse()); - client.innerApiCalls.runQuery = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runQuery( - request, - (err?: Error|null, result?: protos.google.datastore.v1.IRunQueryResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runQuery as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes runQuery with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RunQueryRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runQuery = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runQuery(request), expectedError); - assert((client.innerApiCalls.runQuery as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runQuery with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RunQueryRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runQuery(request), expectedError); - }); + it('invokes lookup with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.LookupRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.lookup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.lookup(request), expectedError); + assert( + (client.innerApiCalls.lookup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('runAggregationQuery', () => { - it('invokes runAggregationQuery without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryResponse()); - client.innerApiCalls.runAggregationQuery = stubSimpleCall(expectedResponse); - const [response] = await client.runAggregationQuery(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runAggregationQuery as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runAggregationQuery without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryResponse()); - client.innerApiCalls.runAggregationQuery = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.runAggregationQuery( - request, - (err?: Error|null, result?: protos.google.datastore.v1.IRunAggregationQueryResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.runAggregationQuery as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes runAggregationQuery with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.runAggregationQuery = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runAggregationQuery(request), expectedError); - assert((client.innerApiCalls.runAggregationQuery as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes runAggregationQuery with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RunAggregationQueryRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.runAggregationQuery(request), expectedError); - }); + it('invokes lookup with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.LookupRequest() + ); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.lookup(request), expectedError); }); - - describe('beginTransaction', () => { - it('invokes beginTransaction without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionResponse()); - client.innerApiCalls.beginTransaction = stubSimpleCall(expectedResponse); - const [response] = await client.beginTransaction(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes beginTransaction without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionResponse()); - client.innerApiCalls.beginTransaction = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.beginTransaction( - request, - (err?: Error|null, result?: protos.google.datastore.v1.IBeginTransactionResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes beginTransaction with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.beginTransaction = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.beginTransaction(request), expectedError); - assert((client.innerApiCalls.beginTransaction as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes beginTransaction with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.BeginTransactionRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.beginTransaction(request), expectedError); - }); + }); + + describe('runQuery', () => { + it('invokes runQuery without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.RunQueryRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.RunQueryResponse() + ); + client.innerApiCalls.runQuery = stubSimpleCall(expectedResponse); + const [response] = await client.runQuery(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runQuery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('commit', () => { - it('invokes commit without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.CommitRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.CommitResponse()); - client.innerApiCalls.commit = stubSimpleCall(expectedResponse); - const [response] = await client.commit(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.commit as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes commit without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.CommitRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.CommitResponse()); - client.innerApiCalls.commit = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.commit( - request, - (err?: Error|null, result?: protos.google.datastore.v1.ICommitResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.commit as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes runQuery without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.RunQueryRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.RunQueryResponse() + ); + client.innerApiCalls.runQuery = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.runQuery( + request, + ( + err?: Error | null, + result?: protos.google.datastore.v1.IRunQueryResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.runQuery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes commit with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.CommitRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.commit = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.commit(request), expectedError); - assert((client.innerApiCalls.commit as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes runQuery with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.RunQueryRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.runQuery = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.runQuery(request), expectedError); + assert( + (client.innerApiCalls.runQuery as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes commit with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.CommitRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.commit(request), expectedError); - }); + it('invokes runQuery with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.RunQueryRequest() + ); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.runQuery(request), expectedError); + }); + }); + + describe('beginTransaction', () => { + it('invokes beginTransaction without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.BeginTransactionRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.BeginTransactionResponse() + ); + client.innerApiCalls.beginTransaction = stubSimpleCall(expectedResponse); + const [response] = await client.beginTransaction(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('rollback', () => { - it('invokes rollback without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RollbackRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RollbackResponse()); - client.innerApiCalls.rollback = stubSimpleCall(expectedResponse); - const [response] = await client.rollback(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.rollback as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes beginTransaction without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.BeginTransactionRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.BeginTransactionResponse() + ); + client.innerApiCalls.beginTransaction = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.beginTransaction( + request, + ( + err?: Error | null, + result?: protos.google.datastore.v1.IBeginTransactionResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes rollback without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RollbackRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.RollbackResponse()); - client.innerApiCalls.rollback = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.rollback( - request, - (err?: Error|null, result?: protos.google.datastore.v1.IRollbackResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.rollback as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes beginTransaction with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.BeginTransactionRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.beginTransaction = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.beginTransaction(request), expectedError); + assert( + (client.innerApiCalls.beginTransaction as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes rollback with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RollbackRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.rollback = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollback(request), expectedError); - assert((client.innerApiCalls.rollback as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes beginTransaction with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.BeginTransactionRequest() + ); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.beginTransaction(request), expectedError); + }); + }); + + describe('commit', () => { + it('invokes commit without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.CommitRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.CommitResponse() + ); + client.innerApiCalls.commit = stubSimpleCall(expectedResponse); + const [response] = await client.commit(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.commit as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes rollback with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.RollbackRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.rollback(request), expectedError); - }); + it('invokes commit without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.CommitRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.CommitResponse() + ); + client.innerApiCalls.commit = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.commit( + request, + ( + err?: Error | null, + result?: protos.google.datastore.v1.ICommitResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.commit as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('allocateIds', () => { - it('invokes allocateIds without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsResponse()); - client.innerApiCalls.allocateIds = stubSimpleCall(expectedResponse); - const [response] = await client.allocateIds(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.allocateIds as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes commit with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.CommitRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.commit = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.commit(request), expectedError); + assert( + (client.innerApiCalls.commit as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes allocateIds without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsResponse()); - client.innerApiCalls.allocateIds = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.allocateIds( - request, - (err?: Error|null, result?: protos.google.datastore.v1.IAllocateIdsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.allocateIds as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes commit with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.CommitRequest() + ); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.commit(request), expectedError); + }); + }); + + describe('rollback', () => { + it('invokes rollback without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.RollbackRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.RollbackResponse() + ); + client.innerApiCalls.rollback = stubSimpleCall(expectedResponse); + const [response] = await client.rollback(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.rollback as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes allocateIds with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.allocateIds = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.allocateIds(request), expectedError); - assert((client.innerApiCalls.allocateIds as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes rollback without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.RollbackRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.RollbackResponse() + ); + client.innerApiCalls.rollback = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rollback( + request, + ( + err?: Error | null, + result?: protos.google.datastore.v1.IRollbackResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.rollback as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes allocateIds with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.AllocateIdsRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.allocateIds(request), expectedError); - }); + it('invokes rollback with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.RollbackRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.rollback = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.rollback(request), expectedError); + assert( + (client.innerApiCalls.rollback as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('reserveIds', () => { - it('invokes reserveIds without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsResponse()); - client.innerApiCalls.reserveIds = stubSimpleCall(expectedResponse); - const [response] = await client.reserveIds(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.reserveIds as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes rollback with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.RollbackRequest() + ); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.rollback(request), expectedError); + }); + }); + + describe('allocateIds', () => { + it('invokes allocateIds without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.AllocateIdsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.AllocateIdsResponse() + ); + client.innerApiCalls.allocateIds = stubSimpleCall(expectedResponse); + const [response] = await client.allocateIds(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.allocateIds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes reserveIds without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsResponse()); - client.innerApiCalls.reserveIds = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.reserveIds( - request, - (err?: Error|null, result?: protos.google.datastore.v1.IReserveIdsResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.reserveIds as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes allocateIds without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.AllocateIdsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.AllocateIdsResponse() + ); + client.innerApiCalls.allocateIds = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.allocateIds( + request, + ( + err?: Error | null, + result?: protos.google.datastore.v1.IAllocateIdsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.allocateIds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes reserveIds with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsRequest()); - request.projectId = ''; - const expectedHeaderRequestParams = "project_id="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.reserveIds = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.reserveIds(request), expectedError); - assert((client.innerApiCalls.reserveIds as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes allocateIds with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.AllocateIdsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.allocateIds = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.allocateIds(request), expectedError); + assert( + (client.innerApiCalls.allocateIds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes reserveIds with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.datastore.v1.ReserveIdsRequest()); - request.projectId = ''; - const expectedError = new Error('The client has already been closed.'); - client.close(); - await assert.rejects(client.reserveIds(request), expectedError); - }); + it('invokes allocateIds with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.AllocateIdsRequest() + ); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.allocateIds(request), expectedError); }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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 datastoreModule.v1.DatastoreClient({ - 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); - } - }); - }); - 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 datastoreModule.v1.DatastoreClient({ - 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('reserveIds', () => { + it('invokes reserveIds without error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.ReserveIdsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.ReserveIdsResponse() + ); + client.innerApiCalls.reserveIds = stubSimpleCall(expectedResponse); + const [response] = await client.reserveIds(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.reserveIds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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 datastoreModule.v1.DatastoreClient({ - 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); - } - }); - }); - 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 datastoreModule.v1.DatastoreClient({ - 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)); - }); + + it('invokes reserveIds without error using callback', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.ReserveIdsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.datastore.v1.ReserveIdsResponse() + ); + client.innerApiCalls.reserveIds = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.reserveIds( + request, + ( + err?: Error | null, + result?: protos.google.datastore.v1.IReserveIdsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.reserveIds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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 datastoreModule.v1.DatastoreClient({ - 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); - } - }); - }); - 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 datastoreModule.v1.DatastoreClient({ - 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)); - }); + + it('invokes reserveIds with error', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.ReserveIdsRequest() + ); + request.projectId = ''; + const expectedHeaderRequestParams = 'project_id='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.reserveIds = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.reserveIds(request), expectedError); + assert( + (client.innerApiCalls.reserveIds as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - 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.ListOperationsResponse[] = []; - 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 datastoreModule.v1.DatastoreClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - 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.ListOperationsResponse[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.operationsClient.descriptor.listOperations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - }); + + it('invokes reserveIds with closed client', async () => { + const client = new datastoreModule.v1.DatastoreClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.datastore.v1.ReserveIdsRequest() + ); + request.projectId = ''; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.reserveIds(request), expectedError); }); + }); }); diff --git a/webpack.config.js b/webpack.config.js index ffb6e6cb7..f37985e35 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,7 +17,7 @@ const path = require('path'); module.exports = { entry: './src/index.ts', output: { - library: 'Datastore', + library: 'datastore', filename: './datastore.js', }, node: { @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From 5143df3cb46a6fc6b7537c6c1b6d8fc48d7f3f50 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 26 Aug 2022 14:49:54 -0400 Subject: [PATCH 26/67] Revert "protos generated" This reverts commit 1b21ec26e3e0ff5c3b1ff4679525fde92760c703. --- protos/protos.d.ts | 16352 +++++++------- protos/protos.js | 51249 ++++++++++++++++++++----------------------- protos/protos.json | 1551 +- 3 files changed, 32116 insertions(+), 37036 deletions(-) diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 2b49f5f1a..97c79d5ba 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -1,4832 +1,4572 @@ -import * as $protobuf from "protobufjs"; +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as Long from "long"; +import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a Struct. */ - interface IStruct { + /** Namespace datastore. */ + namespace datastore { - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } + /** Namespace admin. */ + namespace admin { - /** Represents a Struct. */ - class Struct implements IStruct { + /** Namespace v1. */ + namespace v1 { - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); + /** Represents a DatastoreAdmin */ + class DatastoreAdmin extends $protobuf.rpc.Service { - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; + /** + * Constructs a new DatastoreAdmin 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 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; + /** + * Creates new DatastoreAdmin 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): DatastoreAdmin; - /** - * 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; + /** + * Calls ExportEntities. + * @param request ExportEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportEntities(request: google.datastore.admin.v1.IExportEntitiesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ExportEntitiesCallback): void; - /** - * 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; + /** + * Calls ExportEntities. + * @param request ExportEntitiesRequest message or plain object + * @returns Promise + */ + public exportEntities(request: google.datastore.admin.v1.IExportEntitiesRequest): Promise; - /** - * 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; + /** + * Calls ImportEntities. + * @param request ImportEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importEntities(request: google.datastore.admin.v1.IImportEntitiesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ImportEntitiesCallback): void; - /** - * 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; + /** + * Calls ImportEntities. + * @param request ImportEntitiesRequest message or plain object + * @returns Promise + */ + public importEntities(request: google.datastore.admin.v1.IImportEntitiesRequest): Promise; - /** - * 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); + /** + * Calls CreateIndex. + * @param request CreateIndexRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createIndex(request: google.datastore.admin.v1.ICreateIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.CreateIndexCallback): void; - /** - * 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; + /** + * Calls CreateIndex. + * @param request CreateIndexRequest message or plain object + * @returns Promise + */ + public createIndex(request: google.datastore.admin.v1.ICreateIndexRequest): Promise; - /** - * 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 }; + /** + * Calls DeleteIndex. + * @param request DeleteIndexRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteIndex(request: google.datastore.admin.v1.IDeleteIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.DeleteIndexCallback): void; - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls DeleteIndex. + * @param request DeleteIndexRequest message or plain object + * @returns Promise + */ + public deleteIndex(request: google.datastore.admin.v1.IDeleteIndexRequest): Promise; - /** Properties of a Value. */ - interface IValue { + /** + * Calls GetIndex. + * @param request GetIndexRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Index + */ + public getIndex(request: google.datastore.admin.v1.IGetIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.GetIndexCallback): void; - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); + /** + * Calls GetIndex. + * @param request GetIndexRequest message or plain object + * @returns Promise + */ + public getIndex(request: google.datastore.admin.v1.IGetIndexRequest): Promise; - /** Value numberValue */ - numberValue?: (number|null); + /** + * Calls ListIndexes. + * @param request ListIndexesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListIndexesResponse + */ + public listIndexes(request: google.datastore.admin.v1.IListIndexesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ListIndexesCallback): void; - /** Value stringValue */ - stringValue?: (string|null); + /** + * Calls ListIndexes. + * @param request ListIndexesRequest message or plain object + * @returns Promise + */ + public listIndexes(request: google.datastore.admin.v1.IListIndexesRequest): Promise; + } - /** Value boolValue */ - boolValue?: (boolean|null); + namespace DatastoreAdmin { - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#exportEntities}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#importEntities}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** Represents a Value. */ - class Value implements IValue { + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#createIndex}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateIndexCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#deleteIndex}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteIndexCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|null); + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#getIndex}. + * @param error Error, if any + * @param [response] Index + */ + type GetIndexCallback = (error: (Error|null), response?: google.datastore.admin.v1.Index) => void; - /** Value numberValue. */ - public numberValue?: (number|null); + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#listIndexes}. + * @param error Error, if any + * @param [response] ListIndexesResponse + */ + type ListIndexesCallback = (error: (Error|null), response?: google.datastore.admin.v1.ListIndexesResponse) => void; + } - /** Value stringValue. */ - public stringValue?: (string|null); + /** Properties of a CommonMetadata. */ + interface ICommonMetadata { - /** Value boolValue. */ - public boolValue?: (boolean|null); + /** CommonMetadata startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); + /** CommonMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); + /** CommonMetadata operationType */ + operationType?: (google.datastore.admin.v1.OperationType|keyof typeof google.datastore.admin.v1.OperationType|null); - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); + /** CommonMetadata labels */ + labels?: ({ [k: string]: string }|null); - /** - * 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; + /** CommonMetadata state */ + state?: (google.datastore.admin.v1.CommonMetadata.State|keyof typeof google.datastore.admin.v1.CommonMetadata.State|null); + } - /** - * 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; + /** Represents a CommonMetadata. */ + class CommonMetadata implements ICommonMetadata { - /** - * 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; + /** + * Constructs a new CommonMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.ICommonMetadata); - /** - * 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; + /** CommonMetadata startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** - * 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); + /** CommonMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|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; + /** CommonMetadata operationType. */ + public operationType: (google.datastore.admin.v1.OperationType|keyof typeof google.datastore.admin.v1.OperationType); - /** - * 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 }; + /** CommonMetadata labels. */ + public labels: { [k: string]: string }; - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** CommonMetadata state. */ + public state: (google.datastore.admin.v1.CommonMetadata.State|keyof typeof google.datastore.admin.v1.CommonMetadata.State); - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } + /** + * Creates a new CommonMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.ICommonMetadata): google.datastore.admin.v1.CommonMetadata; - /** Properties of a ListValue. */ - interface IListValue { + /** + * Encodes the specified CommonMetadata message. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. + * @param message CommonMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.ICommonMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } + /** + * Encodes the specified CommonMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. + * @param message CommonMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.ICommonMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ListValue. */ - class ListValue implements IListValue { + /** + * Decodes a CommonMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.CommonMetadata; - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); + /** + * Decodes a CommonMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.CommonMetadata; - /** ListValue values. */ - public values: google.protobuf.IValue[]; + /** + * Verifies a CommonMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * 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; + /** + * Creates a CommonMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.CommonMetadata; - /** - * 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; + /** + * Creates a plain object from a CommonMetadata message. Also converts values to other types if specified. + * @param message CommonMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.CommonMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this CommonMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + namespace CommonMetadata { - /** - * 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; + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + INITIALIZING = 1, + PROCESSING = 2, + CANCELLING = 3, + FINALIZING = 4, + SUCCESSFUL = 5, + FAILED = 6, + CANCELLED = 7 + } + } - /** - * 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); + /** Properties of a Progress. */ + interface IProgress { - /** - * 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; + /** Progress workCompleted */ + workCompleted?: (number|Long|string|null); - /** - * 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 }; + /** Progress workEstimated */ + workEstimated?: (number|Long|string|null); + } - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a Progress. */ + class Progress implements IProgress { - /** Properties of a Timestamp. */ - interface ITimestamp { + /** + * Constructs a new Progress. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IProgress); - /** Timestamp seconds */ - seconds?: (number|Long|null); + /** Progress workCompleted. */ + public workCompleted: (number|Long|string); - /** Timestamp nanos */ - nanos?: (number|null); - } + /** Progress workEstimated. */ + public workEstimated: (number|Long|string); - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); + /** + * Creates a new Progress instance using the specified properties. + * @param [properties] Properties to set + * @returns Progress instance + */ + public static create(properties?: google.datastore.admin.v1.IProgress): google.datastore.admin.v1.Progress; - /** Timestamp seconds. */ - public seconds: (number|Long); + /** + * Encodes the specified Progress message. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; - /** Timestamp nanos. */ - public nanos: number; + /** + * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. + * @param message Progress message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a Progress message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Progress; - /** - * 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; + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Progress; - /** - * 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; + /** + * Verifies a Progress message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * 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; + /** + * Creates a Progress message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Progress + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Progress; - /** - * 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; + /** + * Creates a plain object from a Progress message. Also converts values to other types if specified. + * @param message Progress + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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); + /** + * Converts this Progress to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of an ExportEntitiesRequest. */ + interface IExportEntitiesRequest { - /** - * 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 }; + /** ExportEntitiesRequest projectId */ + projectId?: (string|null); - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ExportEntitiesRequest labels */ + labels?: ({ [k: string]: string }|null); - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { + /** ExportEntitiesRequest entityFilter */ + entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } + /** ExportEntitiesRequest outputUrlPrefix */ + outputUrlPrefix?: (string|null); + } - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { + /** Represents an ExportEntitiesRequest. */ + class ExportEntitiesRequest implements IExportEntitiesRequest { - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); + /** + * Constructs a new ExportEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IExportEntitiesRequest); - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; + /** ExportEntitiesRequest projectId. */ + public projectId: string; - /** - * 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; + /** ExportEntitiesRequest labels. */ + public labels: { [k: string]: string }; - /** - * 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; + /** ExportEntitiesRequest entityFilter. */ + public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** - * 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; + /** ExportEntitiesRequest outputUrlPrefix. */ + public outputUrlPrefix: string; - /** - * 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; + /** + * Creates a new ExportEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntitiesRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IExportEntitiesRequest): google.datastore.admin.v1.ExportEntitiesRequest; - /** - * 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; + /** + * Encodes the specified ExportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. + * @param message ExportEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IExportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Encodes the specified ExportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. + * @param message ExportEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes an ExportEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesRequest; - /** - * 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 }; + /** + * Decodes an ExportEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesRequest; - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies an ExportEntitiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { + /** + * Creates an ExportEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesRequest; - /** FileDescriptorProto name */ - name?: (string|null); + /** + * Creates a plain object from an ExportEntitiesRequest message. Also converts values to other types if specified. + * @param message ExportEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ExportEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileDescriptorProto package */ - "package"?: (string|null); + /** + * Converts this ExportEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); + /** Properties of an ImportEntitiesRequest. */ + interface IImportEntitiesRequest { - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); + /** ImportEntitiesRequest projectId */ + projectId?: (string|null); - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); + /** ImportEntitiesRequest labels */ + labels?: ({ [k: string]: string }|null); - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); + /** ImportEntitiesRequest inputUrl */ + inputUrl?: (string|null); - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** ImportEntitiesRequest entityFilter */ + entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + } - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); + /** Represents an ImportEntitiesRequest. */ + class ImportEntitiesRequest implements IImportEntitiesRequest { - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** + * Constructs a new ImportEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IImportEntitiesRequest); - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); + /** ImportEntitiesRequest projectId. */ + public projectId: string; - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** ImportEntitiesRequest labels. */ + public labels: { [k: string]: string }; - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } + /** ImportEntitiesRequest inputUrl. */ + public inputUrl: string; - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { + /** ImportEntitiesRequest entityFilter. */ + public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); + /** + * Creates a new ImportEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntitiesRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IImportEntitiesRequest): google.datastore.admin.v1.ImportEntitiesRequest; - /** FileDescriptorProto name. */ - public name: string; + /** + * Encodes the specified ImportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. + * @param message ImportEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IImportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto package. */ - public package: string; + /** + * Encodes the specified ImportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. + * @param message ImportEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IImportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileDescriptorProto dependency. */ - public dependency: string[]; + /** + * Decodes an ImportEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ImportEntitiesRequest; - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; + /** + * Decodes an ImportEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ImportEntitiesRequest; - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; + /** + * Verifies an ImportEntitiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; + /** + * Creates an ImportEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ImportEntitiesRequest; - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** + * Creates a plain object from an ImportEntitiesRequest message. Also converts values to other types if specified. + * @param message ImportEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ImportEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; + /** + * Converts this ImportEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** Properties of an ExportEntitiesResponse. */ + interface IExportEntitiesResponse { - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); + /** ExportEntitiesResponse outputUrl */ + outputUrl?: (string|null); + } - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + /** Represents an ExportEntitiesResponse. */ + class ExportEntitiesResponse implements IExportEntitiesResponse { - /** FileDescriptorProto syntax. */ - public syntax: string; + /** + * Constructs a new ExportEntitiesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IExportEntitiesResponse); - /** - * 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; + /** ExportEntitiesResponse outputUrl. */ + public outputUrl: string; - /** - * 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; + /** + * Creates a new ExportEntitiesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntitiesResponse instance + */ + public static create(properties?: google.datastore.admin.v1.IExportEntitiesResponse): google.datastore.admin.v1.ExportEntitiesResponse; - /** - * 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; + /** + * Encodes the specified ExportEntitiesResponse message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. + * @param message ExportEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IExportEntitiesResponse, 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; + /** + * Encodes the specified ExportEntitiesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. + * @param message ExportEntitiesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes an ExportEntitiesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesResponse; - /** - * 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); + /** + * Decodes an ExportEntitiesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesResponse; - /** - * 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; + /** + * Verifies an ExportEntitiesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from 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 }; + /** + * Creates an ExportEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntitiesResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesResponse; - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from an ExportEntitiesResponse message. Also converts values to other types if specified. + * @param message ExportEntitiesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ExportEntitiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { + /** + * Converts this ExportEntitiesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** DescriptorProto name */ - name?: (string|null); + /** Properties of an ExportEntitiesMetadata. */ + interface IExportEntitiesMetadata { - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); + /** ExportEntitiesMetadata common */ + common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); + /** ExportEntitiesMetadata progressEntities */ + progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); + /** ExportEntitiesMetadata progressBytes */ + progressBytes?: (google.datastore.admin.v1.IProgress|null); - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + /** ExportEntitiesMetadata entityFilter */ + entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + /** ExportEntitiesMetadata outputUrlPrefix */ + outputUrlPrefix?: (string|null); + } - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + /** Represents an ExportEntitiesMetadata. */ + class ExportEntitiesMetadata implements IExportEntitiesMetadata { - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); + /** + * Constructs a new ExportEntitiesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IExportEntitiesMetadata); - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + /** ExportEntitiesMetadata common. */ + public common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } + /** ExportEntitiesMetadata progressEntities. */ + public progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { + /** ExportEntitiesMetadata progressBytes. */ + public progressBytes?: (google.datastore.admin.v1.IProgress|null); - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); + /** ExportEntitiesMetadata entityFilter. */ + public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** DescriptorProto name. */ - public name: string; + /** ExportEntitiesMetadata outputUrlPrefix. */ + public outputUrlPrefix: string; - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; + /** + * Creates a new ExportEntitiesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEntitiesMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.IExportEntitiesMetadata): google.datastore.admin.v1.ExportEntitiesMetadata; - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; + /** + * Encodes the specified ExportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. + * @param message ExportEntitiesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IExportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; + /** + * Encodes the specified ExportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. + * @param message ExportEntitiesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; + /** + * Decodes an ExportEntitiesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesMetadata; - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + /** + * Decodes an ExportEntitiesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesMetadata; - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + /** + * Verifies an ExportEntitiesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); + /** + * Creates an ExportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEntitiesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesMetadata; - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + /** + * Creates a plain object from an ExportEntitiesMetadata message. Also converts values to other types if specified. + * @param message ExportEntitiesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ExportEntitiesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DescriptorProto reservedName. */ - public reservedName: string[]; + /** + * Converts this ExportEntitiesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of an ImportEntitiesMetadata. */ + interface IImportEntitiesMetadata { - /** - * 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; + /** ImportEntitiesMetadata common */ + common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** - * 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; + /** ImportEntitiesMetadata progressEntities */ + progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** - * 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; + /** ImportEntitiesMetadata progressBytes */ + progressBytes?: (google.datastore.admin.v1.IProgress|null); - /** - * 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; + /** ImportEntitiesMetadata entityFilter */ + entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** - * 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); + /** ImportEntitiesMetadata inputUrl */ + inputUrl?: (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; + /** Represents an ImportEntitiesMetadata. */ + class ImportEntitiesMetadata implements IImportEntitiesMetadata { - /** - * 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 }; + /** + * Constructs a new ImportEntitiesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IImportEntitiesMetadata); - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ImportEntitiesMetadata common. */ + public common?: (google.datastore.admin.v1.ICommonMetadata|null); - namespace DescriptorProto { + /** ImportEntitiesMetadata progressEntities. */ + public progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** Properties of an ExtensionRange. */ - interface IExtensionRange { + /** ImportEntitiesMetadata progressBytes. */ + public progressBytes?: (google.datastore.admin.v1.IProgress|null); - /** ExtensionRange start */ - start?: (number|null); + /** ImportEntitiesMetadata entityFilter. */ + public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - /** ExtensionRange end */ - end?: (number|null); + /** ImportEntitiesMetadata inputUrl. */ + public inputUrl: string; - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } + /** + * Creates a new ImportEntitiesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportEntitiesMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.IImportEntitiesMetadata): google.datastore.admin.v1.ImportEntitiesMetadata; - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { + /** + * Encodes the specified ImportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. + * @param message ImportEntitiesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IImportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + /** + * Encodes the specified ImportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. + * @param message ImportEntitiesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IImportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** ExtensionRange start. */ - public start: number; + /** + * Decodes an ImportEntitiesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ImportEntitiesMetadata; - /** ExtensionRange end. */ - public end: number; + /** + * Decodes an ImportEntitiesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ImportEntitiesMetadata; - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); + /** + * Verifies an ImportEntitiesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|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; + /** + * Creates an ImportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportEntitiesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ImportEntitiesMetadata; - /** - * 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; + /** + * Creates a plain object from an ImportEntitiesMetadata message. Also converts values to other types if specified. + * @param message ImportEntitiesMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ImportEntitiesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this ImportEntitiesMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of an EntityFilter. */ + interface IEntityFilter { - /** - * 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; + /** EntityFilter kinds */ + kinds?: (string[]|null); - /** - * 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); + /** EntityFilter namespaceIds */ + namespaceIds?: (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; + /** Represents an EntityFilter. */ + class EntityFilter implements IEntityFilter { - /** - * 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 }; + /** + * Constructs a new EntityFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IEntityFilter); - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** EntityFilter kinds. */ + public kinds: string[]; - /** Properties of a ReservedRange. */ - interface IReservedRange { + /** EntityFilter namespaceIds. */ + public namespaceIds: string[]; - /** ReservedRange start */ - start?: (number|null); + /** + * Creates a new EntityFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityFilter instance + */ + public static create(properties?: google.datastore.admin.v1.IEntityFilter): google.datastore.admin.v1.EntityFilter; - /** ReservedRange end */ - end?: (number|null); - } + /** + * Encodes the specified EntityFilter message. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. + * @param message EntityFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IEntityFilter, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { + /** + * Encodes the specified EntityFilter message, length delimited. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. + * @param message EntityFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IEntityFilter, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + /** + * Decodes an EntityFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.EntityFilter; - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; + /** + * Decodes an EntityFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.EntityFilter; - /** - * 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; + /** + * Verifies an EntityFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified 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; + /** + * Creates an EntityFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityFilter + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.EntityFilter; - /** - * 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; + /** + * Creates a plain object from an EntityFilter message. Also converts values to other types if specified. + * @param message EntityFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.EntityFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this EntityFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a CreateIndexRequest. */ + interface ICreateIndexRequest { - /** - * 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); + /** CreateIndexRequest projectId */ + projectId?: (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; + /** CreateIndexRequest index */ + index?: (google.datastore.admin.v1.IIndex|null); + } - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a CreateIndexRequest. */ + class CreateIndexRequest implements ICreateIndexRequest { - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Constructs a new CreateIndexRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.ICreateIndexRequest); - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { + /** CreateIndexRequest projectId. */ + public projectId: string; - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** CreateIndexRequest index. */ + public index?: (google.datastore.admin.v1.IIndex|null); - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { + /** + * Creates a new CreateIndexRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateIndexRequest instance + */ + public static create(properties?: google.datastore.admin.v1.ICreateIndexRequest): google.datastore.admin.v1.CreateIndexRequest; - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); + /** + * Encodes the specified CreateIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. + * @param message CreateIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.ICreateIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Encodes the specified CreateIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. + * @param message CreateIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.ICreateIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a CreateIndexRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.CreateIndexRequest; - /** - * 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; + /** + * Decodes a CreateIndexRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.CreateIndexRequest; - /** - * 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; + /** + * Verifies a CreateIndexRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes 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; + /** + * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateIndexRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.CreateIndexRequest; - /** - * 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; + /** + * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. + * @param message CreateIndexRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.CreateIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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); + /** + * Converts this CreateIndexRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a DeleteIndexRequest. */ + interface IDeleteIndexRequest { - /** - * 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 }; + /** DeleteIndexRequest projectId */ + projectId?: (string|null); - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** DeleteIndexRequest indexId */ + indexId?: (string|null); + } - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { + /** Represents a DeleteIndexRequest. */ + class DeleteIndexRequest implements IDeleteIndexRequest { - /** FieldDescriptorProto name */ - name?: (string|null); + /** + * Constructs a new DeleteIndexRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IDeleteIndexRequest); - /** FieldDescriptorProto number */ - number?: (number|null); + /** DeleteIndexRequest projectId. */ + public projectId: string; - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); + /** DeleteIndexRequest indexId. */ + public indexId: string; - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); + /** + * Creates a new DeleteIndexRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteIndexRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IDeleteIndexRequest): google.datastore.admin.v1.DeleteIndexRequest; - /** FieldDescriptorProto typeName */ - typeName?: (string|null); + /** + * Encodes the specified DeleteIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. + * @param message DeleteIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IDeleteIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldDescriptorProto extendee */ - extendee?: (string|null); + /** + * Encodes the specified DeleteIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. + * @param message DeleteIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IDeleteIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); + /** + * Decodes a DeleteIndexRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.DeleteIndexRequest; - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); + /** + * Decodes a DeleteIndexRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.DeleteIndexRequest; - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); + /** + * Verifies a DeleteIndexRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); + /** + * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteIndexRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.DeleteIndexRequest; - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } + /** + * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. + * @param message DeleteIndexRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.DeleteIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { + /** + * Converts this DeleteIndexRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); + /** Properties of a GetIndexRequest. */ + interface IGetIndexRequest { - /** FieldDescriptorProto name. */ - public name: string; + /** GetIndexRequest projectId */ + projectId?: (string|null); - /** FieldDescriptorProto number. */ - public number: number; + /** GetIndexRequest indexId */ + indexId?: (string|null); + } - /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; + /** Represents a GetIndexRequest. */ + class GetIndexRequest implements IGetIndexRequest { - /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; + /** + * Constructs a new GetIndexRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IGetIndexRequest); - /** FieldDescriptorProto typeName. */ - public typeName: string; + /** GetIndexRequest projectId. */ + public projectId: string; - /** FieldDescriptorProto extendee. */ - public extendee: string; + /** GetIndexRequest indexId. */ + public indexId: string; - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; + /** + * Creates a new GetIndexRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetIndexRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IGetIndexRequest): google.datastore.admin.v1.GetIndexRequest; - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; + /** + * Encodes the specified GetIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. + * @param message GetIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IGetIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldDescriptorProto jsonName. */ - public jsonName: string; + /** + * Encodes the specified GetIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. + * @param message GetIndexRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IGetIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); + /** + * Decodes a GetIndexRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.GetIndexRequest; - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; + /** + * Decodes a GetIndexRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.GetIndexRequest; - /** - * 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; + /** + * Verifies a GetIndexRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified 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; + /** + * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetIndexRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.GetIndexRequest; - /** - * 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; + /** + * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. + * @param message GetIndexRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.GetIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this GetIndexRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a ListIndexesRequest. */ + interface IListIndexesRequest { - /** - * 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); + /** ListIndexesRequest projectId */ + projectId?: (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; + /** ListIndexesRequest filter */ + filter?: (string|null); - /** - * 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 }; + /** ListIndexesRequest pageSize */ + pageSize?: (number|null); - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListIndexesRequest pageToken */ + pageToken?: (string|null); + } - namespace FieldDescriptorProto { + /** Represents a ListIndexesRequest. */ + class ListIndexesRequest implements IListIndexesRequest { - /** 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 - } + /** + * Constructs a new ListIndexesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IListIndexesRequest); - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } + /** ListIndexesRequest projectId. */ + public projectId: string; - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { + /** ListIndexesRequest filter. */ + public filter: string; - /** OneofDescriptorProto name */ - name?: (string|null); + /** ListIndexesRequest pageSize. */ + public pageSize: number; - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } + /** ListIndexesRequest pageToken. */ + public pageToken: string; - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { + /** + * Creates a new ListIndexesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIndexesRequest instance + */ + public static create(properties?: google.datastore.admin.v1.IListIndexesRequest): google.datastore.admin.v1.ListIndexesRequest; - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); + /** + * Encodes the specified ListIndexesRequest message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. + * @param message ListIndexesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IListIndexesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** OneofDescriptorProto name. */ - public name: string; + /** + * Encodes the specified ListIndexesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. + * @param message ListIndexesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IListIndexesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); + /** + * Decodes a ListIndexesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIndexesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ListIndexesRequest; - /** - * 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; + /** + * Decodes a ListIndexesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIndexesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ListIndexesRequest; - /** - * 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; + /** + * Verifies a ListIndexesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified 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; + /** + * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIndexesRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ListIndexesRequest; - /** - * 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; + /** + * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. + * @param message ListIndexesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ListIndexesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this ListIndexesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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); + /** Properties of a ListIndexesResponse. */ + interface IListIndexesResponse { - /** - * 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; + /** ListIndexesResponse indexes */ + indexes?: (google.datastore.admin.v1.IIndex[]|null); - /** - * 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 }; + /** ListIndexesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a ListIndexesResponse. */ + class ListIndexesResponse implements IListIndexesResponse { - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { + /** + * Constructs a new ListIndexesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IListIndexesResponse); - /** EnumDescriptorProto name */ - name?: (string|null); + /** ListIndexesResponse indexes. */ + public indexes: google.datastore.admin.v1.IIndex[]; - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + /** ListIndexesResponse nextPageToken. */ + public nextPageToken: string; - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); + /** + * Creates a new ListIndexesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListIndexesResponse instance + */ + public static create(properties?: google.datastore.admin.v1.IListIndexesResponse): google.datastore.admin.v1.ListIndexesResponse; - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + /** + * Encodes the specified ListIndexesResponse message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. + * @param message ListIndexesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IListIndexesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } + /** + * Encodes the specified ListIndexesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. + * @param message ListIndexesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IListIndexesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { + /** + * Decodes a ListIndexesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListIndexesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ListIndexesResponse; - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); + /** + * Decodes a ListIndexesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListIndexesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ListIndexesResponse; - /** EnumDescriptorProto name. */ - public name: string; + /** + * Verifies a ListIndexesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; + /** + * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListIndexesResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ListIndexesResponse; - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); + /** + * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. + * @param message ListIndexesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.ListIndexesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + /** + * Converts this ListIndexesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; + /** Properties of an IndexOperationMetadata. */ + interface IIndexOperationMetadata { - /** - * 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; + /** IndexOperationMetadata common */ + common?: (google.datastore.admin.v1.ICommonMetadata|null); - /** - * 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; + /** IndexOperationMetadata progressEntities */ + progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** - * 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; + /** IndexOperationMetadata indexId */ + indexId?: (string|null); + } - /** - * 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; + /** Represents an IndexOperationMetadata. */ + class IndexOperationMetadata implements IIndexOperationMetadata { - /** - * 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; + /** + * Constructs a new IndexOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IIndexOperationMetadata); - /** - * 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); + /** IndexOperationMetadata common. */ + public common?: (google.datastore.admin.v1.ICommonMetadata|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; + /** IndexOperationMetadata progressEntities. */ + public progressEntities?: (google.datastore.admin.v1.IProgress|null); - /** - * 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 }; + /** IndexOperationMetadata indexId. */ + public indexId: string; - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new IndexOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexOperationMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.IIndexOperationMetadata): google.datastore.admin.v1.IndexOperationMetadata; - namespace EnumDescriptorProto { + /** + * Encodes the specified IndexOperationMetadata message. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. + * @param message IndexOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IIndexOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { + /** + * Encodes the specified IndexOperationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. + * @param message IndexOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IIndexOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumReservedRange start */ - start?: (number|null); + /** + * Decodes an IndexOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.IndexOperationMetadata; - /** EnumReservedRange end */ - end?: (number|null); - } + /** + * Decodes an IndexOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.IndexOperationMetadata; - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { + /** + * Verifies an IndexOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + /** + * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.IndexOperationMetadata; - /** EnumReservedRange start. */ - public start: number; + /** + * Creates a plain object from an IndexOperationMetadata message. Also converts values to other types if specified. + * @param message IndexOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.IndexOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnumReservedRange end. */ - public end: number; + /** + * Converts this IndexOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a DatastoreFirestoreMigrationMetadata. */ + interface IDatastoreFirestoreMigrationMetadata { - /** - * 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; + /** DatastoreFirestoreMigrationMetadata migrationState */ + migrationState?: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState|null); - /** - * 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; + /** DatastoreFirestoreMigrationMetadata migrationStep */ + migrationStep?: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep|null); + } - /** - * 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; + /** Represents a DatastoreFirestoreMigrationMetadata. */ + class DatastoreFirestoreMigrationMetadata implements IDatastoreFirestoreMigrationMetadata { - /** - * 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); + /** + * Constructs a new DatastoreFirestoreMigrationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata); - /** - * 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; + /** DatastoreFirestoreMigrationMetadata migrationState. */ + public migrationState: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState); - /** - * 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 }; + /** DatastoreFirestoreMigrationMetadata migrationStep. */ + public migrationStep: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep); - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Creates a new DatastoreFirestoreMigrationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DatastoreFirestoreMigrationMetadata instance + */ + public static create(properties?: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { + /** + * Encodes the specified DatastoreFirestoreMigrationMetadata message. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. + * @param message DatastoreFirestoreMigrationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumValueDescriptorProto name */ - name?: (string|null); + /** + * Encodes the specified DatastoreFirestoreMigrationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. + * @param message DatastoreFirestoreMigrationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** EnumValueDescriptorProto number */ - number?: (number|null); + /** + * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DatastoreFirestoreMigrationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } + /** + * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DatastoreFirestoreMigrationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + /** + * Verifies a DatastoreFirestoreMigrationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + /** + * Creates a DatastoreFirestoreMigrationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DatastoreFirestoreMigrationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; - /** EnumValueDescriptorProto name. */ - public name: string; + /** + * Creates a plain object from a DatastoreFirestoreMigrationMetadata message. Also converts values to other types if specified. + * @param message DatastoreFirestoreMigrationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EnumValueDescriptorProto number. */ - public number: number; + /** + * Converts this DatastoreFirestoreMigrationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); + /** OperationType enum. */ + enum OperationType { + OPERATION_TYPE_UNSPECIFIED = 0, + EXPORT_ENTITIES = 1, + IMPORT_ENTITIES = 2, + CREATE_INDEX = 3, + DELETE_INDEX = 4 + } - /** - * 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; + /** Properties of an Index. */ + interface IIndex { - /** - * 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; + /** Index projectId */ + projectId?: (string|null); - /** - * 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; + /** Index indexId */ + indexId?: (string|null); - /** - * 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; + /** Index kind */ + kind?: (string|null); - /** - * 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; + /** Index ancestor */ + ancestor?: (google.datastore.admin.v1.Index.AncestorMode|keyof typeof google.datastore.admin.v1.Index.AncestorMode|null); - /** - * 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); + /** Index properties */ + properties?: (google.datastore.admin.v1.Index.IIndexedProperty[]|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; + /** Index state */ + state?: (google.datastore.admin.v1.Index.State|keyof typeof google.datastore.admin.v1.Index.State|null); + } - /** - * 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 }; + /** Represents an Index. */ + class Index implements IIndex { - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new Index. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IIndex); - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { + /** Index projectId. */ + public projectId: string; - /** ServiceDescriptorProto name */ - name?: (string|null); + /** Index indexId. */ + public indexId: string; - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); + /** Index kind. */ + public kind: string; - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } + /** Index ancestor. */ + public ancestor: (google.datastore.admin.v1.Index.AncestorMode|keyof typeof google.datastore.admin.v1.Index.AncestorMode); - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { + /** Index properties. */ + public properties: google.datastore.admin.v1.Index.IIndexedProperty[]; - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); + /** Index state. */ + public state: (google.datastore.admin.v1.Index.State|keyof typeof google.datastore.admin.v1.Index.State); - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; + /** + * Creates a new Index instance using the specified properties. + * @param [properties] Properties to set + * @returns Index instance + */ + public static create(properties?: google.datastore.admin.v1.IIndex): google.datastore.admin.v1.Index; - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); + /** + * Encodes the specified Index message. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. + * @param message Index message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IIndex, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 Index message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. + * @param message Index message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IIndex, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes an Index message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Index + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Index; - /** - * 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 an Index message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Index + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Index; - /** - * 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; + /** + * Verifies an Index message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a 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; + /** + * Creates an Index message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Index + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Index; - /** - * 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 plain object from an Index message. Also converts values to other types if specified. + * @param message Index + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.Index, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this Index to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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 }; + namespace Index { - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** AncestorMode enum. */ + enum AncestorMode { + ANCESTOR_MODE_UNSPECIFIED = 0, + NONE = 1, + ALL_ANCESTORS = 2 + } - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { + /** Direction enum. */ + enum Direction { + DIRECTION_UNSPECIFIED = 0, + ASCENDING = 1, + DESCENDING = 2 + } - /** MethodDescriptorProto name */ - name?: (string|null); + /** Properties of an IndexedProperty. */ + interface IIndexedProperty { - /** MethodDescriptorProto inputType */ - inputType?: (string|null); + /** IndexedProperty name */ + name?: (string|null); - /** MethodDescriptorProto outputType */ - outputType?: (string|null); + /** IndexedProperty direction */ + direction?: (google.datastore.admin.v1.Index.Direction|keyof typeof google.datastore.admin.v1.Index.Direction|null); + } - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); + /** Represents an IndexedProperty. */ + class IndexedProperty implements IIndexedProperty { - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); + /** + * Constructs a new IndexedProperty. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.Index.IIndexedProperty); - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } + /** IndexedProperty name. */ + public name: string; - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { + /** IndexedProperty direction. */ + public direction: (google.datastore.admin.v1.Index.Direction|keyof typeof google.datastore.admin.v1.Index.Direction); - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); + /** + * Creates a new IndexedProperty instance using the specified properties. + * @param [properties] Properties to set + * @returns IndexedProperty instance + */ + public static create(properties?: google.datastore.admin.v1.Index.IIndexedProperty): google.datastore.admin.v1.Index.IndexedProperty; - /** MethodDescriptorProto name. */ - public name: string; + /** + * Encodes the specified IndexedProperty message. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. + * @param message IndexedProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.Index.IIndexedProperty, writer?: $protobuf.Writer): $protobuf.Writer; - /** MethodDescriptorProto inputType. */ - public inputType: string; + /** + * Encodes the specified IndexedProperty message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. + * @param message IndexedProperty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.Index.IIndexedProperty, writer?: $protobuf.Writer): $protobuf.Writer; - /** MethodDescriptorProto outputType. */ - public outputType: string; + /** + * Decodes an IndexedProperty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IndexedProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Index.IndexedProperty; - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); + /** + * Decodes an IndexedProperty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IndexedProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Index.IndexedProperty; - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; + /** + * Verifies an IndexedProperty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; + /** + * Creates an IndexedProperty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IndexedProperty + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Index.IndexedProperty; - /** - * 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; + /** + * Creates a plain object from an IndexedProperty message. Also converts values to other types if specified. + * @param message IndexedProperty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.Index.IndexedProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this IndexedProperty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + DELETING = 3, + ERROR = 4 + } + } - /** - * 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; + /** Properties of a MigrationStateEvent. */ + interface IMigrationStateEvent { - /** - * 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; + /** MigrationStateEvent state */ + state?: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState|null); + } - /** - * 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); + /** Represents a MigrationStateEvent. */ + class MigrationStateEvent implements IMigrationStateEvent { - /** - * 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; + /** + * Constructs a new MigrationStateEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IMigrationStateEvent); - /** - * 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 }; + /** MigrationStateEvent state. */ + public state: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState); - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new MigrationStateEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationStateEvent instance + */ + public static create(properties?: google.datastore.admin.v1.IMigrationStateEvent): google.datastore.admin.v1.MigrationStateEvent; - /** Properties of a FileOptions. */ - interface IFileOptions { + /** + * Encodes the specified MigrationStateEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. + * @param message MigrationStateEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IMigrationStateEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions javaPackage */ - javaPackage?: (string|null); + /** + * Encodes the specified MigrationStateEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. + * @param message MigrationStateEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IMigrationStateEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); + /** + * Decodes a MigrationStateEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationStateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationStateEvent; - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); + /** + * Decodes a MigrationStateEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationStateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationStateEvent; - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); + /** + * Verifies a MigrationStateEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); + /** + * Creates a MigrationStateEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationStateEvent + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationStateEvent; - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + /** + * Creates a plain object from a MigrationStateEvent message. Also converts values to other types if specified. + * @param message MigrationStateEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.MigrationStateEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileOptions goPackage */ - goPackage?: (string|null); + /** + * Converts this MigrationStateEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); + /** Properties of a MigrationProgressEvent. */ + interface IMigrationProgressEvent { - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); + /** MigrationProgressEvent step */ + step?: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep|null); - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); + /** MigrationProgressEvent prepareStepDetails */ + prepareStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null); - /** FileOptions phpGenericServices */ - phpGenericServices?: (boolean|null); + /** MigrationProgressEvent redirectWritesStepDetails */ + redirectWritesStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null); + } - /** FileOptions deprecated */ - deprecated?: (boolean|null); + /** Represents a MigrationProgressEvent. */ + class MigrationProgressEvent implements IMigrationProgressEvent { - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); + /** + * Constructs a new MigrationProgressEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.IMigrationProgressEvent); - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); + /** MigrationProgressEvent step. */ + public step: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep); - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); + /** MigrationProgressEvent prepareStepDetails. */ + public prepareStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null); - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); + /** MigrationProgressEvent redirectWritesStepDetails. */ + public redirectWritesStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null); - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); + /** MigrationProgressEvent stepDetails. */ + public stepDetails?: ("prepareStepDetails"|"redirectWritesStepDetails"); - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); + /** + * Creates a new MigrationProgressEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns MigrationProgressEvent instance + */ + public static create(properties?: google.datastore.admin.v1.IMigrationProgressEvent): google.datastore.admin.v1.MigrationProgressEvent; - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); + /** + * Encodes the specified MigrationProgressEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. + * @param message MigrationProgressEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.IMigrationProgressEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); + /** + * Encodes the specified MigrationProgressEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. + * @param message MigrationProgressEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.IMigrationProgressEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Decodes a MigrationProgressEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MigrationProgressEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent; - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } + /** + * Decodes a MigrationProgressEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MigrationProgressEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent; - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { + /** + * Verifies a MigrationProgressEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; + /** + * Creates a MigrationProgressEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MigrationProgressEvent + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent; - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; + /** + * Creates a plain object from a MigrationProgressEvent message. Also converts values to other types if specified. + * @param message MigrationProgressEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; + /** + * Converts this MigrationProgressEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; + namespace MigrationProgressEvent { - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; + /** ConcurrencyMode enum. */ + enum ConcurrencyMode { + CONCURRENCY_MODE_UNSPECIFIED = 0, + PESSIMISTIC = 1, + OPTIMISTIC = 2, + OPTIMISTIC_WITH_ENTITY_GROUPS = 3 + } - /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + /** Properties of a PrepareStepDetails. */ + interface IPrepareStepDetails { - /** FileOptions goPackage. */ - public goPackage: string; + /** PrepareStepDetails concurrencyMode */ + concurrencyMode?: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|keyof typeof google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null); + } - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; + /** Represents a PrepareStepDetails. */ + class PrepareStepDetails implements IPrepareStepDetails { - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; + /** + * Constructs a new PrepareStepDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails); - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; + /** PrepareStepDetails concurrencyMode. */ + public concurrencyMode: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|keyof typeof google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode); - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; + /** + * Creates a new PrepareStepDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns PrepareStepDetails instance + */ + public static create(properties?: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - /** FileOptions deprecated. */ - public deprecated: boolean; + /** + * Encodes the specified PrepareStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. + * @param message PrepareStepDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; + /** + * Encodes the specified PrepareStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. + * @param message PrepareStepDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; + /** + * Decodes a PrepareStepDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrepareStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; + /** + * Decodes a PrepareStepDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrepareStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; + /** + * Verifies a PrepareStepDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; + /** + * Creates a PrepareStepDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrepareStepDetails + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - /** FileOptions phpNamespace. */ - public phpNamespace: string; + /** + * Creates a plain object from a PrepareStepDetails message. Also converts values to other types if specified. + * @param message PrepareStepDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; + /** + * Converts this PrepareStepDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** FileOptions rubyPackage. */ - public rubyPackage: string; + /** Properties of a RedirectWritesStepDetails. */ + interface IRedirectWritesStepDetails { - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** RedirectWritesStepDetails concurrencyMode */ + concurrencyMode?: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|keyof typeof google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null); + } - /** - * 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; + /** Represents a RedirectWritesStepDetails. */ + class RedirectWritesStepDetails implements IRedirectWritesStepDetails { - /** - * 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; + /** + * Constructs a new RedirectWritesStepDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails); - /** - * 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; + /** RedirectWritesStepDetails concurrencyMode. */ + public concurrencyMode: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|keyof typeof google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode); - /** - * 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; + /** + * Creates a new RedirectWritesStepDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns RedirectWritesStepDetails instance + */ + public static create(properties?: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - /** - * 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; + /** + * Encodes the specified RedirectWritesStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. + * @param message RedirectWritesStepDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Encodes the specified RedirectWritesStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. + * @param message RedirectWritesStepDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Decodes a RedirectWritesStepDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RedirectWritesStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - /** - * 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 }; + /** + * Decodes a RedirectWritesStepDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RedirectWritesStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a RedirectWritesStepDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - namespace FileOptions { + /** + * Creates a RedirectWritesStepDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RedirectWritesStepDetails + */ + public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 + /** + * Creates a plain object from a RedirectWritesStepDetails message. Also converts values to other types if specified. + * @param message RedirectWritesStepDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RedirectWritesStepDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** MigrationState enum. */ + enum MigrationState { + MIGRATION_STATE_UNSPECIFIED = 0, + RUNNING = 1, + PAUSED = 2, + COMPLETE = 3 + } + + /** MigrationStep enum. */ + enum MigrationStep { + MIGRATION_STEP_UNSPECIFIED = 0, + PREPARE = 6, + START = 1, + APPLY_WRITES_SYNCHRONOUSLY = 7, + COPY_AND_VERIFY = 2, + REDIRECT_EVENTUALLY_CONSISTENT_READS = 3, + REDIRECT_STRONGLY_CONSISTENT_READS = 4, + REDIRECT_WRITES = 5 + } } } - /** Properties of a MessageOptions. */ - interface IMessageOptions { + /** Namespace v1. */ + namespace v1 { - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); + /** Represents a Datastore */ + class Datastore extends $protobuf.rpc.Service { - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); + /** + * Constructs a new Datastore 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); - /** MessageOptions deprecated */ - deprecated?: (boolean|null); + /** + * Creates new Datastore 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): Datastore; - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); + /** + * Calls Lookup. + * @param request LookupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and LookupResponse + */ + public lookup(request: google.datastore.v1.ILookupRequest, callback: google.datastore.v1.Datastore.LookupCallback): void; - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Calls Lookup. + * @param request LookupRequest message or plain object + * @returns Promise + */ + public lookup(request: google.datastore.v1.ILookupRequest): Promise; - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } + /** + * Calls RunQuery. + * @param request RunQueryRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RunQueryResponse + */ + public runQuery(request: google.datastore.v1.IRunQueryRequest, callback: google.datastore.v1.Datastore.RunQueryCallback): void; - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { + /** + * Calls RunQuery. + * @param request RunQueryRequest message or plain object + * @returns Promise + */ + public runQuery(request: google.datastore.v1.IRunQueryRequest): Promise; - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); + /** + * Calls BeginTransaction. + * @param request BeginTransactionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BeginTransactionResponse + */ + public beginTransaction(request: google.datastore.v1.IBeginTransactionRequest, callback: google.datastore.v1.Datastore.BeginTransactionCallback): void; - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; + /** + * Calls BeginTransaction. + * @param request BeginTransactionRequest message or plain object + * @returns Promise + */ + public beginTransaction(request: google.datastore.v1.IBeginTransactionRequest): Promise; - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; + /** + * 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.datastore.v1.ICommitRequest, callback: google.datastore.v1.Datastore.CommitCallback): void; - /** MessageOptions deprecated. */ - public deprecated: boolean; + /** + * Calls Commit. + * @param request CommitRequest message or plain object + * @returns Promise + */ + public commit(request: google.datastore.v1.ICommitRequest): Promise; - /** MessageOptions mapEntry. */ - public mapEntry: boolean; + /** + * Calls Rollback. + * @param request RollbackRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RollbackResponse + */ + public rollback(request: google.datastore.v1.IRollbackRequest, callback: google.datastore.v1.Datastore.RollbackCallback): void; - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Calls Rollback. + * @param request RollbackRequest message or plain object + * @returns Promise + */ + public rollback(request: google.datastore.v1.IRollbackRequest): Promise; - /** - * 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; + /** + * Calls AllocateIds. + * @param request AllocateIdsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AllocateIdsResponse + */ + public allocateIds(request: google.datastore.v1.IAllocateIdsRequest, callback: google.datastore.v1.Datastore.AllocateIdsCallback): void; - /** - * 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; + /** + * Calls AllocateIds. + * @param request AllocateIdsRequest message or plain object + * @returns Promise + */ + public allocateIds(request: google.datastore.v1.IAllocateIdsRequest): Promise; - /** - * 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; + /** + * Calls ReserveIds. + * @param request ReserveIdsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReserveIdsResponse + */ + public reserveIds(request: google.datastore.v1.IReserveIdsRequest, callback: google.datastore.v1.Datastore.ReserveIdsCallback): void; - /** - * 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; + /** + * Calls ReserveIds. + * @param request ReserveIdsRequest message or plain object + * @returns Promise + */ + public reserveIds(request: google.datastore.v1.IReserveIdsRequest): Promise; + } - /** - * 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; + namespace Datastore { - /** - * 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); + /** + * Callback as used by {@link google.datastore.v1.Datastore#lookup}. + * @param error Error, if any + * @param [response] LookupResponse + */ + type LookupCallback = (error: (Error|null), response?: google.datastore.v1.LookupResponse) => void; - /** - * 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; + /** + * Callback as used by {@link google.datastore.v1.Datastore#runQuery}. + * @param error Error, if any + * @param [response] RunQueryResponse + */ + type RunQueryCallback = (error: (Error|null), response?: google.datastore.v1.RunQueryResponse) => void; - /** - * 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 }; + /** + * Callback as used by {@link google.datastore.v1.Datastore#beginTransaction}. + * @param error Error, if any + * @param [response] BeginTransactionResponse + */ + type BeginTransactionCallback = (error: (Error|null), response?: google.datastore.v1.BeginTransactionResponse) => void; - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Callback as used by {@link google.datastore.v1.Datastore#commit}. + * @param error Error, if any + * @param [response] CommitResponse + */ + type CommitCallback = (error: (Error|null), response?: google.datastore.v1.CommitResponse) => void; - /** Properties of a FieldOptions. */ - interface IFieldOptions { + /** + * Callback as used by {@link google.datastore.v1.Datastore#rollback}. + * @param error Error, if any + * @param [response] RollbackResponse + */ + type RollbackCallback = (error: (Error|null), response?: google.datastore.v1.RollbackResponse) => void; - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); + /** + * Callback as used by {@link google.datastore.v1.Datastore#allocateIds}. + * @param error Error, if any + * @param [response] AllocateIdsResponse + */ + type AllocateIdsCallback = (error: (Error|null), response?: google.datastore.v1.AllocateIdsResponse) => void; - /** FieldOptions packed */ - packed?: (boolean|null); + /** + * Callback as used by {@link google.datastore.v1.Datastore#reserveIds}. + * @param error Error, if any + * @param [response] ReserveIdsResponse + */ + type ReserveIdsCallback = (error: (Error|null), response?: google.datastore.v1.ReserveIdsResponse) => void; + } - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); + /** Properties of a LookupRequest. */ + interface ILookupRequest { - /** FieldOptions lazy */ - lazy?: (boolean|null); + /** LookupRequest projectId */ + projectId?: (string|null); - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); + /** LookupRequest readOptions */ + readOptions?: (google.datastore.v1.IReadOptions|null); - /** FieldOptions deprecated */ - deprecated?: (boolean|null); + /** LookupRequest keys */ + keys?: (google.datastore.v1.IKey[]|null); + } - /** FieldOptions weak */ - weak?: (boolean|null); + /** Represents a LookupRequest. */ + class LookupRequest implements ILookupRequest { - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Constructs a new LookupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.ILookupRequest); - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + /** LookupRequest projectId. */ + public projectId: string; - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } + /** LookupRequest readOptions. */ + public readOptions?: (google.datastore.v1.IReadOptions|null); - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { + /** LookupRequest keys. */ + public keys: google.datastore.v1.IKey[]; - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); + /** + * Creates a new LookupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupRequest instance + */ + public static create(properties?: google.datastore.v1.ILookupRequest): google.datastore.v1.LookupRequest; - /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; + /** + * Encodes the specified LookupRequest message. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * @param message LookupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.ILookupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions packed. */ - public packed: boolean; + /** + * Encodes the specified LookupRequest message, length delimited. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * @param message LookupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.ILookupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; + /** + * Decodes a LookupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.LookupRequest; - /** FieldOptions lazy. */ - public lazy: boolean; + /** + * Decodes a LookupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.LookupRequest; - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; + /** + * Verifies a LookupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** FieldOptions deprecated. */ - public deprecated: boolean; + /** + * Creates a LookupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.LookupRequest; - /** FieldOptions weak. */ - public weak: boolean; + /** + * Creates a plain object from a LookupRequest message. Also converts values to other types if specified. + * @param message LookupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.LookupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Converts this LookupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a LookupResponse. */ + interface ILookupResponse { - /** - * 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; + /** LookupResponse found */ + found?: (google.datastore.v1.IEntityResult[]|null); - /** - * 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; + /** LookupResponse missing */ + missing?: (google.datastore.v1.IEntityResult[]|null); - /** - * 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; + /** LookupResponse deferred */ + deferred?: (google.datastore.v1.IKey[]|null); - /** - * 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; + /** LookupResponse readTime */ + readTime?: (google.protobuf.ITimestamp|null); + } - /** - * 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); + /** Represents a LookupResponse. */ + class LookupResponse implements ILookupResponse { - /** - * 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; + /** + * Constructs a new LookupResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.ILookupResponse); - /** - * 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 }; + /** LookupResponse found. */ + public found: google.datastore.v1.IEntityResult[]; - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** LookupResponse missing. */ + public missing: google.datastore.v1.IEntityResult[]; - namespace FieldOptions { + /** LookupResponse deferred. */ + public deferred: google.datastore.v1.IKey[]; - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } + /** LookupResponse readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { + /** + * Creates a new LookupResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns LookupResponse instance + */ + public static create(properties?: google.datastore.v1.ILookupResponse): google.datastore.v1.LookupResponse; - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** + * Encodes the specified LookupResponse message. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * @param message LookupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.ILookupResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { + /** + * Encodes the specified LookupResponse message, length delimited. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * @param message LookupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.ILookupResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); + /** + * Decodes a LookupResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LookupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.LookupResponse; - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Decodes a LookupResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LookupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.LookupResponse; - /** - * 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; + /** + * Verifies a LookupResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified 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; + /** + * Creates a LookupResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LookupResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.LookupResponse; - /** - * 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; + /** + * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. + * @param message LookupResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.LookupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this LookupResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a RunQueryRequest. */ + interface IRunQueryRequest { - /** - * 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); + /** RunQueryRequest projectId */ + projectId?: (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; + /** RunQueryRequest partitionId */ + partitionId?: (google.datastore.v1.IPartitionId|null); - /** - * 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 }; + /** RunQueryRequest readOptions */ + readOptions?: (google.datastore.v1.IReadOptions|null); - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** RunQueryRequest query */ + query?: (google.datastore.v1.IQuery|null); - /** Properties of an EnumOptions. */ - interface IEnumOptions { + /** RunQueryRequest gqlQuery */ + gqlQuery?: (google.datastore.v1.IGqlQuery|null); + } - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); + /** Represents a RunQueryRequest. */ + class RunQueryRequest implements IRunQueryRequest { - /** EnumOptions deprecated */ - deprecated?: (boolean|null); + /** + * Constructs a new RunQueryRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IRunQueryRequest); - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** RunQueryRequest projectId. */ + public projectId: string; - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { + /** RunQueryRequest partitionId. */ + public partitionId?: (google.datastore.v1.IPartitionId|null); - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); + /** RunQueryRequest readOptions. */ + public readOptions?: (google.datastore.v1.IReadOptions|null); - /** EnumOptions allowAlias. */ - public allowAlias: boolean; + /** RunQueryRequest query. */ + public query?: (google.datastore.v1.IQuery|null); - /** EnumOptions deprecated. */ - public deprecated: boolean; + /** RunQueryRequest gqlQuery. */ + public gqlQuery?: (google.datastore.v1.IGqlQuery|null); - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** RunQueryRequest queryType. */ + public queryType?: ("query"|"gqlQuery"); - /** - * 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; + /** + * Creates a new RunQueryRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RunQueryRequest instance + */ + public static create(properties?: google.datastore.v1.IRunQueryRequest): google.datastore.v1.RunQueryRequest; - /** - * 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 RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * @param message RunQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IRunQueryRequest, 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; + /** + * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * @param message RunQueryRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IRunQueryRequest, 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 a RunQueryRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunQueryRequest; - /** - * 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; + /** + * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunQueryRequest; - /** - * 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); + /** + * Verifies a RunQueryRequest message. + * @param message Plain object 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 RunQueryRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunQueryRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunQueryRequest; - /** - * 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 }; + /** + * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. + * @param message RunQueryRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.RunQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this RunQueryRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { + /** Properties of a RunQueryResponse. */ + interface IRunQueryResponse { - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); + /** RunQueryResponse batch */ + batch?: (google.datastore.v1.IQueryResultBatch|null); - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } + /** RunQueryResponse query */ + query?: (google.datastore.v1.IQuery|null); + } - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { + /** Represents a RunQueryResponse. */ + class RunQueryResponse implements IRunQueryResponse { - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); + /** + * Constructs a new RunQueryResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IRunQueryResponse); - /** EnumValueOptions deprecated. */ - public deprecated: boolean; + /** RunQueryResponse batch. */ + public batch?: (google.datastore.v1.IQueryResultBatch|null); - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** RunQueryResponse query. */ + public query?: (google.datastore.v1.IQuery|null); - /** - * 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; + /** + * Creates a new RunQueryResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunQueryResponse instance + */ + public static create(properties?: google.datastore.v1.IRunQueryResponse): google.datastore.v1.RunQueryResponse; - /** - * 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 RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @param message RunQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IRunQueryResponse, 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; + /** + * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @param message RunQueryResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IRunQueryResponse, 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 a RunQueryResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunQueryResponse; - /** - * 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; + /** + * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunQueryResponse; - /** - * 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); + /** + * Verifies a RunQueryResponse message. + * @param message Plain object 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 RunQueryResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunQueryResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunQueryResponse; - /** - * 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 }; + /** + * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. + * @param message RunQueryResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.RunQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this RunQueryResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a ServiceOptions. */ - interface IServiceOptions { + /** Properties of a BeginTransactionRequest. */ + interface IBeginTransactionRequest { - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); + /** BeginTransactionRequest projectId */ + projectId?: (string|null); - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** BeginTransactionRequest transactionOptions */ + transactionOptions?: (google.datastore.v1.ITransactionOptions|null); + } - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); + /** Represents a BeginTransactionRequest. */ + class BeginTransactionRequest implements IBeginTransactionRequest { - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - } + /** + * Constructs a new BeginTransactionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IBeginTransactionRequest); - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { + /** BeginTransactionRequest projectId. */ + public projectId: string; - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); + /** BeginTransactionRequest transactionOptions. */ + public transactionOptions?: (google.datastore.v1.ITransactionOptions|null); - /** ServiceOptions deprecated. */ - public deprecated: boolean; + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BeginTransactionRequest instance + */ + public static create(properties?: google.datastore.v1.IBeginTransactionRequest): google.datastore.v1.BeginTransactionRequest; - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.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.datastore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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 BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * 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.datastore.v1.BeginTransactionRequest; - /** - * 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 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.datastore.v1.BeginTransactionRequest; - /** - * 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; + /** + * 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); - /** - * 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; + /** + * 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.datastore.v1.BeginTransactionRequest; - /** - * 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 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.datastore.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * 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; + /** + * Converts this BeginTransactionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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 }; + /** Properties of a BeginTransactionResponse. */ + interface IBeginTransactionResponse { - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** BeginTransactionResponse transaction */ + transaction?: (Uint8Array|string|null); + } - /** Properties of a MethodOptions. */ - interface IMethodOptions { + /** Represents a BeginTransactionResponse. */ + class BeginTransactionResponse implements IBeginTransactionResponse { - /** MethodOptions deprecated */ - deprecated?: (boolean|null); + /** + * Constructs a new BeginTransactionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IBeginTransactionResponse); - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + /** BeginTransactionResponse transaction. */ + public transaction: (Uint8Array|string); - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + /** + * Creates a new BeginTransactionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BeginTransactionResponse instance + */ + public static create(properties?: google.datastore.v1.IBeginTransactionResponse): google.datastore.v1.BeginTransactionResponse; - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); + /** + * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @param message BeginTransactionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IBeginTransactionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); + /** + * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @param message BeginTransactionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IBeginTransactionResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.BeginTransactionResponse; - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.BeginTransactionResponse; - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); + /** + * Verifies a BeginTransactionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** MethodOptions deprecated. */ - public deprecated: boolean; + /** + * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BeginTransactionResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.BeginTransactionResponse; - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + /** + * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. + * @param message BeginTransactionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.BeginTransactionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + /** + * Converts this BeginTransactionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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; + /** Properties of a RollbackRequest. */ + interface IRollbackRequest { - /** - * 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; + /** RollbackRequest projectId */ + projectId?: (string|null); - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; + /** RollbackRequest transaction */ + transaction?: (Uint8Array|string|null); } - /** Represents a NamePart. */ - class NamePart implements INamePart { + /** Represents a RollbackRequest. */ + class RollbackRequest implements IRollbackRequest { /** - * Constructs a new NamePart. + * Constructs a new RollbackRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + constructor(properties?: google.datastore.v1.IRollbackRequest); - /** NamePart namePart. */ - public namePart: string; + /** RollbackRequest projectId. */ + public projectId: string; - /** NamePart isExtension. */ - public isExtension: boolean; + /** RollbackRequest transaction. */ + public transaction: (Uint8Array|string); /** - * Creates a new NamePart instance using the specified properties. + * Creates a new RollbackRequest instance using the specified properties. * @param [properties] Properties to set - * @returns NamePart instance + * @returns RollbackRequest instance */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + public static create(properties?: google.datastore.v1.IRollbackRequest): google.datastore.v1.RollbackRequest; /** - * 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 + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.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.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.IRollbackRequest, 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 + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.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.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NamePart message from the specified reader or buffer. + * 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 NamePart + * @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.protobuf.UninterpretedOption.NamePart; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RollbackRequest; /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NamePart + * @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.protobuf.UninterpretedOption.NamePart; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RollbackRequest; /** - * Verifies a NamePart message. + * 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 NamePart message from a plain object. Also converts values to their respective internal types. + * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NamePart + * @returns RollbackRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.RollbackRequest; /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart + * 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.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NamePart to JSON. + * Converts this RollbackRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; + /** Properties of a RollbackResponse. */ + interface IRollbackResponse { + } - /** - * 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; + /** Represents a RollbackResponse. */ + class RollbackResponse implements IRollbackResponse { - /** - * 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; + /** + * Constructs a new RollbackResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IRollbackResponse); - /** - * 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; + /** + * Creates a new RollbackResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RollbackResponse instance + */ + public static create(properties?: google.datastore.v1.IRollbackResponse): google.datastore.v1.RollbackResponse; - /** - * 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; + /** + * Encodes the specified RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * @param message RollbackResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IRollbackResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * Encodes the specified RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * @param message RollbackResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IRollbackResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Decodes a RollbackResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RollbackResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RollbackResponse; - /** - * 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; + /** + * Decodes a RollbackResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RollbackResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RollbackResponse; - /** - * 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 }; + /** + * Verifies a RollbackResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a RollbackResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RollbackResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.RollbackResponse; - namespace SourceCodeInfo { + /** + * Creates a plain object from a RollbackResponse message. Also converts values to other types if specified. + * @param message RollbackResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.RollbackResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a Location. */ - interface ILocation { + /** + * Converts this RollbackResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Location path */ - path?: (number[]|null); + /** Properties of a CommitRequest. */ + interface ICommitRequest { - /** Location span */ - span?: (number[]|null); + /** CommitRequest projectId */ + projectId?: (string|null); - /** Location leadingComments */ - leadingComments?: (string|null); + /** CommitRequest mode */ + mode?: (google.datastore.v1.CommitRequest.Mode|keyof typeof google.datastore.v1.CommitRequest.Mode|null); - /** Location trailingComments */ - trailingComments?: (string|null); + /** CommitRequest transaction */ + transaction?: (Uint8Array|string|null); - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); + /** CommitRequest mutations */ + mutations?: (google.datastore.v1.IMutation[]|null); } - /** Represents a Location. */ - class Location implements ILocation { + /** Represents a CommitRequest. */ + class CommitRequest implements ICommitRequest { /** - * Constructs a new Location. + * Constructs a new CommitRequest. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + constructor(properties?: google.datastore.v1.ICommitRequest); - /** Location path. */ - public path: number[]; + /** CommitRequest projectId. */ + public projectId: string; - /** Location span. */ - public span: number[]; + /** CommitRequest mode. */ + public mode: (google.datastore.v1.CommitRequest.Mode|keyof typeof google.datastore.v1.CommitRequest.Mode); - /** Location leadingComments. */ - public leadingComments: string; + /** CommitRequest transaction. */ + public transaction?: (Uint8Array|string|null); - /** Location trailingComments. */ - public trailingComments: string; + /** CommitRequest mutations. */ + public mutations: google.datastore.v1.IMutation[]; - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; + /** CommitRequest transactionSelector. */ + public transactionSelector?: "transaction"; /** - * Creates a new Location instance using the specified properties. + * Creates a new CommitRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Location instance + * @returns CommitRequest instance */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + public static create(properties?: google.datastore.v1.ICommitRequest): google.datastore.v1.CommitRequest; /** - * 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 + * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.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.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.datastore.v1.ICommitRequest, 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 + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.datastore.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.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.datastore.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Location message from the specified reader or buffer. + * 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 Location + * @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.protobuf.SourceCodeInfo.Location; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.CommitRequest; /** - * Decodes a Location message from the specified reader or buffer, length delimited. + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Location + * @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.protobuf.SourceCodeInfo.Location; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.CommitRequest; /** - * Verifies a Location message. + * 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 Location message from a plain object. Also converts values to their respective internal types. + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Location + * @returns CommitRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.CommitRequest; /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location + * 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.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Location to JSON. + * Converts this CommitRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { + namespace CommitRequest { - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + TRANSACTIONAL = 1, + NON_TRANSACTIONAL = 2 + } + } - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + /** Properties of a CommitResponse. */ + interface ICommitResponse { - /** - * 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; + /** CommitResponse mutationResults */ + mutationResults?: (google.datastore.v1.IMutationResult[]|null); - /** - * 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; + /** CommitResponse indexUpdates */ + indexUpdates?: (number|null); - /** - * 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; + /** CommitResponse commitTime */ + commitTime?: (google.protobuf.ITimestamp|null); + } - /** - * 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; + /** Represents a CommitResponse. */ + class CommitResponse implements ICommitResponse { - /** - * 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; + /** + * Constructs a new CommitResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.ICommitResponse); - /** - * 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); + /** CommitResponse mutationResults. */ + public mutationResults: google.datastore.v1.IMutationResult[]; - /** - * 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; + /** CommitResponse indexUpdates. */ + public indexUpdates: number; - /** - * 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 }; + /** CommitResponse commitTime. */ + public commitTime?: (google.protobuf.ITimestamp|null); - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new CommitResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CommitResponse instance + */ + public static create(properties?: google.datastore.v1.ICommitResponse): google.datastore.v1.CommitResponse; - namespace GeneratedCodeInfo { + /** + * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.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.datastore.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an Annotation. */ - interface IAnnotation { + /** + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Annotation path */ - path?: (number[]|null); + /** + * 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.datastore.v1.CommitResponse; - /** Annotation sourceFile */ - sourceFile?: (string|null); + /** + * 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.datastore.v1.CommitResponse; - /** Annotation begin */ - begin?: (number|null); + /** + * 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); - /** Annotation end */ - end?: (number|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.datastore.v1.CommitResponse; - /** Represents an Annotation. */ - class Annotation implements IAnnotation { + /** + * 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.datastore.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Constructs a new Annotation. - * @param [properties] Properties to set + * Converts this CommitResponse to JSON. + * @returns JSON object */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + public toJSON(): { [k: string]: any }; + } - /** Annotation path. */ - public path: number[]; + /** Properties of an AllocateIdsRequest. */ + interface IAllocateIdsRequest { - /** Annotation sourceFile. */ - public sourceFile: string; + /** AllocateIdsRequest projectId */ + projectId?: (string|null); - /** Annotation begin. */ - public begin: number; + /** AllocateIdsRequest keys */ + keys?: (google.datastore.v1.IKey[]|null); + } - /** Annotation end. */ - public end: number; + /** Represents an AllocateIdsRequest. */ + class AllocateIdsRequest implements IAllocateIdsRequest { /** - * Creates a new Annotation instance using the specified properties. + * Constructs a new AllocateIdsRequest. * @param [properties] Properties to set - * @returns Annotation instance */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + constructor(properties?: google.datastore.v1.IAllocateIdsRequest); + + /** AllocateIdsRequest projectId. */ + public projectId: string; + + /** AllocateIdsRequest keys. */ + public keys: google.datastore.v1.IKey[]; /** - * 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 + * Creates a new AllocateIdsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocateIdsRequest instance + */ + public static create(properties?: google.datastore.v1.IAllocateIdsRequest): google.datastore.v1.AllocateIdsRequest; + + /** + * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. + * @param message AllocateIdsRequest 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; + public static encode(message: google.datastore.v1.IAllocateIdsRequest, 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 + * Encodes the specified AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. + * @param message AllocateIdsRequest 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; + public static encodeDelimited(message: google.datastore.v1.IAllocateIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Annotation message from the specified reader or buffer. + * Decodes an AllocateIdsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Annotation + * @returns AllocateIdsRequest * @throws {Error} If the payload is not a 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AllocateIdsRequest; /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. + * Decodes an AllocateIdsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Annotation + * @returns AllocateIdsRequest * @throws {Error} If the payload is 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AllocateIdsRequest; /** - * Verifies an Annotation message. + * Verifies an AllocateIdsRequest message. * @param message Plain object 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. + * Creates an AllocateIdsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Annotation + * @returns AllocateIdsRequest */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AllocateIdsRequest; /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation + * Creates a plain object from an AllocateIdsRequest message. Also converts values to other types if specified. + * @param message AllocateIdsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.datastore.v1.AllocateIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Annotation to JSON. + * Converts this AllocateIdsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Properties of a DoubleValue. */ - interface IDoubleValue { + /** Properties of an AllocateIdsResponse. */ + interface IAllocateIdsResponse { - /** DoubleValue value */ - value?: (number|null); - } + /** AllocateIdsResponse keys */ + keys?: (google.datastore.v1.IKey[]|null); + } - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { + /** Represents an AllocateIdsResponse. */ + class AllocateIdsResponse implements IAllocateIdsResponse { - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); + /** + * Constructs a new AllocateIdsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IAllocateIdsResponse); - /** DoubleValue value. */ - public value: number; + /** AllocateIdsResponse keys. */ + public keys: google.datastore.v1.IKey[]; - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + /** + * Creates a new AllocateIdsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocateIdsResponse instance + */ + public static create(properties?: google.datastore.v1.IAllocateIdsResponse): google.datastore.v1.AllocateIdsResponse; - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified AllocateIdsResponse message. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * @param message AllocateIdsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IAllocateIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified AllocateIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * @param message AllocateIdsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IAllocateIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + /** + * Decodes an AllocateIdsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocateIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AllocateIdsResponse; - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + /** + * Decodes an AllocateIdsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocateIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AllocateIdsResponse; - /** - * Verifies a DoubleValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies an AllocateIdsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + /** + * Creates an AllocateIdsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocateIdsResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.AllocateIdsResponse; - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an AllocateIdsResponse message. Also converts values to other types if specified. + * @param message AllocateIdsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.AllocateIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this AllocateIdsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a FloatValue. */ - interface IFloatValue { + /** Properties of a ReserveIdsRequest. */ + interface IReserveIdsRequest { - /** FloatValue value */ - value?: (number|null); - } + /** ReserveIdsRequest projectId */ + projectId?: (string|null); - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { + /** ReserveIdsRequest databaseId */ + databaseId?: (string|null); - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); + /** ReserveIdsRequest keys */ + keys?: (google.datastore.v1.IKey[]|null); + } - /** FloatValue value. */ - public value: number; + /** Represents a ReserveIdsRequest. */ + class ReserveIdsRequest implements IReserveIdsRequest { - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + /** + * Constructs a new ReserveIdsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IReserveIdsRequest); - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** ReserveIdsRequest projectId. */ + public projectId: string; - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** ReserveIdsRequest databaseId. */ + public databaseId: string; - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + /** ReserveIdsRequest keys. */ + public keys: google.datastore.v1.IKey[]; - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + /** + * Creates a new ReserveIdsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReserveIdsRequest instance + */ + public static create(properties?: google.datastore.v1.IReserveIdsRequest): google.datastore.v1.ReserveIdsRequest; - /** - * Verifies a FloatValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ReserveIdsRequest message. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. + * @param message ReserveIdsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IReserveIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + /** + * Encodes the specified ReserveIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. + * @param message ReserveIdsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IReserveIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ReserveIdsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReserveIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReserveIdsRequest; - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ReserveIdsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReserveIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReserveIdsRequest; - /** Properties of an Int64Value. */ - interface IInt64Value { + /** + * Verifies a ReserveIdsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Int64Value value */ - value?: (number|Long|null); - } + /** + * Creates a ReserveIdsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReserveIdsRequest + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReserveIdsRequest; - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { + /** + * Creates a plain object from a ReserveIdsRequest message. Also converts values to other types if specified. + * @param message ReserveIdsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.ReserveIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); + /** + * Converts this ReserveIdsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Int64Value value. */ - public value: (number|Long); + /** Properties of a ReserveIdsResponse. */ + interface IReserveIdsResponse { + } - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + /** Represents a ReserveIdsResponse. */ + class ReserveIdsResponse implements IReserveIdsResponse { - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ReserveIdsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IReserveIdsResponse); - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ReserveIdsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReserveIdsResponse instance + */ + public static create(properties?: google.datastore.v1.IReserveIdsResponse): google.datastore.v1.ReserveIdsResponse; - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + /** + * Encodes the specified ReserveIdsResponse message. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. + * @param message ReserveIdsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IReserveIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + /** + * Encodes the specified ReserveIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. + * @param message ReserveIdsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IReserveIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an Int64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a ReserveIdsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReserveIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReserveIdsResponse; - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + /** + * Decodes a ReserveIdsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReserveIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReserveIdsResponse; - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ReserveIdsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a ReserveIdsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReserveIdsResponse + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReserveIdsResponse; - /** Properties of a UInt64Value. */ - interface IUInt64Value { + /** + * Creates a plain object from a ReserveIdsResponse message. Also converts values to other types if specified. + * @param message ReserveIdsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.ReserveIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** UInt64Value value */ - value?: (number|Long|null); - } + /** + * Converts this ReserveIdsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { + /** Properties of a Mutation. */ + interface IMutation { - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); + /** Mutation insert */ + insert?: (google.datastore.v1.IEntity|null); - /** UInt64Value value. */ - public value: (number|Long); + /** Mutation update */ + update?: (google.datastore.v1.IEntity|null); - /** - * Creates a new UInt64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt64Value instance - */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + /** Mutation upsert */ + upsert?: (google.datastore.v1.IEntity|null); - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** Mutation delete */ + "delete"?: (google.datastore.v1.IKey|null); - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** Mutation baseVersion */ + baseVersion?: (number|Long|string|null); - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + /** Mutation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + /** Represents a Mutation. */ + class Mutation implements IMutation { - /** - * Verifies a UInt64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new Mutation. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IMutation); - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + /** Mutation insert. */ + public insert?: (google.datastore.v1.IEntity|null); - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Mutation update. */ + public update?: (google.datastore.v1.IEntity|null); - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Mutation upsert. */ + public upsert?: (google.datastore.v1.IEntity|null); - /** Properties of an Int32Value. */ - interface IInt32Value { + /** Mutation delete. */ + public delete?: (google.datastore.v1.IKey|null); - /** Int32Value value */ - value?: (number|null); - } + /** Mutation baseVersion. */ + public baseVersion?: (number|Long|string|null); - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { + /** Mutation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); + /** Mutation operation. */ + public operation?: ("insert"|"update"|"upsert"|"delete"); - /** Int32Value value. */ - public value: number; + /** Mutation conflictDetectionStrategy. */ + public conflictDetectionStrategy?: ("baseVersion"|"updateTime"); - /** - * Creates a new Int32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int32Value instance - */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + /** + * Creates a new Mutation instance using the specified properties. + * @param [properties] Properties to set + * @returns Mutation instance + */ + public static create(properties?: google.datastore.v1.IMutation): google.datastore.v1.Mutation; - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Mutation message. Does not implicitly {@link google.datastore.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.datastore.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + /** + * Decodes 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.datastore.v1.Mutation; - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + /** + * 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.datastore.v1.Mutation; - /** - * Verifies an Int32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * 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 an Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + /** + * Creates a 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.datastore.v1.Mutation; - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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.datastore.v1.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this Mutation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a UInt32Value. */ - interface IUInt32Value { + /** Properties of a MutationResult. */ + interface IMutationResult { - /** UInt32Value value */ - value?: (number|null); - } + /** MutationResult key */ + key?: (google.datastore.v1.IKey|null); - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { + /** MutationResult version */ + version?: (number|Long|string|null); - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); + /** MutationResult updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** UInt32Value value. */ - public value: number; + /** MutationResult conflictDetected */ + conflictDetected?: (boolean|null); + } - /** - * Creates a new UInt32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt32Value instance - */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + /** Represents a MutationResult. */ + class MutationResult implements IMutationResult { - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new MutationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IMutationResult); - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + /** MutationResult key. */ + public key?: (google.datastore.v1.IKey|null); - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + /** MutationResult version. */ + public version: (number|Long|string); - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + /** MutationResult updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** - * Verifies a UInt32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MutationResult conflictDetected. */ + public conflictDetected: boolean; - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + /** + * Creates a new MutationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns MutationResult instance + */ + public static create(properties?: google.datastore.v1.IMutationResult): google.datastore.v1.MutationResult; - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified MutationResult message. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. + * @param message MutationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IMutationResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified MutationResult message, length delimited. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. + * @param message MutationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IMutationResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a BoolValue. */ - interface IBoolValue { + /** + * Decodes a MutationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MutationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.MutationResult; - /** BoolValue value */ - value?: (boolean|null); - } + /** + * Decodes a MutationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MutationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.MutationResult; - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { + /** + * Verifies a MutationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); + /** + * Creates a MutationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MutationResult + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.MutationResult; - /** BoolValue value. */ - public value: boolean; + /** + * Creates a plain object from a MutationResult message. Also converts values to other types if specified. + * @param message MutationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.MutationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new BoolValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BoolValue instance - */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + /** + * Converts this MutationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a ReadOptions. */ + interface IReadOptions { - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** ReadOptions readConsistency */ + readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|keyof typeof google.datastore.v1.ReadOptions.ReadConsistency|null); - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + /** ReadOptions transaction */ + transaction?: (Uint8Array|string|null); - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + /** ReadOptions readTime */ + readTime?: (google.protobuf.ITimestamp|null); + } - /** - * Verifies a BoolValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a ReadOptions. */ + class ReadOptions implements IReadOptions { - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + /** + * Constructs a new ReadOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.IReadOptions); - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ReadOptions readConsistency. */ + public readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|keyof typeof google.datastore.v1.ReadOptions.ReadConsistency|null); - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ReadOptions transaction. */ + public transaction?: (Uint8Array|string|null); - /** Properties of a StringValue. */ - interface IStringValue { + /** ReadOptions readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** StringValue value */ - value?: (string|null); - } + /** ReadOptions consistencyType. */ + public consistencyType?: ("readConsistency"|"transaction"|"readTime"); - /** Represents a StringValue. */ - class StringValue implements IStringValue { + /** + * Creates a new ReadOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadOptions instance + */ + public static create(properties?: google.datastore.v1.IReadOptions): google.datastore.v1.ReadOptions; - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); + /** + * Encodes the specified ReadOptions message. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. + * @param message ReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.datastore.v1.IReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** StringValue value. */ - public value: string; + /** + * Encodes the specified ReadOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. + * @param message ReadOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.datastore.v1.IReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new StringValue instance using the specified properties. - * @param [properties] Properties to set - * @returns StringValue instance - */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + /** + * Decodes a ReadOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReadOptions; - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a ReadOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReadOptions; - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + /** + * Verifies a ReadOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + /** + * Creates a ReadOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadOptions + */ + public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReadOptions; - /** - * Verifies a StringValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. + * @param message ReadOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.datastore.v1.ReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + /** + * Converts this ReadOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace ReadOptions { - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ReadConsistency enum. */ + enum ReadConsistency { + READ_CONSISTENCY_UNSPECIFIED = 0, + STRONG = 1, + EVENTUAL = 2 + } + } - /** Properties of a BytesValue. */ - interface IBytesValue { + /** Properties of a TransactionOptions. */ + interface ITransactionOptions { - /** BytesValue value */ - value?: (Uint8Array|null); - } + /** TransactionOptions readWrite */ + readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { + /** TransactionOptions readOnly */ + readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); + } - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); + /** Represents a TransactionOptions. */ + class TransactionOptions implements ITransactionOptions { - /** BytesValue value. */ - public value: Uint8Array; + /** + * Constructs a new TransactionOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.ITransactionOptions); - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + /** TransactionOptions readWrite. */ + public readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** TransactionOptions readOnly. */ + public readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + /** TransactionOptions mode. */ + public mode?: ("readWrite"|"readOnly"); - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + /** + * Creates a new TransactionOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns TransactionOptions instance + */ + public static create(properties?: google.datastore.v1.ITransactionOptions): google.datastore.v1.TransactionOptions; - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + /** + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.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.datastore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a BytesValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + /** + * 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.datastore.v1.TransactionOptions; - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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.datastore.v1.TransactionOptions; - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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); - /** Properties of an Any. */ - interface IAny { + /** + * 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.datastore.v1.TransactionOptions; - /** Any type_url */ - type_url?: (string|null); + /** + * 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.datastore.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Any value */ - value?: (Uint8Array|null); - } + /** + * Converts this TransactionOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents an Any. */ - class Any implements IAny { + namespace TransactionOptions { - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); + /** Properties of a ReadWrite. */ + interface IReadWrite { - /** Any type_url. */ - public type_url: string; + /** ReadWrite previousTransaction */ + previousTransaction?: (Uint8Array|string|null); + } - /** Any value. */ - public value: Uint8Array; - - /** - * 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; + /** Represents a ReadWrite. */ + class ReadWrite implements IReadWrite { - /** - * 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; + /** + * Constructs a new ReadWrite. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.TransactionOptions.IReadWrite); - /** - * 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; + /** ReadWrite previousTransaction. */ + public previousTransaction: (Uint8Array|string); - /** - * 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; + /** + * Creates a new ReadWrite instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadWrite instance + */ + public static create(properties?: google.datastore.v1.TransactionOptions.IReadWrite): google.datastore.v1.TransactionOptions.ReadWrite; - /** - * 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; + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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); + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * 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.datastore.v1.TransactionOptions.ReadWrite; - /** - * 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 }; + /** + * 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.datastore.v1.TransactionOptions.ReadWrite; - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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); - /** Properties of a Duration. */ - interface IDuration { + /** + * 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.datastore.v1.TransactionOptions.ReadWrite; - /** Duration seconds */ - seconds?: (number|Long|null); + /** + * 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.datastore.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Duration nanos */ - nanos?: (number|null); - } + /** + * Converts this ReadWrite to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a Duration. */ - class Duration implements IDuration { + /** Properties of a ReadOnly. */ + interface IReadOnly { - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); + /** ReadOnly readTime */ + readTime?: (google.protobuf.ITimestamp|null); + } - /** Duration seconds. */ - public seconds: (number|Long); + /** Represents a ReadOnly. */ + class ReadOnly implements IReadOnly { - /** Duration nanos. */ - public nanos: number; + /** + * Constructs a new ReadOnly. + * @param [properties] Properties to set + */ + constructor(properties?: google.datastore.v1.TransactionOptions.IReadOnly); - /** - * 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; + /** ReadOnly readTime. */ + public readTime?: (google.protobuf.ITimestamp|null); - /** - * 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; + /** + * Creates a new ReadOnly instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadOnly instance + */ + public static create(properties?: google.datastore.v1.TransactionOptions.IReadOnly): google.datastore.v1.TransactionOptions.ReadOnly; - /** - * 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; + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadOnly, 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; + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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; + /** + * 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.datastore.v1.TransactionOptions.ReadOnly; - /** - * 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); + /** + * 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.datastore.v1.TransactionOptions.ReadOnly; - /** - * 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; + /** + * 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 plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** 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 }; - } - } - - /** Namespace datastore. */ - namespace datastore { - - /** Namespace v1. */ - namespace v1 { - - /** Properties of an AggregationResult. */ - interface IAggregationResult { - - /** AggregationResult aggregateProperties */ - aggregateProperties?: ({ [k: string]: google.datastore.v1.IValue }|null); - } - - /** Represents an AggregationResult. */ - class AggregationResult implements IAggregationResult { - - /** - * Constructs a new AggregationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IAggregationResult); - - /** AggregationResult aggregateProperties. */ - public aggregateProperties: { [k: string]: google.datastore.v1.IValue }; - - /** - * Creates a new AggregationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns AggregationResult instance - */ - public static create(properties?: google.datastore.v1.IAggregationResult): google.datastore.v1.AggregationResult; - - /** - * Encodes the specified AggregationResult message. Does not implicitly {@link google.datastore.v1.AggregationResult.verify|verify} messages. - * @param message AggregationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IAggregationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AggregationResult message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResult.verify|verify} messages. - * @param message AggregationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IAggregationResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AggregationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AggregationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationResult; - - /** - * Decodes an AggregationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AggregationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationResult; - - /** - * Verifies an AggregationResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AggregationResult - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationResult; - - /** - * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. - * @param message AggregationResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AggregationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AggregationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an AggregationResultBatch. */ - interface IAggregationResultBatch { - - /** AggregationResultBatch aggregationResults */ - aggregationResults?: (google.datastore.v1.IAggregationResult[]|null); - - /** AggregationResultBatch moreResults */ - moreResults?: (google.datastore.v1.QueryResultBatch.MoreResultsType|null); - - /** AggregationResultBatch readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents an AggregationResultBatch. */ - class AggregationResultBatch implements IAggregationResultBatch { - - /** - * Constructs a new AggregationResultBatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IAggregationResultBatch); - - /** AggregationResultBatch aggregationResults. */ - public aggregationResults: google.datastore.v1.IAggregationResult[]; - - /** AggregationResultBatch moreResults. */ - public moreResults: google.datastore.v1.QueryResultBatch.MoreResultsType; - - /** AggregationResultBatch readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new AggregationResultBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns AggregationResultBatch instance - */ - public static create(properties?: google.datastore.v1.IAggregationResultBatch): google.datastore.v1.AggregationResultBatch; - - /** - * Encodes the specified AggregationResultBatch message. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. - * @param message AggregationResultBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IAggregationResultBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AggregationResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. - * @param message AggregationResultBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IAggregationResultBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AggregationResultBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AggregationResultBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationResultBatch; - - /** - * Decodes an AggregationResultBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AggregationResultBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationResultBatch; - - /** - * Verifies an AggregationResultBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AggregationResultBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AggregationResultBatch - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationResultBatch; + /** + * 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.datastore.v1.TransactionOptions.ReadOnly; - /** - * Creates a plain object from an AggregationResultBatch message. Also converts values to other types if specified. - * @param message AggregationResultBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AggregationResultBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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.datastore.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this AggregationResultBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this ReadOnly to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Properties of a PartitionId. */ @@ -4835,9 +4575,6 @@ export namespace google { /** PartitionId projectId */ projectId?: (string|null); - /** PartitionId databaseId */ - databaseId?: (string|null); - /** PartitionId namespaceId */ namespaceId?: (string|null); } @@ -4854,9 +4591,6 @@ export namespace google { /** PartitionId projectId. */ public projectId: string; - /** PartitionId databaseId. */ - public databaseId: string; - /** PartitionId namespaceId. */ public namespaceId: string; @@ -5036,7 +4770,7 @@ export namespace google { kind?: (string|null); /** PathElement id */ - id?: (number|Long|null); + id?: (number|Long|string|null); /** PathElement name */ name?: (string|null); @@ -5055,7 +4789,7 @@ export namespace google { public kind: string; /** PathElement id. */ - public id?: (number|Long|null); + public id?: (number|Long|string|null); /** PathElement name. */ public name?: (string|null); @@ -5229,13 +4963,13 @@ export namespace google { interface IValue { /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|null); + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value booleanValue */ booleanValue?: (boolean|null); /** Value integerValue */ - integerValue?: (number|Long|null); + integerValue?: (number|Long|string|null); /** Value doubleValue */ doubleValue?: (number|null); @@ -5250,7 +4984,7 @@ export namespace google { stringValue?: (string|null); /** Value blobValue */ - blobValue?: (Uint8Array|null); + blobValue?: (Uint8Array|string|null); /** Value geoPointValue */ geoPointValue?: (google.type.ILatLng|null); @@ -5278,13 +5012,13 @@ export namespace google { constructor(properties?: google.datastore.v1.IValue); /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|null); + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); /** Value booleanValue. */ public booleanValue?: (boolean|null); /** Value integerValue. */ - public integerValue?: (number|Long|null); + public integerValue?: (number|Long|string|null); /** Value doubleValue. */ public doubleValue?: (number|null); @@ -5299,7 +5033,7 @@ export namespace google { public stringValue?: (string|null); /** Value blobValue. */ - public blobValue?: (Uint8Array|null); + public blobValue?: (Uint8Array|string|null); /** Value geoPointValue. */ public geoPointValue?: (google.type.ILatLng|null); @@ -5493,13 +5227,13 @@ export namespace google { entity?: (google.datastore.v1.IEntity|null); /** EntityResult version */ - version?: (number|Long|null); + version?: (number|Long|string|null); /** EntityResult updateTime */ updateTime?: (google.protobuf.ITimestamp|null); /** EntityResult cursor */ - cursor?: (Uint8Array|null); + cursor?: (Uint8Array|string|null); } /** Represents an EntityResult. */ @@ -5515,13 +5249,13 @@ export namespace google { public entity?: (google.datastore.v1.IEntity|null); /** EntityResult version. */ - public version: (number|Long); + public version: (number|Long|string); /** EntityResult updateTime. */ public updateTime?: (google.protobuf.ITimestamp|null); /** EntityResult cursor. */ - public cursor: Uint8Array; + public cursor: (Uint8Array|string); /** * Creates a new EntityResult instance using the specified properties. @@ -5624,10 +5358,10 @@ export namespace google { distinctOn?: (google.datastore.v1.IPropertyReference[]|null); /** Query startCursor */ - startCursor?: (Uint8Array|null); + startCursor?: (Uint8Array|string|null); /** Query endCursor */ - endCursor?: (Uint8Array|null); + endCursor?: (Uint8Array|string|null); /** Query offset */ offset?: (number|null); @@ -5661,10 +5395,10 @@ export namespace google { public distinctOn: google.datastore.v1.IPropertyReference[]; /** Query startCursor. */ - public startCursor: Uint8Array; + public startCursor: (Uint8Array|string); /** Query endCursor. */ - public endCursor: Uint8Array; + public endCursor: (Uint8Array|string); /** Query offset. */ public offset: number; @@ -5743,318 +5477,24 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of an AggregationQuery. */ - interface IAggregationQuery { - - /** AggregationQuery nestedQuery */ - nestedQuery?: (google.datastore.v1.IQuery|null); + /** Properties of a KindExpression. */ + interface IKindExpression { - /** AggregationQuery aggregations */ - aggregations?: (google.datastore.v1.AggregationQuery.IAggregation[]|null); + /** KindExpression name */ + name?: (string|null); } - /** Represents an AggregationQuery. */ - class AggregationQuery implements IAggregationQuery { + /** Represents a KindExpression. */ + class KindExpression implements IKindExpression { /** - * Constructs a new AggregationQuery. + * Constructs a new KindExpression. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IAggregationQuery); + constructor(properties?: google.datastore.v1.IKindExpression); - /** AggregationQuery nestedQuery. */ - public nestedQuery?: (google.datastore.v1.IQuery|null); - - /** AggregationQuery aggregations. */ - public aggregations: google.datastore.v1.AggregationQuery.IAggregation[]; - - /** AggregationQuery queryType. */ - public queryType?: "nestedQuery"; - - /** - * Creates a new AggregationQuery instance using the specified properties. - * @param [properties] Properties to set - * @returns AggregationQuery instance - */ - public static create(properties?: google.datastore.v1.IAggregationQuery): google.datastore.v1.AggregationQuery; - - /** - * Encodes the specified AggregationQuery message. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. - * @param message AggregationQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IAggregationQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AggregationQuery message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. - * @param message AggregationQuery message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IAggregationQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AggregationQuery message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AggregationQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationQuery; - - /** - * Decodes an AggregationQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AggregationQuery - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationQuery; - - /** - * Verifies an AggregationQuery message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AggregationQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AggregationQuery - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery; - - /** - * Creates a plain object from an AggregationQuery message. Also converts values to other types if specified. - * @param message AggregationQuery - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AggregationQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AggregationQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace AggregationQuery { - - /** Properties of an Aggregation. */ - interface IAggregation { - - /** Aggregation count */ - count?: (google.datastore.v1.AggregationQuery.Aggregation.ICount|null); - - /** Aggregation alias */ - alias?: (string|null); - } - - /** Represents an Aggregation. */ - class Aggregation implements IAggregation { - - /** - * Constructs a new Aggregation. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.AggregationQuery.IAggregation); - - /** Aggregation count. */ - public count?: (google.datastore.v1.AggregationQuery.Aggregation.ICount|null); - - /** Aggregation alias. */ - public alias: string; - - /** Aggregation operator. */ - public operator?: "count"; - - /** - * Creates a new Aggregation instance using the specified properties. - * @param [properties] Properties to set - * @returns Aggregation instance - */ - public static create(properties?: google.datastore.v1.AggregationQuery.IAggregation): google.datastore.v1.AggregationQuery.Aggregation; - - /** - * Encodes the specified Aggregation message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.verify|verify} messages. - * @param message Aggregation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.AggregationQuery.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.verify|verify} messages. - * @param message Aggregation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.AggregationQuery.IAggregation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Aggregation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Aggregation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationQuery.Aggregation; - - /** - * Decodes an Aggregation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Aggregation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationQuery.Aggregation; - - /** - * Verifies an Aggregation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Aggregation - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery.Aggregation; - - /** - * Creates a plain object from an Aggregation message. Also converts values to other types if specified. - * @param message Aggregation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AggregationQuery.Aggregation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Aggregation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace Aggregation { - - /** Properties of a Count. */ - interface ICount { - - /** Count upTo */ - upTo?: (number|null); - } - - /** Represents a Count. */ - class Count implements ICount { - - /** - * Constructs a new Count. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.AggregationQuery.Aggregation.ICount); - - /** Count upTo. */ - public upTo: number; - - /** - * Creates a new Count instance using the specified properties. - * @param [properties] Properties to set - * @returns Count instance - */ - public static create(properties?: google.datastore.v1.AggregationQuery.Aggregation.ICount): google.datastore.v1.AggregationQuery.Aggregation.Count; - - /** - * Encodes the specified Count message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Count.verify|verify} messages. - * @param message Count message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.AggregationQuery.Aggregation.ICount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Count message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Count.verify|verify} messages. - * @param message Count message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.AggregationQuery.Aggregation.ICount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Count message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Count - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationQuery.Aggregation.Count; - - /** - * Decodes a Count message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Count - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationQuery.Aggregation.Count; - - /** - * Verifies a Count message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Count message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Count - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery.Aggregation.Count; - - /** - * Creates a plain object from a Count message. Also converts values to other types if specified. - * @param message Count - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AggregationQuery.Aggregation.Count, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Count to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } - - /** Properties of a KindExpression. */ - interface IKindExpression { - - /** KindExpression name */ - name?: (string|null); - } - - /** Represents a KindExpression. */ - class KindExpression implements IKindExpression { - - /** - * Constructs a new KindExpression. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IKindExpression); - - /** KindExpression name. */ - public name: string; + /** KindExpression name. */ + public name: string; /** * Creates a new KindExpression instance using the specified properties. @@ -6314,7 +5754,7 @@ export namespace google { property?: (google.datastore.v1.IPropertyReference|null); /** PropertyOrder direction */ - direction?: (google.datastore.v1.PropertyOrder.Direction|null); + direction?: (google.datastore.v1.PropertyOrder.Direction|keyof typeof google.datastore.v1.PropertyOrder.Direction|null); } /** Represents a PropertyOrder. */ @@ -6330,7 +5770,7 @@ export namespace google { public property?: (google.datastore.v1.IPropertyReference|null); /** PropertyOrder direction. */ - public direction: google.datastore.v1.PropertyOrder.Direction; + public direction: (google.datastore.v1.PropertyOrder.Direction|keyof typeof google.datastore.v1.PropertyOrder.Direction); /** * Creates a new PropertyOrder instance using the specified properties. @@ -6516,7 +5956,7 @@ export namespace google { interface ICompositeFilter { /** CompositeFilter op */ - op?: (google.datastore.v1.CompositeFilter.Operator|null); + op?: (google.datastore.v1.CompositeFilter.Operator|keyof typeof google.datastore.v1.CompositeFilter.Operator|null); /** CompositeFilter filters */ filters?: (google.datastore.v1.IFilter[]|null); @@ -6532,7 +5972,7 @@ export namespace google { constructor(properties?: google.datastore.v1.ICompositeFilter); /** CompositeFilter op. */ - public op: google.datastore.v1.CompositeFilter.Operator; + public op: (google.datastore.v1.CompositeFilter.Operator|keyof typeof google.datastore.v1.CompositeFilter.Operator); /** CompositeFilter filters. */ public filters: google.datastore.v1.IFilter[]; @@ -6613,8 +6053,7 @@ export namespace google { /** Operator enum. */ enum Operator { OPERATOR_UNSPECIFIED = 0, - AND = 1, - OR = 2 + AND = 1 } } @@ -6625,7 +6064,7 @@ export namespace google { property?: (google.datastore.v1.IPropertyReference|null); /** PropertyFilter op */ - op?: (google.datastore.v1.PropertyFilter.Operator|null); + op?: (google.datastore.v1.PropertyFilter.Operator|keyof typeof google.datastore.v1.PropertyFilter.Operator|null); /** PropertyFilter value */ value?: (google.datastore.v1.IValue|null); @@ -6644,7 +6083,7 @@ export namespace google { public property?: (google.datastore.v1.IPropertyReference|null); /** PropertyFilter op. */ - public op: google.datastore.v1.PropertyFilter.Operator; + public op: (google.datastore.v1.PropertyFilter.Operator|keyof typeof google.datastore.v1.PropertyFilter.Operator); /** PropertyFilter value. */ public value?: (google.datastore.v1.IValue|null); @@ -6852,7 +6291,7 @@ export namespace google { value?: (google.datastore.v1.IValue|null); /** GqlQueryParameter cursor */ - cursor?: (Uint8Array|null); + cursor?: (Uint8Array|string|null); } /** Represents a GqlQueryParameter. */ @@ -6868,7 +6307,7 @@ export namespace google { public value?: (google.datastore.v1.IValue|null); /** GqlQueryParameter cursor. */ - public cursor?: (Uint8Array|null); + public cursor?: (Uint8Array|string|null); /** GqlQueryParameter parameterType. */ public parameterType?: ("value"|"cursor"); @@ -6951,22 +6390,22 @@ export namespace google { skippedResults?: (number|null); /** QueryResultBatch skippedCursor */ - skippedCursor?: (Uint8Array|null); + skippedCursor?: (Uint8Array|string|null); /** QueryResultBatch entityResultType */ - entityResultType?: (google.datastore.v1.EntityResult.ResultType|null); + entityResultType?: (google.datastore.v1.EntityResult.ResultType|keyof typeof google.datastore.v1.EntityResult.ResultType|null); /** QueryResultBatch entityResults */ entityResults?: (google.datastore.v1.IEntityResult[]|null); /** QueryResultBatch endCursor */ - endCursor?: (Uint8Array|null); + endCursor?: (Uint8Array|string|null); /** QueryResultBatch moreResults */ - moreResults?: (google.datastore.v1.QueryResultBatch.MoreResultsType|null); + moreResults?: (google.datastore.v1.QueryResultBatch.MoreResultsType|keyof typeof google.datastore.v1.QueryResultBatch.MoreResultsType|null); /** QueryResultBatch snapshotVersion */ - snapshotVersion?: (number|Long|null); + snapshotVersion?: (number|Long|string|null); /** QueryResultBatch readTime */ readTime?: (google.protobuf.ITimestamp|null); @@ -6985,22 +6424,22 @@ export namespace google { public skippedResults: number; /** QueryResultBatch skippedCursor. */ - public skippedCursor: Uint8Array; + public skippedCursor: (Uint8Array|string); /** QueryResultBatch entityResultType. */ - public entityResultType: google.datastore.v1.EntityResult.ResultType; + public entityResultType: (google.datastore.v1.EntityResult.ResultType|keyof typeof google.datastore.v1.EntityResult.ResultType); /** QueryResultBatch entityResults. */ public entityResults: google.datastore.v1.IEntityResult[]; /** QueryResultBatch endCursor. */ - public endCursor: Uint8Array; + public endCursor: (Uint8Array|string); /** QueryResultBatch moreResults. */ - public moreResults: google.datastore.v1.QueryResultBatch.MoreResultsType; + public moreResults: (google.datastore.v1.QueryResultBatch.MoreResultsType|keyof typeof google.datastore.v1.QueryResultBatch.MoreResultsType); /** QueryResultBatch snapshotVersion. */ - public snapshotVersion: (number|Long); + public snapshotVersion: (number|Long|string); /** QueryResultBatch readTime. */ public readTime?: (google.protobuf.ITimestamp|null); @@ -7087,5518 +6526,4972 @@ export namespace google { NO_MORE_RESULTS = 3 } } + } + } - /** Represents a Datastore */ - class Datastore extends $protobuf.rpc.Service { + /** Namespace api. */ + namespace api { - /** - * Constructs a new Datastore 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); + /** Properties of a Http. */ + interface IHttp { - /** - * Creates new Datastore 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): Datastore; + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); - /** - * Calls Lookup. - * @param request LookupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and LookupResponse - */ - public lookup(request: google.datastore.v1.ILookupRequest, callback: google.datastore.v1.Datastore.LookupCallback): void; + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } - /** - * Calls Lookup. - * @param request LookupRequest message or plain object - * @returns Promise - */ - public lookup(request: google.datastore.v1.ILookupRequest): Promise; + /** Represents a Http. */ + class Http implements IHttp { - /** - * Calls RunQuery. - * @param request RunQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RunQueryResponse - */ - public runQuery(request: google.datastore.v1.IRunQueryRequest, callback: google.datastore.v1.Datastore.RunQueryCallback): void; + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); - /** - * Calls RunQuery. - * @param request RunQueryRequest message or plain object - * @returns Promise - */ - public runQuery(request: google.datastore.v1.IRunQueryRequest): Promise; + /** Http rules. */ + public rules: google.api.IHttpRule[]; - /** - * Calls RunAggregationQuery. - * @param request RunAggregationQueryRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RunAggregationQueryResponse - */ - public runAggregationQuery(request: google.datastore.v1.IRunAggregationQueryRequest, callback: google.datastore.v1.Datastore.RunAggregationQueryCallback): void; + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; - /** - * Calls RunAggregationQuery. - * @param request RunAggregationQueryRequest message or plain object - * @returns Promise - */ - public runAggregationQuery(request: google.datastore.v1.IRunAggregationQueryRequest): Promise; + /** + * 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; - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BeginTransactionResponse - */ - public beginTransaction(request: google.datastore.v1.IBeginTransactionRequest, callback: google.datastore.v1.Datastore.BeginTransactionCallback): void; + /** + * 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; - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @returns Promise - */ - public beginTransaction(request: google.datastore.v1.IBeginTransactionRequest): Promise; + /** + * 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; - /** - * 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.datastore.v1.ICommitRequest, callback: google.datastore.v1.Datastore.CommitCallback): void; + /** + * 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; - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @returns Promise - */ - public commit(request: google.datastore.v1.ICommitRequest): Promise; + /** + * 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; - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @param callback Node-style callback called with the error, if any, and RollbackResponse - */ - public rollback(request: google.datastore.v1.IRollbackRequest, callback: google.datastore.v1.Datastore.RollbackCallback): void; + /** + * 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); - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @returns Promise - */ - public rollback(request: google.datastore.v1.IRollbackRequest): Promise; + /** + * 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; - /** - * Calls AllocateIds. - * @param request AllocateIdsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and AllocateIdsResponse - */ - public allocateIds(request: google.datastore.v1.IAllocateIdsRequest, callback: google.datastore.v1.Datastore.AllocateIdsCallback): void; + /** + * 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 }; - /** - * Calls AllocateIds. - * @param request AllocateIdsRequest message or plain object - * @returns Promise - */ - public allocateIds(request: google.datastore.v1.IAllocateIdsRequest): Promise; + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Calls ReserveIds. - * @param request ReserveIdsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReserveIdsResponse - */ - public reserveIds(request: google.datastore.v1.IReserveIdsRequest, callback: google.datastore.v1.Datastore.ReserveIdsCallback): void; + /** Properties of a HttpRule. */ + interface IHttpRule { - /** - * Calls ReserveIds. - * @param request ReserveIdsRequest message or plain object - * @returns Promise - */ - public reserveIds(request: google.datastore.v1.IReserveIdsRequest): Promise; - } + /** HttpRule selector */ + selector?: (string|null); - namespace Datastore { + /** HttpRule get */ + get?: (string|null); - /** - * Callback as used by {@link google.datastore.v1.Datastore#lookup}. - * @param error Error, if any - * @param [response] LookupResponse - */ - type LookupCallback = (error: (Error|null), response?: google.datastore.v1.LookupResponse) => void; + /** HttpRule put */ + put?: (string|null); - /** - * Callback as used by {@link google.datastore.v1.Datastore#runQuery}. - * @param error Error, if any - * @param [response] RunQueryResponse - */ - type RunQueryCallback = (error: (Error|null), response?: google.datastore.v1.RunQueryResponse) => void; + /** HttpRule post */ + post?: (string|null); - /** - * Callback as used by {@link google.datastore.v1.Datastore#runAggregationQuery}. - * @param error Error, if any - * @param [response] RunAggregationQueryResponse - */ - type RunAggregationQueryCallback = (error: (Error|null), response?: google.datastore.v1.RunAggregationQueryResponse) => void; + /** HttpRule delete */ + "delete"?: (string|null); - /** - * Callback as used by {@link google.datastore.v1.Datastore#beginTransaction}. - * @param error Error, if any - * @param [response] BeginTransactionResponse - */ - type BeginTransactionCallback = (error: (Error|null), response?: google.datastore.v1.BeginTransactionResponse) => void; + /** HttpRule patch */ + patch?: (string|null); - /** - * Callback as used by {@link google.datastore.v1.Datastore#commit}. - * @param error Error, if any - * @param [response] CommitResponse - */ - type CommitCallback = (error: (Error|null), response?: google.datastore.v1.CommitResponse) => void; + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); - /** - * Callback as used by {@link google.datastore.v1.Datastore#rollback}. - * @param error Error, if any - * @param [response] RollbackResponse - */ - type RollbackCallback = (error: (Error|null), response?: google.datastore.v1.RollbackResponse) => void; + /** HttpRule body */ + body?: (string|null); - /** - * Callback as used by {@link google.datastore.v1.Datastore#allocateIds}. - * @param error Error, if any - * @param [response] AllocateIdsResponse - */ - type AllocateIdsCallback = (error: (Error|null), response?: google.datastore.v1.AllocateIdsResponse) => void; + /** HttpRule responseBody */ + responseBody?: (string|null); - /** - * Callback as used by {@link google.datastore.v1.Datastore#reserveIds}. - * @param error Error, if any - * @param [response] ReserveIdsResponse - */ - type ReserveIdsCallback = (error: (Error|null), response?: google.datastore.v1.ReserveIdsResponse) => void; - } + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } - /** Properties of a LookupRequest. */ - interface ILookupRequest { + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { - /** LookupRequest projectId */ - projectId?: (string|null); + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); - /** LookupRequest databaseId */ - databaseId?: (string|null); + /** HttpRule selector. */ + public selector: string; - /** LookupRequest readOptions */ - readOptions?: (google.datastore.v1.IReadOptions|null); + /** HttpRule get. */ + public get?: (string|null); - /** LookupRequest keys */ - keys?: (google.datastore.v1.IKey[]|null); - } + /** HttpRule put. */ + public put?: (string|null); - /** Represents a LookupRequest. */ - class LookupRequest implements ILookupRequest { + /** HttpRule post. */ + public post?: (string|null); - /** - * Constructs a new LookupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ILookupRequest); + /** HttpRule delete. */ + public delete?: (string|null); - /** LookupRequest projectId. */ - public projectId: string; + /** HttpRule patch. */ + public patch?: (string|null); - /** LookupRequest databaseId. */ - public databaseId: string; + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); - /** LookupRequest readOptions. */ - public readOptions?: (google.datastore.v1.IReadOptions|null); + /** HttpRule body. */ + public body: string; - /** LookupRequest keys. */ - public keys: google.datastore.v1.IKey[]; + /** HttpRule responseBody. */ + public responseBody: string; - /** - * Creates a new LookupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns LookupRequest instance - */ - public static create(properties?: google.datastore.v1.ILookupRequest): google.datastore.v1.LookupRequest; + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; - /** - * Encodes the specified LookupRequest message. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. - * @param message LookupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.ILookupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LookupRequest message, length delimited. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. - * @param message LookupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.ILookupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - /** - * Decodes a LookupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LookupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.LookupRequest; + /** + * 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; - /** - * Decodes a LookupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LookupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.LookupRequest; + /** + * 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; - /** - * Verifies a LookupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified 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; - /** - * Creates a LookupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LookupRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.LookupRequest; + /** + * 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; - /** - * Creates a plain object from a LookupRequest message. Also converts values to other types if specified. - * @param message LookupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.LookupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this LookupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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); - /** Properties of a LookupResponse. */ - interface ILookupResponse { + /** + * 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; - /** LookupResponse found */ - found?: (google.datastore.v1.IEntityResult[]|null); + /** + * 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 }; - /** LookupResponse missing */ - missing?: (google.datastore.v1.IEntityResult[]|null); + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** LookupResponse deferred */ - deferred?: (google.datastore.v1.IKey[]|null); + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { - /** LookupResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } + /** CustomHttpPattern kind */ + kind?: (string|null); - /** Represents a LookupResponse. */ - class LookupResponse implements ILookupResponse { + /** CustomHttpPattern path */ + path?: (string|null); + } - /** - * Constructs a new LookupResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ILookupResponse); + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { - /** LookupResponse found. */ - public found: google.datastore.v1.IEntityResult[]; + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); - /** LookupResponse missing. */ - public missing: google.datastore.v1.IEntityResult[]; + /** CustomHttpPattern kind. */ + public kind: string; - /** LookupResponse deferred. */ - public deferred: google.datastore.v1.IKey[]; + /** CustomHttpPattern path. */ + public path: string; - /** LookupResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** + * 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; - /** - * Creates a new LookupResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns LookupResponse instance - */ - public static create(properties?: google.datastore.v1.ILookupResponse): google.datastore.v1.LookupResponse; + /** + * 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 LookupResponse message. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. - * @param message LookupResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.ILookupResponse, 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; - /** - * Encodes the specified LookupResponse message, length delimited. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. - * @param message LookupResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.ILookupResponse, 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 LookupResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LookupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.LookupResponse; + /** + * 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; - /** - * Decodes a LookupResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LookupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.LookupResponse; + /** + * 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); - /** - * Verifies a LookupResponse message. - * @param message Plain object 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 LookupResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LookupResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.LookupResponse; + /** + * 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 }; - /** - * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. - * @param message LookupResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.LookupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this LookupResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + } - /** Properties of a RunQueryRequest. */ - interface IRunQueryRequest { + /** Namespace protobuf. */ + namespace protobuf { - /** RunQueryRequest projectId */ - projectId?: (string|null); + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { - /** RunQueryRequest databaseId */ - databaseId?: (string|null); + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } - /** RunQueryRequest partitionId */ - partitionId?: (google.datastore.v1.IPartitionId|null); + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { - /** RunQueryRequest readOptions */ - readOptions?: (google.datastore.v1.IReadOptions|null); + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); - /** RunQueryRequest query */ - query?: (google.datastore.v1.IQuery|null); + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; - /** RunQueryRequest gqlQuery */ - gqlQuery?: (google.datastore.v1.IGqlQuery|null); - } + /** + * 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; - /** Represents a RunQueryRequest. */ - class RunQueryRequest implements IRunQueryRequest { + /** + * 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; - /** - * Constructs a new RunQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRunQueryRequest); + /** + * 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; - /** RunQueryRequest projectId. */ - public projectId: string; + /** + * 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; - /** RunQueryRequest databaseId. */ - public databaseId: string; + /** + * 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; - /** RunQueryRequest partitionId. */ - public partitionId?: (google.datastore.v1.IPartitionId|null); + /** + * 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); - /** RunQueryRequest readOptions. */ - public readOptions?: (google.datastore.v1.IReadOptions|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; - /** RunQueryRequest query. */ - public query?: (google.datastore.v1.IQuery|null); + /** + * 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 }; - /** RunQueryRequest gqlQuery. */ - public gqlQuery?: (google.datastore.v1.IGqlQuery|null); + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** RunQueryRequest queryType. */ - public queryType?: ("query"|"gqlQuery"); + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { - /** - * Creates a new RunQueryRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunQueryRequest instance - */ - public static create(properties?: google.datastore.v1.IRunQueryRequest): google.datastore.v1.RunQueryRequest; + /** FileDescriptorProto name */ + name?: (string|null); - /** - * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. - * @param message RunQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IRunQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto package */ + "package"?: (string|null); - /** - * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. - * @param message RunQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IRunQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); - /** - * Decodes a RunQueryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunQueryRequest; + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); - /** - * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunQueryRequest; + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); - /** - * Verifies a RunQueryRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); - /** - * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunQueryRequest; + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - /** - * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. - * @param message RunQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.RunQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); - /** - * Converts this RunQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); - /** Properties of a RunQueryResponse. */ - interface IRunQueryResponse { + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); - /** RunQueryResponse batch */ - batch?: (google.datastore.v1.IQueryResultBatch|null); + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - /** RunQueryResponse query */ - query?: (google.datastore.v1.IQuery|null); - } + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } - /** Represents a RunQueryResponse. */ - class RunQueryResponse implements IRunQueryResponse { + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { - /** - * Constructs a new RunQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRunQueryResponse); + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); - /** RunQueryResponse batch. */ - public batch?: (google.datastore.v1.IQueryResultBatch|null); + /** FileDescriptorProto name. */ + public name: string; - /** RunQueryResponse query. */ - public query?: (google.datastore.v1.IQuery|null); + /** FileDescriptorProto package. */ + public package: string; - /** - * Creates a new RunQueryResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RunQueryResponse instance - */ - public static create(properties?: google.datastore.v1.IRunQueryResponse): google.datastore.v1.RunQueryResponse; + /** FileDescriptorProto dependency. */ + public dependency: string[]; - /** - * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. - * @param message RunQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IRunQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; - /** - * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. - * @param message RunQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IRunQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; - /** - * Decodes a RunQueryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunQueryResponse; + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; - /** - * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunQueryResponse; + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; - /** - * Verifies a RunQueryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; - /** - * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunQueryResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunQueryResponse; + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; - /** - * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. - * @param message RunQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.RunQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); - /** - * Converts this RunQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - /** Properties of a RunAggregationQueryRequest. */ - interface IRunAggregationQueryRequest { + /** FileDescriptorProto syntax. */ + public syntax: string; - /** RunAggregationQueryRequest projectId */ - projectId?: (string|null); + /** + * 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; - /** RunAggregationQueryRequest databaseId */ - databaseId?: (string|null); + /** + * 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; - /** RunAggregationQueryRequest partitionId */ - partitionId?: (google.datastore.v1.IPartitionId|null); + /** + * 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; - /** RunAggregationQueryRequest readOptions */ - readOptions?: (google.datastore.v1.IReadOptions|null); + /** + * 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; - /** RunAggregationQueryRequest aggregationQuery */ - aggregationQuery?: (google.datastore.v1.IAggregationQuery|null); + /** + * 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; - /** RunAggregationQueryRequest gqlQuery */ - gqlQuery?: (google.datastore.v1.IGqlQuery|null); - } + /** + * 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); - /** Represents a RunAggregationQueryRequest. */ - class RunAggregationQueryRequest implements IRunAggregationQueryRequest { + /** + * 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; - /** - * Constructs a new RunAggregationQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRunAggregationQueryRequest); + /** + * 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 }; - /** RunAggregationQueryRequest projectId. */ - public projectId: string; + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** RunAggregationQueryRequest databaseId. */ - public databaseId: string; + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { - /** RunAggregationQueryRequest partitionId. */ - public partitionId?: (google.datastore.v1.IPartitionId|null); + /** DescriptorProto name */ + name?: (string|null); - /** RunAggregationQueryRequest readOptions. */ - public readOptions?: (google.datastore.v1.IReadOptions|null); + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); - /** RunAggregationQueryRequest aggregationQuery. */ - public aggregationQuery?: (google.datastore.v1.IAggregationQuery|null); + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); - /** RunAggregationQueryRequest gqlQuery. */ - public gqlQuery?: (google.datastore.v1.IGqlQuery|null); + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); - /** RunAggregationQueryRequest queryType. */ - public queryType?: ("aggregationQuery"|"gqlQuery"); + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - /** - * Creates a new RunAggregationQueryRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RunAggregationQueryRequest instance - */ - public static create(properties?: google.datastore.v1.IRunAggregationQueryRequest): google.datastore.v1.RunAggregationQueryRequest; + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - /** - * Encodes the specified RunAggregationQueryRequest message. Does not implicitly {@link google.datastore.v1.RunAggregationQueryRequest.verify|verify} messages. - * @param message RunAggregationQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IRunAggregationQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - /** - * Encodes the specified RunAggregationQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunAggregationQueryRequest.verify|verify} messages. - * @param message RunAggregationQueryRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IRunAggregationQueryRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); - /** - * Decodes a RunAggregationQueryRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunAggregationQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunAggregationQueryRequest; + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - /** - * Decodes a RunAggregationQueryRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunAggregationQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunAggregationQueryRequest; + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } - /** - * Verifies a RunAggregationQueryRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { - /** - * Creates a RunAggregationQueryRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunAggregationQueryRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunAggregationQueryRequest; + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); - /** - * Creates a plain object from a RunAggregationQueryRequest message. Also converts values to other types if specified. - * @param message RunAggregationQueryRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.RunAggregationQueryRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** DescriptorProto name. */ + public name: string; - /** - * Converts this RunAggregationQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; - /** Properties of a RunAggregationQueryResponse. */ - interface IRunAggregationQueryResponse { + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; - /** RunAggregationQueryResponse batch */ - batch?: (google.datastore.v1.IAggregationResultBatch|null); + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; - /** RunAggregationQueryResponse query */ - query?: (google.datastore.v1.IAggregationQuery|null); - } + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; - /** Represents a RunAggregationQueryResponse. */ - class RunAggregationQueryResponse implements IRunAggregationQueryResponse { + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - /** - * Constructs a new RunAggregationQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRunAggregationQueryResponse); + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - /** RunAggregationQueryResponse batch. */ - public batch?: (google.datastore.v1.IAggregationResultBatch|null); + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); - /** RunAggregationQueryResponse query. */ - public query?: (google.datastore.v1.IAggregationQuery|null); + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - /** - * Creates a new RunAggregationQueryResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RunAggregationQueryResponse instance - */ - public static create(properties?: google.datastore.v1.IRunAggregationQueryResponse): google.datastore.v1.RunAggregationQueryResponse; + /** DescriptorProto reservedName. */ + public reservedName: string[]; - /** - * Encodes the specified RunAggregationQueryResponse message. Does not implicitly {@link google.datastore.v1.RunAggregationQueryResponse.verify|verify} messages. - * @param message RunAggregationQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IRunAggregationQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 RunAggregationQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunAggregationQueryResponse.verify|verify} messages. - * @param message RunAggregationQueryResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IRunAggregationQueryResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes a RunAggregationQueryResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RunAggregationQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RunAggregationQueryResponse; + /** + * 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 RunAggregationQueryResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RunAggregationQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RunAggregationQueryResponse; + /** + * 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; - /** - * Verifies a RunAggregationQueryResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a 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; - /** - * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RunAggregationQueryResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.RunAggregationQueryResponse; + /** + * 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 plain object from a RunAggregationQueryResponse message. Also converts values to other types if specified. - * @param message RunAggregationQueryResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.RunAggregationQueryResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this RunAggregationQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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 }; - /** Properties of a BeginTransactionRequest. */ - interface IBeginTransactionRequest { + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** BeginTransactionRequest projectId */ - projectId?: (string|null); + namespace DescriptorProto { - /** BeginTransactionRequest databaseId */ - databaseId?: (string|null); + /** Properties of an ExtensionRange. */ + interface IExtensionRange { - /** BeginTransactionRequest transactionOptions */ - transactionOptions?: (google.datastore.v1.ITransactionOptions|null); + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); } - /** Represents a BeginTransactionRequest. */ - class BeginTransactionRequest implements IBeginTransactionRequest { + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { /** - * Constructs a new BeginTransactionRequest. + * Constructs a new ExtensionRange. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IBeginTransactionRequest); + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - /** BeginTransactionRequest projectId. */ - public projectId: string; + /** ExtensionRange start. */ + public start: number; - /** BeginTransactionRequest databaseId. */ - public databaseId: string; + /** ExtensionRange end. */ + public end: number; - /** BeginTransactionRequest transactionOptions. */ - public transactionOptions?: (google.datastore.v1.ITransactionOptions|null); + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); /** - * Creates a new BeginTransactionRequest instance using the specified properties. + * Creates a new ExtensionRange instance using the specified properties. * @param [properties] Properties to set - * @returns BeginTransactionRequest instance + * @returns ExtensionRange instance */ - public static create(properties?: google.datastore.v1.IBeginTransactionRequest): google.datastore.v1.BeginTransactionRequest; + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. - * @param message BeginTransactionRequest message or plain object to encode + * 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.datastore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. - * @param message BeginTransactionRequest message or plain object to encode + * 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.datastore.v1.IBeginTransactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer. + * 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 BeginTransactionRequest + * @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.datastore.v1.BeginTransactionRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BeginTransactionRequest + * @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.datastore.v1.BeginTransactionRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; /** - * Verifies a BeginTransactionRequest message. + * 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 a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BeginTransactionRequest + * @returns ExtensionRange */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.BeginTransactionRequest; + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @param message BeginTransactionRequest + * 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.datastore.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BeginTransactionRequest to JSON. + * Converts this ExtensionRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BeginTransactionResponse. */ - interface IBeginTransactionResponse { + /** Properties of a ReservedRange. */ + interface IReservedRange { - /** BeginTransactionResponse transaction */ - transaction?: (Uint8Array|null); + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); } - /** Represents a BeginTransactionResponse. */ - class BeginTransactionResponse implements IBeginTransactionResponse { + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { /** - * Constructs a new BeginTransactionResponse. + * Constructs a new ReservedRange. * @param [properties] Properties to set */ - constructor(properties?: google.datastore.v1.IBeginTransactionResponse); + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - /** BeginTransactionResponse transaction. */ - public transaction: Uint8Array; + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; /** - * Creates a new BeginTransactionResponse instance using the specified properties. + * Creates a new ReservedRange instance using the specified properties. * @param [properties] Properties to set - * @returns BeginTransactionResponse instance + * @returns ReservedRange instance */ - public static create(properties?: google.datastore.v1.IBeginTransactionResponse): google.datastore.v1.BeginTransactionResponse; + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; /** - * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @param message BeginTransactionResponse message or plain object to encode + * 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.datastore.v1.IBeginTransactionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @param message BeginTransactionResponse message or plain object to encode + * 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.datastore.v1.IBeginTransactionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer. + * 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 BeginTransactionResponse + * @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.datastore.v1.BeginTransactionResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BeginTransactionResponse + * @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.datastore.v1.BeginTransactionResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; /** - * Verifies a BeginTransactionResponse message. + * 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 BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BeginTransactionResponse + * @returns ReservedRange */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.BeginTransactionResponse; + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; /** - * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. - * @param message BeginTransactionResponse + * 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.datastore.v1.BeginTransactionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BeginTransactionResponse to JSON. + * Converts this ReservedRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of a RollbackRequest. */ - interface IRollbackRequest { + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { - /** RollbackRequest projectId */ - projectId?: (string|null); + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** RollbackRequest databaseId */ - databaseId?: (string|null); + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { - /** RollbackRequest transaction */ - transaction?: (Uint8Array|null); - } + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); - /** Represents a RollbackRequest. */ - class RollbackRequest implements IRollbackRequest { + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Constructs a new RollbackRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRollbackRequest); + /** + * 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; - /** RollbackRequest projectId. */ - public projectId: string; + /** + * 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; - /** RollbackRequest databaseId. */ - public databaseId: string; + /** + * 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; - /** RollbackRequest transaction. */ - public transaction: Uint8Array; + /** + * 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; - /** - * Creates a new RollbackRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RollbackRequest instance - */ - public static create(properties?: google.datastore.v1.IRollbackRequest): google.datastore.v1.RollbackRequest; + /** + * 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; - /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.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.datastore.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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); - /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IRollbackRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * 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.datastore.v1.RollbackRequest; + /** + * 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 }; - /** - * 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.datastore.v1.RollbackRequest; + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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); + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { - /** - * 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.datastore.v1.RollbackRequest; + /** FieldDescriptorProto name */ + name?: (string|null); - /** - * 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.datastore.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FieldDescriptorProto number */ + number?: (number|null); - /** - * Converts this RollbackRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - /** Properties of a RollbackResponse. */ - interface IRollbackResponse { - } + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - /** Represents a RollbackResponse. */ - class RollbackResponse implements IRollbackResponse { + /** FieldDescriptorProto typeName */ + typeName?: (string|null); - /** - * Constructs a new RollbackResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRollbackResponse); + /** FieldDescriptorProto extendee */ + extendee?: (string|null); - /** - * Creates a new RollbackResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RollbackResponse instance - */ - public static create(properties?: google.datastore.v1.IRollbackResponse): google.datastore.v1.RollbackResponse; + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); - /** - * Encodes the specified RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. - * @param message RollbackResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IRollbackResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); - /** - * Encodes the specified RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. - * @param message RollbackResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IRollbackResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); - /** - * Decodes a RollbackResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RollbackResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.RollbackResponse; + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); - /** - * Decodes a RollbackResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RollbackResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.RollbackResponse; + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } - /** - * Verifies a RollbackResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { - /** - * Creates a RollbackResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RollbackResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.RollbackResponse; + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); - /** - * Creates a plain object from a RollbackResponse message. Also converts values to other types if specified. - * @param message RollbackResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.RollbackResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RollbackResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a CommitRequest. */ - interface ICommitRequest { - - /** CommitRequest projectId */ - projectId?: (string|null); + /** FieldDescriptorProto name. */ + public name: string; - /** CommitRequest databaseId */ - databaseId?: (string|null); + /** FieldDescriptorProto number. */ + public number: number; - /** CommitRequest mode */ - mode?: (google.datastore.v1.CommitRequest.Mode|null); + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - /** CommitRequest transaction */ - transaction?: (Uint8Array|null); + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - /** CommitRequest mutations */ - mutations?: (google.datastore.v1.IMutation[]|null); - } + /** FieldDescriptorProto typeName. */ + public typeName: string; - /** Represents a CommitRequest. */ - class CommitRequest implements ICommitRequest { + /** FieldDescriptorProto extendee. */ + public extendee: string; - /** - * Constructs a new CommitRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ICommitRequest); + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; - /** CommitRequest projectId. */ - public projectId: string; + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; - /** CommitRequest databaseId. */ - public databaseId: string; + /** FieldDescriptorProto jsonName. */ + public jsonName: string; - /** CommitRequest mode. */ - public mode: google.datastore.v1.CommitRequest.Mode; + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); - /** CommitRequest transaction. */ - public transaction?: (Uint8Array|null); + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; - /** CommitRequest mutations. */ - public mutations: google.datastore.v1.IMutation[]; + /** + * 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; - /** CommitRequest transactionSelector. */ - public transactionSelector?: "transaction"; + /** + * 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; - /** - * Creates a new CommitRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CommitRequest instance - */ - public static create(properties?: google.datastore.v1.ICommitRequest): google.datastore.v1.CommitRequest; + /** + * 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; - /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.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.datastore.v1.ICommitRequest, 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; - /** - * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.ICommitRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * 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.datastore.v1.CommitRequest; + /** + * 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); - /** - * 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.datastore.v1.CommitRequest; + /** + * 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; - /** - * 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 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 }; - /** - * 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.datastore.v1.CommitRequest; + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * 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.datastore.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace FieldDescriptorProto { - /** - * Converts this CommitRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** 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 } - namespace CommitRequest { - - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - TRANSACTIONAL = 1, - NON_TRANSACTIONAL = 2 - } + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 } + } - /** Properties of a CommitResponse. */ - interface ICommitResponse { + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { - /** CommitResponse mutationResults */ - mutationResults?: (google.datastore.v1.IMutationResult[]|null); + /** OneofDescriptorProto name */ + name?: (string|null); - /** CommitResponse indexUpdates */ - indexUpdates?: (number|null); + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } - /** CommitResponse commitTime */ - commitTime?: (google.protobuf.ITimestamp|null); - } + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { - /** Represents a CommitResponse. */ - class CommitResponse implements ICommitResponse { + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); - /** - * Constructs a new CommitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ICommitResponse); + /** OneofDescriptorProto name. */ + public name: string; - /** CommitResponse mutationResults. */ - public mutationResults: google.datastore.v1.IMutationResult[]; + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); - /** CommitResponse indexUpdates. */ - public indexUpdates: number; + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - /** CommitResponse commitTime. */ - public commitTime?: (google.protobuf.ITimestamp|null); + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { /** - * Creates a new CommitResponse instance using the specified properties. + * Constructs a new EnumReservedRange. * @param [properties] Properties to set - * @returns CommitResponse instance */ - public static create(properties?: google.datastore.v1.ICommitResponse): google.datastore.v1.CommitResponse; + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; /** - * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. - * @param message CommitResponse message or plain object to encode + * 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.datastore.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. - * @param message CommitResponse message or plain object to encode + * 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.datastore.v1.ICommitResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CommitResponse message from the specified reader or buffer. + * 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 CommitResponse + * @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.datastore.v1.CommitResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Decodes a CommitResponse message from the specified reader or buffer, length delimited. + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CommitResponse + * @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.datastore.v1.CommitResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Verifies a CommitResponse message. + * 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 a CommitResponse message from a plain object. Also converts values to their respective internal types. + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CommitResponse + * @returns EnumReservedRange */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.CommitResponse; + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @param message CommitResponse + * 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.datastore.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CommitResponse to JSON. + * Converts this EnumReservedRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } + } - /** Properties of an AllocateIdsRequest. */ - interface IAllocateIdsRequest { - - /** AllocateIdsRequest projectId */ - projectId?: (string|null); + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { - /** AllocateIdsRequest databaseId */ - databaseId?: (string|null); + /** EnumValueDescriptorProto name */ + name?: (string|null); - /** AllocateIdsRequest keys */ - keys?: (google.datastore.v1.IKey[]|null); - } + /** EnumValueDescriptorProto number */ + number?: (number|null); - /** Represents an AllocateIdsRequest. */ - class AllocateIdsRequest implements IAllocateIdsRequest { + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } - /** - * Constructs a new AllocateIdsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IAllocateIdsRequest); + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - /** AllocateIdsRequest projectId. */ - public projectId: string; + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - /** AllocateIdsRequest databaseId. */ - public databaseId: string; + /** EnumValueDescriptorProto name. */ + public name: string; - /** AllocateIdsRequest keys. */ - public keys: google.datastore.v1.IKey[]; + /** EnumValueDescriptorProto number. */ + public number: number; - /** - * Creates a new AllocateIdsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns AllocateIdsRequest instance - */ - public static create(properties?: google.datastore.v1.IAllocateIdsRequest): google.datastore.v1.AllocateIdsRequest; + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); - /** - * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @param message AllocateIdsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IAllocateIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @param message AllocateIdsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IAllocateIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes an AllocateIdsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllocateIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AllocateIdsRequest; + /** + * 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 AllocateIdsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllocateIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AllocateIdsRequest; + /** + * 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; - /** - * Verifies an AllocateIdsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes 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; - /** - * Creates an AllocateIdsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllocateIdsRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AllocateIdsRequest; + /** + * 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 a plain object from an AllocateIdsRequest message. Also converts values to other types if specified. - * @param message AllocateIdsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AllocateIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this AllocateIdsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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 }; - /** Properties of an AllocateIdsResponse. */ - interface IAllocateIdsResponse { + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** AllocateIdsResponse keys */ - keys?: (google.datastore.v1.IKey[]|null); - } + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { - /** Represents an AllocateIdsResponse. */ - class AllocateIdsResponse implements IAllocateIdsResponse { + /** ServiceDescriptorProto name */ + name?: (string|null); - /** - * Constructs a new AllocateIdsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IAllocateIdsResponse); + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); - /** AllocateIdsResponse keys. */ - public keys: google.datastore.v1.IKey[]; + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } - /** - * Creates a new AllocateIdsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns AllocateIdsResponse instance - */ - public static create(properties?: google.datastore.v1.IAllocateIdsResponse): google.datastore.v1.AllocateIdsResponse; + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { - /** - * Encodes the specified AllocateIdsResponse message. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. - * @param message AllocateIdsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IAllocateIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); - /** - * Encodes the specified AllocateIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. - * @param message AllocateIdsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IAllocateIdsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** ServiceDescriptorProto name. */ + public name: string; - /** - * Decodes an AllocateIdsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllocateIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AllocateIdsResponse; + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; - /** - * Decodes an AllocateIdsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllocateIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AllocateIdsResponse; + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); - /** - * Verifies an AllocateIdsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|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; - /** - * Creates an AllocateIdsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllocateIdsResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AllocateIdsResponse; + /** + * 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; - /** - * Creates a plain object from an AllocateIdsResponse message. Also converts values to other types if specified. - * @param message AllocateIdsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AllocateIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this AllocateIdsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a ReserveIdsRequest. */ - interface IReserveIdsRequest { + /** + * 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; - /** ReserveIdsRequest projectId */ - projectId?: (string|null); + /** + * 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); - /** ReserveIdsRequest databaseId */ - databaseId?: (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; - /** ReserveIdsRequest keys */ - keys?: (google.datastore.v1.IKey[]|null); - } + /** + * 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 }; - /** Represents a ReserveIdsRequest. */ - class ReserveIdsRequest implements IReserveIdsRequest { + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new ReserveIdsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IReserveIdsRequest); + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { - /** ReserveIdsRequest projectId. */ - public projectId: string; + /** MethodDescriptorProto name */ + name?: (string|null); - /** ReserveIdsRequest databaseId. */ - public databaseId: string; + /** MethodDescriptorProto inputType */ + inputType?: (string|null); - /** ReserveIdsRequest keys. */ - public keys: google.datastore.v1.IKey[]; + /** MethodDescriptorProto outputType */ + outputType?: (string|null); - /** - * Creates a new ReserveIdsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ReserveIdsRequest instance - */ - public static create(properties?: google.datastore.v1.IReserveIdsRequest): google.datastore.v1.ReserveIdsRequest; + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); - /** - * Encodes the specified ReserveIdsRequest message. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. - * @param message ReserveIdsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IReserveIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); - /** - * Encodes the specified ReserveIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. - * @param message ReserveIdsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IReserveIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } - /** - * Decodes a ReserveIdsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReserveIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReserveIdsRequest; + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { - /** - * Decodes a ReserveIdsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReserveIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReserveIdsRequest; + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); - /** - * Verifies a ReserveIdsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MethodDescriptorProto name. */ + public name: string; - /** - * Creates a ReserveIdsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReserveIdsRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReserveIdsRequest; + /** MethodDescriptorProto inputType. */ + public inputType: string; - /** - * Creates a plain object from a ReserveIdsRequest message. Also converts values to other types if specified. - * @param message ReserveIdsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.ReserveIdsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MethodDescriptorProto outputType. */ + public outputType: string; - /** - * Converts this ReserveIdsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); - /** Properties of a ReserveIdsResponse. */ - interface IReserveIdsResponse { - } + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; - /** Represents a ReserveIdsResponse. */ - class ReserveIdsResponse implements IReserveIdsResponse { + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; - /** - * Constructs a new ReserveIdsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IReserveIdsResponse); + /** + * 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; - /** - * Creates a new ReserveIdsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ReserveIdsResponse instance - */ - public static create(properties?: google.datastore.v1.IReserveIdsResponse): google.datastore.v1.ReserveIdsResponse; + /** + * 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 ReserveIdsResponse message. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. - * @param message ReserveIdsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IReserveIdsResponse, 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; - /** - * Encodes the specified ReserveIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. - * @param message ReserveIdsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IReserveIdsResponse, 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 ReserveIdsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReserveIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReserveIdsResponse; + /** + * 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; - /** - * Decodes a ReserveIdsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReserveIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReserveIdsResponse; + /** + * 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); - /** - * Verifies a ReserveIdsResponse message. - * @param message Plain object 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 ReserveIdsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReserveIdsResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReserveIdsResponse; + /** + * 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 }; - /** - * Creates a plain object from a ReserveIdsResponse message. Also converts values to other types if specified. - * @param message ReserveIdsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.ReserveIdsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this ReserveIdsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a FileOptions. */ + interface IFileOptions { - /** Properties of a Mutation. */ - interface IMutation { + /** FileOptions javaPackage */ + javaPackage?: (string|null); - /** Mutation insert */ - insert?: (google.datastore.v1.IEntity|null); + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); - /** Mutation update */ - update?: (google.datastore.v1.IEntity|null); + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); - /** Mutation upsert */ - upsert?: (google.datastore.v1.IEntity|null); + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); - /** Mutation delete */ - "delete"?: (google.datastore.v1.IKey|null); + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); - /** Mutation baseVersion */ - baseVersion?: (number|Long|null); + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - /** Mutation updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - } + /** FileOptions goPackage */ + goPackage?: (string|null); - /** Represents a Mutation. */ - class Mutation implements IMutation { + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); - /** - * Constructs a new Mutation. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IMutation); + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); - /** Mutation insert. */ - public insert?: (google.datastore.v1.IEntity|null); + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); - /** Mutation update. */ - public update?: (google.datastore.v1.IEntity|null); + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); - /** Mutation upsert. */ - public upsert?: (google.datastore.v1.IEntity|null); + /** FileOptions deprecated */ + deprecated?: (boolean|null); - /** Mutation delete. */ - public delete?: (google.datastore.v1.IKey|null); + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); - /** Mutation baseVersion. */ - public baseVersion?: (number|Long|null); + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); - /** Mutation updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); - /** Mutation operation. */ - public operation?: ("insert"|"update"|"upsert"|"delete"); + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); - /** Mutation conflictDetectionStrategy. */ - public conflictDetectionStrategy?: ("baseVersion"|"updateTime"); + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); - /** - * Creates a new Mutation instance using the specified properties. - * @param [properties] Properties to set - * @returns Mutation instance - */ - public static create(properties?: google.datastore.v1.IMutation): google.datastore.v1.Mutation; + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); - /** - * Encodes the specified Mutation message. Does not implicitly {@link google.datastore.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.datastore.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); - /** - * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.IMutation, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); - /** - * 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.datastore.v1.Mutation; + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * 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.datastore.v1.Mutation; + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { - /** - * 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); + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); - /** - * 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.datastore.v1.Mutation; + /** FileOptions javaPackage. */ + public javaPackage: string; - /** - * 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.datastore.v1.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; - /** - * Converts this Mutation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; - /** Properties of a MutationResult. */ - interface IMutationResult { + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; - /** MutationResult key */ - key?: (google.datastore.v1.IKey|null); + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; - /** MutationResult version */ - version?: (number|Long|null); + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - /** MutationResult updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** FileOptions goPackage. */ + public goPackage: string; - /** MutationResult conflictDetected */ - conflictDetected?: (boolean|null); - } + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; - /** Represents a MutationResult. */ - class MutationResult implements IMutationResult { + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; - /** - * Constructs a new MutationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IMutationResult); + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; - /** MutationResult key. */ - public key?: (google.datastore.v1.IKey|null); + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; - /** MutationResult version. */ - public version: (number|Long); + /** FileOptions deprecated. */ + public deprecated: boolean; - /** MutationResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; - /** MutationResult conflictDetected. */ - public conflictDetected: boolean; + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; - /** - * Creates a new MutationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns MutationResult instance - */ - public static create(properties?: google.datastore.v1.IMutationResult): google.datastore.v1.MutationResult; + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; - /** - * Encodes the specified MutationResult message. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. - * @param message MutationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IMutationResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; - /** - * Encodes the specified MutationResult message, length delimited. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. - * @param message MutationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IMutationResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; - /** - * Decodes a MutationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MutationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.MutationResult; + /** FileOptions phpNamespace. */ + public phpNamespace: string; - /** - * Decodes a MutationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MutationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.MutationResult; + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; - /** - * Verifies a MutationResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** FileOptions rubyPackage. */ + public rubyPackage: string; - /** - * Creates a MutationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MutationResult - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.MutationResult; + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Creates a plain object from a MutationResult message. Also converts values to other types if specified. - * @param message MutationResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.MutationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this MutationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a ReadOptions. */ - interface IReadOptions { + /** + * 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; - /** ReadOptions readConsistency */ - readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|null); + /** + * 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; - /** ReadOptions transaction */ - transaction?: (Uint8Array|null); + /** + * 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; - /** ReadOptions readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } + /** + * 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); - /** Represents a ReadOptions. */ - class ReadOptions implements IReadOptions { + /** + * 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; - /** - * Constructs a new ReadOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IReadOptions); + /** + * 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 }; - /** ReadOptions readConsistency. */ - public readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|null); + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ReadOptions transaction. */ - public transaction?: (Uint8Array|null); + namespace FileOptions { - /** ReadOptions readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } - /** ReadOptions consistencyType. */ - public consistencyType?: ("readConsistency"|"transaction"|"readTime"); + /** Properties of a MessageOptions. */ + interface IMessageOptions { - /** - * Creates a new ReadOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadOptions instance - */ - public static create(properties?: google.datastore.v1.IReadOptions): google.datastore.v1.ReadOptions; + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); - /** - * Encodes the specified ReadOptions message. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. - * @param message ReadOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); - /** - * Encodes the specified ReadOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. - * @param message ReadOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IReadOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** MessageOptions deprecated */ + deprecated?: (boolean|null); - /** - * Decodes a ReadOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ReadOptions; + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); - /** - * Decodes a ReadOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReadOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ReadOptions; + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Verifies a ReadOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { - /** - * Creates a ReadOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReadOptions - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ReadOptions; + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); - /** - * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. - * @param message ReadOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.ReadOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; - /** - * Converts this ReadOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; - namespace ReadOptions { + /** MessageOptions deprecated. */ + public deprecated: boolean; - /** ReadConsistency enum. */ - enum ReadConsistency { - READ_CONSISTENCY_UNSPECIFIED = 0, - STRONG = 1, - EVENTUAL = 2 - } - } + /** MessageOptions mapEntry. */ + public mapEntry: boolean; - /** Properties of a TransactionOptions. */ - interface ITransactionOptions { + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** TransactionOptions readWrite */ - readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); + /** + * 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; - /** TransactionOptions readOnly */ - readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); - } + /** + * 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; - /** Represents a TransactionOptions. */ - class TransactionOptions implements ITransactionOptions { + /** + * 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; - /** - * Constructs a new TransactionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ITransactionOptions); + /** + * 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; - /** TransactionOptions readWrite. */ - public readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); + /** + * 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; - /** TransactionOptions readOnly. */ - public readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); + /** + * 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); - /** TransactionOptions mode. */ - public mode?: ("readWrite"|"readOnly"); + /** + * 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 new TransactionOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns TransactionOptions instance - */ - public static create(properties?: google.datastore.v1.ITransactionOptions): google.datastore.v1.TransactionOptions; + /** + * 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 }; - /** - * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.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.datastore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.ITransactionOptions, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a FieldOptions. */ + interface IFieldOptions { - /** - * 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.datastore.v1.TransactionOptions; + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - /** - * 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.datastore.v1.TransactionOptions; + /** FieldOptions packed */ + packed?: (boolean|null); - /** - * 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); + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|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.datastore.v1.TransactionOptions; + /** FieldOptions lazy */ + lazy?: (boolean|null); - /** - * 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.datastore.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** FieldOptions deprecated */ + deprecated?: (boolean|null); - /** - * Converts this TransactionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FieldOptions weak */ + weak?: (boolean|null); - namespace TransactionOptions { + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** Properties of a ReadWrite. */ - interface IReadWrite { + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + } - /** ReadWrite previousTransaction */ - previousTransaction?: (Uint8Array|null); - } + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { - /** Represents a ReadWrite. */ - class ReadWrite implements IReadWrite { + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); - /** - * Constructs a new ReadWrite. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.TransactionOptions.IReadWrite); + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - /** ReadWrite previousTransaction. */ - public previousTransaction: Uint8Array; + /** FieldOptions packed. */ + public packed: boolean; - /** - * Creates a new ReadWrite instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadWrite instance - */ - public static create(properties?: google.datastore.v1.TransactionOptions.IReadWrite): google.datastore.v1.TransactionOptions.ReadWrite; + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - /** - * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; + /** FieldOptions lazy. */ + public lazy: boolean; - /** - * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadWrite, writer?: $protobuf.Writer): $protobuf.Writer; + /** FieldOptions deprecated. */ + public deprecated: boolean; - /** - * 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.datastore.v1.TransactionOptions.ReadWrite; + /** FieldOptions weak. */ + public weak: boolean; - /** - * 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.datastore.v1.TransactionOptions.ReadWrite; + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * 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 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; - /** - * 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.datastore.v1.TransactionOptions.ReadWrite; + /** + * 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; - /** - * 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.datastore.v1.TransactionOptions.ReadWrite, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this ReadWrite to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a ReadOnly. */ - interface IReadOnly { + /** + * 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; - /** ReadOnly readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } + /** + * 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); - /** Represents a ReadOnly. */ - class ReadOnly implements IReadOnly { + /** + * 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; - /** - * Constructs a new ReadOnly. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.TransactionOptions.IReadOnly); + /** + * 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 }; - /** ReadOnly readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new ReadOnly instance using the specified properties. - * @param [properties] Properties to set - * @returns ReadOnly instance - */ - public static create(properties?: google.datastore.v1.TransactionOptions.IReadOnly): google.datastore.v1.TransactionOptions.ReadOnly; + namespace FieldOptions { - /** - * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } - /** - * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.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.datastore.v1.TransactionOptions.IReadOnly, writer?: $protobuf.Writer): $protobuf.Writer; + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } - /** - * 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.datastore.v1.TransactionOptions.ReadOnly; + /** Properties of an OneofOptions. */ + interface IOneofOptions { - /** - * 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.datastore.v1.TransactionOptions.ReadOnly; + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * 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); + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { - /** - * 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.datastore.v1.TransactionOptions.ReadOnly; + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); - /** - * 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.datastore.v1.TransactionOptions.ReadOnly, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Converts this ReadOnly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } + /** + * 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; - /** Namespace admin. */ - namespace admin { + /** + * 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; - /** Namespace v1. */ - namespace v1 { + /** + * 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; - /** Properties of a MigrationStateEvent. */ - interface IMigrationStateEvent { + /** + * 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; - /** MigrationStateEvent state */ - state?: (google.datastore.admin.v1.MigrationState|null); - } + /** + * 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; - /** Represents a MigrationStateEvent. */ - class MigrationStateEvent implements IMigrationStateEvent { + /** + * 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); - /** - * Constructs a new MigrationStateEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IMigrationStateEvent); + /** + * 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; - /** MigrationStateEvent state. */ - public state: google.datastore.admin.v1.MigrationState; - - /** - * Creates a new MigrationStateEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns MigrationStateEvent instance - */ - public static create(properties?: google.datastore.admin.v1.IMigrationStateEvent): google.datastore.admin.v1.MigrationStateEvent; - - /** - * Encodes the specified MigrationStateEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. - * @param message MigrationStateEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IMigrationStateEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MigrationStateEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. - * @param message MigrationStateEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IMigrationStateEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MigrationStateEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MigrationStateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationStateEvent; - - /** - * Decodes a MigrationStateEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MigrationStateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationStateEvent; - - /** - * Verifies a MigrationStateEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MigrationStateEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MigrationStateEvent - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationStateEvent; - - /** - * Creates a plain object from a MigrationStateEvent message. Also converts values to other types if specified. - * @param message MigrationStateEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.MigrationStateEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MigrationStateEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MigrationProgressEvent. */ - interface IMigrationProgressEvent { - - /** MigrationProgressEvent step */ - step?: (google.datastore.admin.v1.MigrationStep|null); - - /** MigrationProgressEvent prepareStepDetails */ - prepareStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null); - - /** MigrationProgressEvent redirectWritesStepDetails */ - redirectWritesStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null); - } - - /** Represents a MigrationProgressEvent. */ - class MigrationProgressEvent implements IMigrationProgressEvent { - - /** - * Constructs a new MigrationProgressEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IMigrationProgressEvent); - - /** MigrationProgressEvent step. */ - public step: google.datastore.admin.v1.MigrationStep; - - /** MigrationProgressEvent prepareStepDetails. */ - public prepareStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null); - - /** MigrationProgressEvent redirectWritesStepDetails. */ - public redirectWritesStepDetails?: (google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null); - - /** MigrationProgressEvent stepDetails. */ - public stepDetails?: ("prepareStepDetails"|"redirectWritesStepDetails"); - - /** - * Creates a new MigrationProgressEvent instance using the specified properties. - * @param [properties] Properties to set - * @returns MigrationProgressEvent instance - */ - public static create(properties?: google.datastore.admin.v1.IMigrationProgressEvent): google.datastore.admin.v1.MigrationProgressEvent; - - /** - * Encodes the specified MigrationProgressEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. - * @param message MigrationProgressEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IMigrationProgressEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MigrationProgressEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. - * @param message MigrationProgressEvent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IMigrationProgressEvent, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MigrationProgressEvent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MigrationProgressEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent; - - /** - * Decodes a MigrationProgressEvent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MigrationProgressEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent; - - /** - * Verifies a MigrationProgressEvent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MigrationProgressEvent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MigrationProgressEvent - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent; - - /** - * Creates a plain object from a MigrationProgressEvent message. Also converts values to other types if specified. - * @param message MigrationProgressEvent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MigrationProgressEvent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace MigrationProgressEvent { - - /** ConcurrencyMode enum. */ - enum ConcurrencyMode { - CONCURRENCY_MODE_UNSPECIFIED = 0, - PESSIMISTIC = 1, - OPTIMISTIC = 2, - OPTIMISTIC_WITH_ENTITY_GROUPS = 3 - } - - /** Properties of a PrepareStepDetails. */ - interface IPrepareStepDetails { - - /** PrepareStepDetails concurrencyMode */ - concurrencyMode?: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null); - } - - /** Represents a PrepareStepDetails. */ - class PrepareStepDetails implements IPrepareStepDetails { - - /** - * Constructs a new PrepareStepDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails); - - /** PrepareStepDetails concurrencyMode. */ - public concurrencyMode: google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode; - - /** - * Creates a new PrepareStepDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns PrepareStepDetails instance - */ - public static create(properties?: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - - /** - * Encodes the specified PrepareStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. - * @param message PrepareStepDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PrepareStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. - * @param message PrepareStepDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PrepareStepDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PrepareStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - - /** - * Decodes a PrepareStepDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PrepareStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - - /** - * Verifies a PrepareStepDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PrepareStepDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PrepareStepDetails - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails; - - /** - * Creates a plain object from a PrepareStepDetails message. Also converts values to other types if specified. - * @param message PrepareStepDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PrepareStepDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a RedirectWritesStepDetails. */ - interface IRedirectWritesStepDetails { - - /** RedirectWritesStepDetails concurrencyMode */ - concurrencyMode?: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null); - } - - /** Represents a RedirectWritesStepDetails. */ - class RedirectWritesStepDetails implements IRedirectWritesStepDetails { - - /** - * Constructs a new RedirectWritesStepDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails); - - /** RedirectWritesStepDetails concurrencyMode. */ - public concurrencyMode: google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode; - - /** - * Creates a new RedirectWritesStepDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns RedirectWritesStepDetails instance - */ - public static create(properties?: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - - /** - * Encodes the specified RedirectWritesStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. - * @param message RedirectWritesStepDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RedirectWritesStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. - * @param message RedirectWritesStepDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RedirectWritesStepDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RedirectWritesStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - - /** - * Decodes a RedirectWritesStepDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RedirectWritesStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - - /** - * Verifies a RedirectWritesStepDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RedirectWritesStepDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RedirectWritesStepDetails - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails; - - /** - * Creates a plain object from a RedirectWritesStepDetails message. Also converts values to other types if specified. - * @param message RedirectWritesStepDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RedirectWritesStepDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** MigrationState enum. */ - enum MigrationState { - MIGRATION_STATE_UNSPECIFIED = 0, - RUNNING = 1, - PAUSED = 2, - COMPLETE = 3 - } - - /** MigrationStep enum. */ - enum MigrationStep { - MIGRATION_STEP_UNSPECIFIED = 0, - PREPARE = 6, - START = 1, - APPLY_WRITES_SYNCHRONOUSLY = 7, - COPY_AND_VERIFY = 2, - REDIRECT_EVENTUALLY_CONSISTENT_READS = 3, - REDIRECT_STRONGLY_CONSISTENT_READS = 4, - REDIRECT_WRITES = 5 - } - - /** Represents a DatastoreAdmin */ - class DatastoreAdmin extends $protobuf.rpc.Service { + /** + * 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 }; - /** - * Constructs a new DatastoreAdmin 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); + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates new DatastoreAdmin 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): DatastoreAdmin; + /** Properties of an EnumOptions. */ + interface IEnumOptions { - /** - * Calls ExportEntities. - * @param request ExportEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportEntities(request: google.datastore.admin.v1.IExportEntitiesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ExportEntitiesCallback): void; + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); - /** - * Calls ExportEntities. - * @param request ExportEntitiesRequest message or plain object - * @returns Promise - */ - public exportEntities(request: google.datastore.admin.v1.IExportEntitiesRequest): Promise; + /** EnumOptions deprecated */ + deprecated?: (boolean|null); - /** - * Calls ImportEntities. - * @param request ImportEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public importEntities(request: google.datastore.admin.v1.IImportEntitiesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ImportEntitiesCallback): void; + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** - * Calls ImportEntities. - * @param request ImportEntitiesRequest message or plain object - * @returns Promise - */ - public importEntities(request: google.datastore.admin.v1.IImportEntitiesRequest): Promise; + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { - /** - * Calls CreateIndex. - * @param request CreateIndexRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createIndex(request: google.datastore.admin.v1.ICreateIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.CreateIndexCallback): void; + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); - /** - * Calls CreateIndex. - * @param request CreateIndexRequest message or plain object - * @returns Promise - */ - public createIndex(request: google.datastore.admin.v1.ICreateIndexRequest): Promise; + /** EnumOptions allowAlias. */ + public allowAlias: boolean; - /** - * Calls DeleteIndex. - * @param request DeleteIndexRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteIndex(request: google.datastore.admin.v1.IDeleteIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.DeleteIndexCallback): void; + /** EnumOptions deprecated. */ + public deprecated: boolean; - /** - * Calls DeleteIndex. - * @param request DeleteIndexRequest message or plain object - * @returns Promise - */ - public deleteIndex(request: google.datastore.admin.v1.IDeleteIndexRequest): Promise; + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** - * Calls GetIndex. - * @param request GetIndexRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Index - */ - public getIndex(request: google.datastore.admin.v1.IGetIndexRequest, callback: google.datastore.admin.v1.DatastoreAdmin.GetIndexCallback): void; + /** + * 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; - /** - * Calls GetIndex. - * @param request GetIndexRequest message or plain object - * @returns Promise - */ - public getIndex(request: google.datastore.admin.v1.IGetIndexRequest): Promise; + /** + * 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; - /** - * Calls ListIndexes. - * @param request ListIndexesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListIndexesResponse - */ - public listIndexes(request: google.datastore.admin.v1.IListIndexesRequest, callback: google.datastore.admin.v1.DatastoreAdmin.ListIndexesCallback): void; + /** + * 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; - /** - * Calls ListIndexes. - * @param request ListIndexesRequest message or plain object - * @returns Promise - */ - public listIndexes(request: google.datastore.admin.v1.IListIndexesRequest): Promise; - } + /** + * 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; - namespace DatastoreAdmin { + /** + * 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; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#exportEntities}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * 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); - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#importEntities}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * 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; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#createIndex}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateIndexCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * 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 }; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#deleteIndex}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteIndexCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#getIndex}. - * @param error Error, if any - * @param [response] Index - */ - type GetIndexCallback = (error: (Error|null), response?: google.datastore.admin.v1.Index) => void; + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#listIndexes}. - * @param error Error, if any - * @param [response] ListIndexesResponse - */ - type ListIndexesCallback = (error: (Error|null), response?: google.datastore.admin.v1.ListIndexesResponse) => void; - } + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); - /** Properties of a CommonMetadata. */ - interface ICommonMetadata { + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } - /** CommonMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { - /** CommonMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); - /** CommonMetadata operationType */ - operationType?: (google.datastore.admin.v1.OperationType|null); + /** EnumValueOptions deprecated. */ + public deprecated: boolean; - /** CommonMetadata labels */ - labels?: ({ [k: string]: string }|null); + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** CommonMetadata state */ - state?: (google.datastore.admin.v1.CommonMetadata.State|null); - } + /** + * 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; - /** Represents a CommonMetadata. */ - class CommonMetadata implements ICommonMetadata { + /** + * 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; - /** - * Constructs a new CommonMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.ICommonMetadata); + /** + * 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; - /** CommonMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); + /** + * 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; - /** CommonMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + /** + * 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; - /** CommonMetadata operationType. */ - public operationType: google.datastore.admin.v1.OperationType; + /** + * 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); - /** CommonMetadata labels. */ - public labels: { [k: string]: string }; + /** + * 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; - /** CommonMetadata state. */ - public state: google.datastore.admin.v1.CommonMetadata.State; + /** + * 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 }; - /** - * Creates a new CommonMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.ICommonMetadata): google.datastore.admin.v1.CommonMetadata; + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified CommonMetadata message. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. - * @param message CommonMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.ICommonMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a ServiceOptions. */ + interface IServiceOptions { - /** - * Encodes the specified CommonMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. - * @param message CommonMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.ICommonMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); - /** - * Decodes a CommonMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.CommonMetadata; + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Decodes a CommonMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.CommonMetadata; + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); - /** - * Verifies a CommonMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } - /** - * Creates a CommonMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.CommonMetadata; + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { - /** - * Creates a plain object from a CommonMetadata message. Also converts values to other types if specified. - * @param message CommonMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.CommonMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); - /** - * Converts this CommonMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ServiceOptions deprecated. */ + public deprecated: boolean; - namespace CommonMetadata { + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - INITIALIZING = 1, - PROCESSING = 2, - CANCELLING = 3, - FINALIZING = 4, - SUCCESSFUL = 5, - FAILED = 6, - CANCELLED = 7 - } - } + /** + * 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; - /** Properties of a Progress. */ - interface IProgress { + /** + * 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; - /** Progress workCompleted */ - workCompleted?: (number|Long|null); + /** + * 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; - /** Progress workEstimated */ - workEstimated?: (number|Long|null); - } + /** + * 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; - /** Represents a Progress. */ - class Progress implements IProgress { + /** + * 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); - /** - * Constructs a new Progress. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IProgress); + /** + * 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; - /** Progress workCompleted. */ - public workCompleted: (number|Long); + /** + * 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 }; - /** Progress workEstimated. */ - public workEstimated: (number|Long); + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new Progress instance using the specified properties. - * @param [properties] Properties to set - * @returns Progress instance - */ - public static create(properties?: google.datastore.admin.v1.IProgress): google.datastore.admin.v1.Progress; + /** Properties of a MethodOptions. */ + interface IMethodOptions { - /** - * Encodes the specified Progress message. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. - * @param message Progress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + /** MethodOptions deprecated */ + deprecated?: (boolean|null); - /** - * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. - * @param message Progress message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IProgress, writer?: $protobuf.Writer): $protobuf.Writer; + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - /** - * Decodes a Progress message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Progress; + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - /** - * Decodes a Progress message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Progress; + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); - /** - * Verifies a Progress message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); - /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Progress - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Progress; + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } - /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @param message Progress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { - /** - * Converts this Progress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); - /** Properties of an ExportEntitiesRequest. */ - interface IExportEntitiesRequest { + /** MethodOptions deprecated. */ + public deprecated: boolean; - /** ExportEntitiesRequest projectId */ - projectId?: (string|null); + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - /** ExportEntitiesRequest labels */ - labels?: ({ [k: string]: string }|null); + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - /** ExportEntitiesRequest entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** + * 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; - /** ExportEntitiesRequest outputUrlPrefix */ - outputUrlPrefix?: (string|null); - } + /** + * 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; - /** Represents an ExportEntitiesRequest. */ - class ExportEntitiesRequest implements IExportEntitiesRequest { + /** + * 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; - /** - * Constructs a new ExportEntitiesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IExportEntitiesRequest); + /** + * 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; - /** ExportEntitiesRequest projectId. */ - public projectId: string; + /** + * 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; - /** ExportEntitiesRequest labels. */ - public labels: { [k: string]: string }; + /** + * 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); - /** ExportEntitiesRequest entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|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; - /** ExportEntitiesRequest outputUrlPrefix. */ - public outputUrlPrefix: string; + /** + * 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 }; - /** - * Creates a new ExportEntitiesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportEntitiesRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IExportEntitiesRequest): google.datastore.admin.v1.ExportEntitiesRequest; + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified ExportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. - * @param message ExportEntitiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IExportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + namespace MethodOptions { - /** - * Encodes the specified ExportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. - * @param message ExportEntitiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } - /** - * Decodes an ExportEntitiesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesRequest; + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { - /** - * Decodes an ExportEntitiesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesRequest; + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - /** - * Verifies an ExportEntitiesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); - /** - * Creates an ExportEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportEntitiesRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesRequest; + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); - /** - * Creates a plain object from an ExportEntitiesRequest message. Also converts values to other types if specified. - * @param message ExportEntitiesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ExportEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); - /** - * Converts this ExportEntitiesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); - /** Properties of an ImportEntitiesRequest. */ - interface IImportEntitiesRequest { + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|string|null); - /** ImportEntitiesRequest projectId */ - projectId?: (string|null); + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } - /** ImportEntitiesRequest labels */ - labels?: ({ [k: string]: string }|null); + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { - /** ImportEntitiesRequest inputUrl */ - inputUrl?: (string|null); + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); - /** ImportEntitiesRequest entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - } + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; - /** Represents an ImportEntitiesRequest. */ - class ImportEntitiesRequest implements IImportEntitiesRequest { + /** UninterpretedOption identifierValue. */ + public identifierValue: string; - /** - * Constructs a new ImportEntitiesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IImportEntitiesRequest); + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long|string); - /** ImportEntitiesRequest projectId. */ - public projectId: string; + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long|string); - /** ImportEntitiesRequest labels. */ - public labels: { [k: string]: string }; + /** UninterpretedOption doubleValue. */ + public doubleValue: number; - /** ImportEntitiesRequest inputUrl. */ - public inputUrl: string; + /** UninterpretedOption stringValue. */ + public stringValue: (Uint8Array|string); - /** ImportEntitiesRequest entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; - /** - * Creates a new ImportEntitiesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportEntitiesRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IImportEntitiesRequest): google.datastore.admin.v1.ImportEntitiesRequest; + /** + * 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 ImportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. - * @param message ImportEntitiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IImportEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 ImportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. - * @param message ImportEntitiesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IImportEntitiesRequest, 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 ImportEntitiesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ImportEntitiesRequest; + /** + * 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 ImportEntitiesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ImportEntitiesRequest; + /** + * 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 ImportEntitiesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies 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 ImportEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportEntitiesRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ImportEntitiesRequest; + /** + * 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 ImportEntitiesRequest message. Also converts values to other types if specified. - * @param message ImportEntitiesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ImportEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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 ImportEntitiesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an ExportEntitiesResponse. */ - interface IExportEntitiesResponse { + namespace UninterpretedOption { - /** ExportEntitiesResponse outputUrl */ - outputUrl?: (string|null); - } + /** Properties of a NamePart. */ + interface INamePart { - /** Represents an ExportEntitiesResponse. */ - class ExportEntitiesResponse implements IExportEntitiesResponse { + /** NamePart namePart */ + namePart: string; - /** - * Constructs a new ExportEntitiesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IExportEntitiesResponse); + /** NamePart isExtension */ + isExtension: boolean; + } - /** ExportEntitiesResponse outputUrl. */ - public outputUrl: string; + /** 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; - /** - * Creates a new ExportEntitiesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportEntitiesResponse instance - */ - public static create(properties?: google.datastore.admin.v1.IExportEntitiesResponse): google.datastore.admin.v1.ExportEntitiesResponse; + /** NamePart isExtension. */ + public isExtension: boolean; - /** - * Encodes the specified ExportEntitiesResponse message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. - * @param message ExportEntitiesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IExportEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 ExportEntitiesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. - * @param message ExportEntitiesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes an ExportEntitiesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportEntitiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesResponse; + /** + * 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 an ExportEntitiesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportEntitiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesResponse; + /** + * 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; - /** - * Verifies an ExportEntitiesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a 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; - /** - * Creates an ExportEntitiesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportEntitiesResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesResponse; + /** + * 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 plain object from an ExportEntitiesResponse message. Also converts values to other types if specified. - * @param message ExportEntitiesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ExportEntitiesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this ExportEntitiesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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 }; - /** Properties of an ExportEntitiesMetadata. */ - interface IExportEntitiesMetadata { + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** ExportEntitiesMetadata common */ - common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { - /** ExportEntitiesMetadata progressEntities */ - progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } - /** ExportEntitiesMetadata progressBytes */ - progressBytes?: (google.datastore.admin.v1.IProgress|null); + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { - /** ExportEntitiesMetadata entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); - /** ExportEntitiesMetadata outputUrlPrefix */ - outputUrlPrefix?: (string|null); - } + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; - /** Represents an ExportEntitiesMetadata. */ - class ExportEntitiesMetadata implements IExportEntitiesMetadata { + /** + * 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; - /** - * Constructs a new ExportEntitiesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IExportEntitiesMetadata); + /** + * 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; - /** ExportEntitiesMetadata common. */ - public common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** + * 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; - /** ExportEntitiesMetadata progressEntities. */ - public progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** + * 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; - /** ExportEntitiesMetadata progressBytes. */ - public progressBytes?: (google.datastore.admin.v1.IProgress|null); + /** + * 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; - /** ExportEntitiesMetadata entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** + * 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); - /** ExportEntitiesMetadata outputUrlPrefix. */ - public outputUrlPrefix: string; + /** + * 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 new ExportEntitiesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportEntitiesMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.IExportEntitiesMetadata): google.datastore.admin.v1.ExportEntitiesMetadata; + /** + * 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 }; - /** - * Encodes the specified ExportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. - * @param message ExportEntitiesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IExportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified ExportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. - * @param message ExportEntitiesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IExportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + namespace SourceCodeInfo { - /** - * Decodes an ExportEntitiesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ExportEntitiesMetadata; + /** Properties of a Location. */ + interface ILocation { - /** - * Decodes an ExportEntitiesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ExportEntitiesMetadata; + /** Location path */ + path?: (number[]|null); - /** - * Verifies an ExportEntitiesMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Location span */ + span?: (number[]|null); - /** - * Creates an ExportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportEntitiesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ExportEntitiesMetadata; + /** Location leadingComments */ + leadingComments?: (string|null); - /** - * Creates a plain object from an ExportEntitiesMetadata message. Also converts values to other types if specified. - * @param message ExportEntitiesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ExportEntitiesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Location trailingComments */ + trailingComments?: (string|null); - /** - * Converts this ExportEntitiesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } - /** Properties of an ImportEntitiesMetadata. */ - interface IImportEntitiesMetadata { + /** Represents a Location. */ + class Location implements ILocation { - /** ImportEntitiesMetadata common */ - common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - /** ImportEntitiesMetadata progressEntities */ - progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** Location path. */ + public path: number[]; - /** ImportEntitiesMetadata progressBytes */ - progressBytes?: (google.datastore.admin.v1.IProgress|null); + /** Location span. */ + public span: number[]; - /** ImportEntitiesMetadata entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** Location leadingComments. */ + public leadingComments: string; - /** ImportEntitiesMetadata inputUrl */ - inputUrl?: (string|null); - } + /** Location trailingComments. */ + public trailingComments: string; - /** Represents an ImportEntitiesMetadata. */ - class ImportEntitiesMetadata implements IImportEntitiesMetadata { + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; - /** - * Constructs a new ImportEntitiesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IImportEntitiesMetadata); + /** + * 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; - /** ImportEntitiesMetadata common. */ - public common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImportEntitiesMetadata progressEntities. */ - public progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImportEntitiesMetadata progressBytes. */ - public progressBytes?: (google.datastore.admin.v1.IProgress|null); + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - /** ImportEntitiesMetadata entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - /** ImportEntitiesMetadata inputUrl. */ - public inputUrl: string; + /** + * 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 new ImportEntitiesMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns ImportEntitiesMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.IImportEntitiesMetadata): google.datastore.admin.v1.ImportEntitiesMetadata; + /** + * 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; - /** - * Encodes the specified ImportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. - * @param message ImportEntitiesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IImportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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 }; - /** - * Encodes the specified ImportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. - * @param message ImportEntitiesMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IImportEntitiesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Decodes an ImportEntitiesMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ImportEntitiesMetadata; + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { - /** - * Decodes an ImportEntitiesMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ImportEntitiesMetadata; + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } - /** - * Verifies an ImportEntitiesMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { - /** - * Creates an ImportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImportEntitiesMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ImportEntitiesMetadata; + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); - /** - * Creates a plain object from an ImportEntitiesMetadata message. Also converts values to other types if specified. - * @param message ImportEntitiesMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ImportEntitiesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - /** - * Converts this ImportEntitiesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of an EntityFilter. */ - interface IEntityFilter { + /** + * 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; - /** EntityFilter kinds */ - kinds?: (string[]|null); + /** + * 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; - /** EntityFilter namespaceIds */ - namespaceIds?: (string[]|null); - } + /** + * 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; - /** Represents an EntityFilter. */ - class EntityFilter implements IEntityFilter { + /** + * 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; - /** - * Constructs a new EntityFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IEntityFilter); + /** + * 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); - /** EntityFilter kinds. */ - public kinds: string[]; + /** + * 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; - /** EntityFilter namespaceIds. */ - public namespaceIds: string[]; + /** + * 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 }; - /** - * Creates a new EntityFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityFilter instance - */ - public static create(properties?: google.datastore.admin.v1.IEntityFilter): google.datastore.admin.v1.EntityFilter; + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified EntityFilter message. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. - * @param message EntityFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IEntityFilter, writer?: $protobuf.Writer): $protobuf.Writer; + namespace GeneratedCodeInfo { - /** - * Encodes the specified EntityFilter message, length delimited. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. - * @param message EntityFilter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IEntityFilter, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of an Annotation. */ + interface IAnnotation { - /** - * Decodes an EntityFilter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.EntityFilter; + /** Annotation path */ + path?: (number[]|null); - /** - * Decodes an EntityFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.EntityFilter; + /** Annotation sourceFile */ + sourceFile?: (string|null); - /** - * Verifies an EntityFilter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Annotation begin */ + begin?: (number|null); - /** - * Creates an EntityFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityFilter - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.EntityFilter; + /** Annotation end */ + end?: (number|null); + } - /** - * Creates a plain object from an EntityFilter message. Also converts values to other types if specified. - * @param message EntityFilter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.EntityFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an Annotation. */ + class Annotation implements IAnnotation { - /** - * Converts this EntityFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - /** Properties of a CreateIndexRequest. */ - interface ICreateIndexRequest { + /** Annotation path. */ + public path: number[]; - /** CreateIndexRequest projectId */ - projectId?: (string|null); + /** Annotation sourceFile. */ + public sourceFile: string; - /** CreateIndexRequest index */ - index?: (google.datastore.admin.v1.IIndex|null); - } + /** Annotation begin. */ + public begin: number; - /** Represents a CreateIndexRequest. */ - class CreateIndexRequest implements ICreateIndexRequest { + /** Annotation end. */ + public end: number; - /** - * Constructs a new CreateIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.ICreateIndexRequest); + /** + * 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; - /** CreateIndexRequest projectId. */ - public projectId: string; + /** + * 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; - /** CreateIndexRequest index. */ - public index?: (google.datastore.admin.v1.IIndex|null); + /** + * 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; - /** - * Creates a new CreateIndexRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateIndexRequest instance - */ - public static create(properties?: google.datastore.admin.v1.ICreateIndexRequest): google.datastore.admin.v1.CreateIndexRequest; + /** + * 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; - /** - * Encodes the specified CreateIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. - * @param message CreateIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.ICreateIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Encodes the specified CreateIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. - * @param message CreateIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.ICreateIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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); - /** - * Decodes a CreateIndexRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.CreateIndexRequest; + /** + * 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 }; - /** - * Decodes a CreateIndexRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.CreateIndexRequest; + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Verifies a CreateIndexRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of an Any. */ + interface IAny { - /** - * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateIndexRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.CreateIndexRequest; + /** Any type_url */ + type_url?: (string|null); - /** - * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. - * @param message CreateIndexRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.CreateIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Any value */ + value?: (Uint8Array|string|null); + } - /** - * Converts this CreateIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents an Any. */ + class Any implements IAny { - /** Properties of a DeleteIndexRequest. */ - interface IDeleteIndexRequest { + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); - /** DeleteIndexRequest projectId */ - projectId?: (string|null); + /** Any type_url. */ + public type_url: string; - /** DeleteIndexRequest indexId */ - indexId?: (string|null); - } + /** Any value. */ + public value: (Uint8Array|string); - /** Represents a DeleteIndexRequest. */ - class DeleteIndexRequest implements IDeleteIndexRequest { + /** + * 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; - /** - * Constructs a new DeleteIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IDeleteIndexRequest); + /** + * 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; - /** DeleteIndexRequest projectId. */ - public projectId: string; + /** + * 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; - /** DeleteIndexRequest indexId. */ - public indexId: string; + /** + * 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; - /** - * Creates a new DeleteIndexRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteIndexRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IDeleteIndexRequest): google.datastore.admin.v1.DeleteIndexRequest; + /** + * 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; - /** - * Encodes the specified DeleteIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. - * @param message DeleteIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IDeleteIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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); - /** - * Encodes the specified DeleteIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. - * @param message DeleteIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IDeleteIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes a DeleteIndexRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.DeleteIndexRequest; + /** + * 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 }; - /** - * Decodes a DeleteIndexRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.DeleteIndexRequest; + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a DeleteIndexRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a Duration. */ + interface IDuration { - /** - * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteIndexRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.DeleteIndexRequest; + /** Duration seconds */ + seconds?: (number|Long|string|null); - /** - * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. - * @param message DeleteIndexRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.DeleteIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Duration nanos */ + nanos?: (number|null); + } - /** - * Converts this DeleteIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a Duration. */ + class Duration implements IDuration { - /** Properties of a GetIndexRequest. */ - interface IGetIndexRequest { + /** + * Constructs a new Duration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDuration); - /** GetIndexRequest projectId */ - projectId?: (string|null); + /** Duration seconds. */ + public seconds: (number|Long|string); - /** GetIndexRequest indexId */ - indexId?: (string|null); - } + /** Duration nanos. */ + public nanos: number; - /** Represents a GetIndexRequest. */ - class GetIndexRequest implements IGetIndexRequest { + /** + * 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; - /** - * Constructs a new GetIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IGetIndexRequest); + /** + * 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; - /** GetIndexRequest projectId. */ - public projectId: string; + /** + * 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; - /** GetIndexRequest indexId. */ - public indexId: string; + /** + * 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; - /** - * Creates a new GetIndexRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIndexRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IGetIndexRequest): google.datastore.admin.v1.GetIndexRequest; + /** + * 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; - /** - * Encodes the specified GetIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. - * @param message GetIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IGetIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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); - /** - * Encodes the specified GetIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. - * @param message GetIndexRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IGetIndexRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes a GetIndexRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.GetIndexRequest; + /** + * 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 }; - /** - * Decodes a GetIndexRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.GetIndexRequest; + /** + * Converts this Duration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a GetIndexRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of an Empty. */ + interface IEmpty { + } - /** - * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIndexRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.GetIndexRequest; + /** Represents an Empty. */ + class Empty implements IEmpty { - /** - * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. - * @param message GetIndexRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.GetIndexRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); - /** - * Converts this GetIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a ListIndexesRequest. */ - interface IListIndexesRequest { + /** + * 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; - /** ListIndexesRequest projectId */ - projectId?: (string|null); + /** + * 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; - /** ListIndexesRequest filter */ - filter?: (string|null); + /** + * 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; - /** ListIndexesRequest pageSize */ - pageSize?: (number|null); + /** + * 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; - /** ListIndexesRequest pageToken */ - pageToken?: (string|null); - } + /** + * 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); - /** Represents a ListIndexesRequest. */ - class ListIndexesRequest implements IListIndexesRequest { + /** + * 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; - /** - * Constructs a new ListIndexesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IListIndexesRequest); + /** + * 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 }; - /** ListIndexesRequest projectId. */ - public projectId: string; + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ListIndexesRequest filter. */ - public filter: string; + /** Properties of a Timestamp. */ + interface ITimestamp { - /** ListIndexesRequest pageSize. */ - public pageSize: number; + /** Timestamp seconds */ + seconds?: (number|Long|string|null); - /** ListIndexesRequest pageToken. */ - public pageToken: string; + /** Timestamp nanos */ + nanos?: (number|null); + } - /** - * Creates a new ListIndexesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListIndexesRequest instance - */ - public static create(properties?: google.datastore.admin.v1.IListIndexesRequest): google.datastore.admin.v1.ListIndexesRequest; + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { - /** - * Encodes the specified ListIndexesRequest message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. - * @param message ListIndexesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IListIndexesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); - /** - * Encodes the specified ListIndexesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. - * @param message ListIndexesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IListIndexesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Timestamp seconds. */ + public seconds: (number|Long|string); - /** - * Decodes a ListIndexesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListIndexesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ListIndexesRequest; + /** Timestamp nanos. */ + public nanos: number; - /** - * Decodes a ListIndexesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListIndexesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ListIndexesRequest; + /** + * 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; - /** - * Verifies a ListIndexesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified 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; - /** - * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListIndexesRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ListIndexesRequest; + /** + * 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; - /** - * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. - * @param message ListIndexesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ListIndexesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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; - /** - * Converts this ListIndexesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of a ListIndexesResponse. */ - interface IListIndexesResponse { + /** + * 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); - /** ListIndexesResponse indexes */ - indexes?: (google.datastore.admin.v1.IIndex[]|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; - /** ListIndexesResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** + * 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 }; - /** Represents a ListIndexesResponse. */ - class ListIndexesResponse implements IListIndexesResponse { + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new ListIndexesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IListIndexesResponse); + /** Properties of a Struct. */ + interface IStruct { - /** ListIndexesResponse indexes. */ - public indexes: google.datastore.admin.v1.IIndex[]; + /** Struct fields */ + fields?: ({ [k: string]: google.protobuf.IValue }|null); + } - /** ListIndexesResponse nextPageToken. */ - public nextPageToken: string; + /** Represents a Struct. */ + class Struct implements IStruct { - /** - * Creates a new ListIndexesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListIndexesResponse instance - */ - public static create(properties?: google.datastore.admin.v1.IListIndexesResponse): google.datastore.admin.v1.ListIndexesResponse; + /** + * Constructs a new Struct. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStruct); - /** - * Encodes the specified ListIndexesResponse message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. - * @param message ListIndexesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IListIndexesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Struct fields. */ + public fields: { [k: string]: google.protobuf.IValue }; - /** - * Encodes the specified ListIndexesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. - * @param message ListIndexesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IListIndexesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * 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; - /** - * Decodes a ListIndexesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListIndexesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.ListIndexesResponse; + /** + * 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; - /** - * Decodes a ListIndexesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListIndexesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.ListIndexesResponse; + /** + * 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; - /** - * Verifies a ListIndexesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a 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; - /** - * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListIndexesResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.ListIndexesResponse; + /** + * 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; - /** - * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. - * @param message ListIndexesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.ListIndexesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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); - /** - * Converts this ListIndexesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** Properties of an IndexOperationMetadata. */ - interface IIndexOperationMetadata { + /** + * 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 }; - /** IndexOperationMetadata common */ - common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** + * Converts this Struct to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** IndexOperationMetadata progressEntities */ - progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** Properties of a Value. */ + interface IValue { - /** IndexOperationMetadata indexId */ - indexId?: (string|null); - } + /** Value nullValue */ + nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - /** Represents an IndexOperationMetadata. */ - class IndexOperationMetadata implements IIndexOperationMetadata { + /** Value numberValue */ + numberValue?: (number|null); - /** - * Constructs a new IndexOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IIndexOperationMetadata); + /** Value stringValue */ + stringValue?: (string|null); - /** IndexOperationMetadata common. */ - public common?: (google.datastore.admin.v1.ICommonMetadata|null); + /** Value boolValue */ + boolValue?: (boolean|null); - /** IndexOperationMetadata progressEntities. */ - public progressEntities?: (google.datastore.admin.v1.IProgress|null); + /** Value structValue */ + structValue?: (google.protobuf.IStruct|null); - /** IndexOperationMetadata indexId. */ - public indexId: string; + /** Value listValue */ + listValue?: (google.protobuf.IListValue|null); + } - /** - * Creates a new IndexOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns IndexOperationMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.IIndexOperationMetadata): google.datastore.admin.v1.IndexOperationMetadata; + /** Represents a Value. */ + class Value implements IValue { - /** - * Encodes the specified IndexOperationMetadata message. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. - * @param message IndexOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IIndexOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IValue); - /** - * Encodes the specified IndexOperationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. - * @param message IndexOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IIndexOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** Value nullValue. */ + public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - /** - * Decodes an IndexOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndexOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.IndexOperationMetadata; + /** Value numberValue. */ + public numberValue?: (number|null); - /** - * Decodes an IndexOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndexOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.IndexOperationMetadata; + /** Value stringValue. */ + public stringValue?: (string|null); - /** - * Verifies an IndexOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Value boolValue. */ + public boolValue?: (boolean|null); - /** - * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.IndexOperationMetadata; + /** Value structValue. */ + public structValue?: (google.protobuf.IStruct|null); - /** - * Creates a plain object from an IndexOperationMetadata message. Also converts values to other types if specified. - * @param message IndexOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.IndexOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Value listValue. */ + public listValue?: (google.protobuf.IListValue|null); - /** - * Converts this IndexOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Value kind. */ + public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - /** Properties of a DatastoreFirestoreMigrationMetadata. */ - interface IDatastoreFirestoreMigrationMetadata { + /** + * 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; - /** DatastoreFirestoreMigrationMetadata migrationState */ - migrationState?: (google.datastore.admin.v1.MigrationState|null); + /** + * 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; - /** DatastoreFirestoreMigrationMetadata migrationStep */ - migrationStep?: (google.datastore.admin.v1.MigrationStep|null); - } + /** + * 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; - /** Represents a DatastoreFirestoreMigrationMetadata. */ - class DatastoreFirestoreMigrationMetadata implements IDatastoreFirestoreMigrationMetadata { + /** + * 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; - /** - * Constructs a new DatastoreFirestoreMigrationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata); + /** + * 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; - /** DatastoreFirestoreMigrationMetadata migrationState. */ - public migrationState: google.datastore.admin.v1.MigrationState; + /** + * 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); - /** DatastoreFirestoreMigrationMetadata migrationStep. */ - public migrationStep: google.datastore.admin.v1.MigrationStep; + /** + * 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 new DatastoreFirestoreMigrationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DatastoreFirestoreMigrationMetadata instance - */ - public static create(properties?: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; + /** + * 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 }; - /** - * Encodes the specified DatastoreFirestoreMigrationMetadata message. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. - * @param message DatastoreFirestoreMigrationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified DatastoreFirestoreMigrationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. - * @param message DatastoreFirestoreMigrationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** NullValue enum. */ + enum NullValue { + NULL_VALUE = 0 + } - /** - * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DatastoreFirestoreMigrationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; + /** Properties of a ListValue. */ + interface IListValue { - /** - * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DatastoreFirestoreMigrationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; + /** ListValue values */ + values?: (google.protobuf.IValue[]|null); + } - /** - * Verifies a DatastoreFirestoreMigrationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a ListValue. */ + class ListValue implements IListValue { - /** - * Creates a DatastoreFirestoreMigrationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DatastoreFirestoreMigrationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata; + /** + * Constructs a new ListValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IListValue); - /** - * Creates a plain object from a DatastoreFirestoreMigrationMetadata message. Also converts values to other types if specified. - * @param message DatastoreFirestoreMigrationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** 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; - /** - * Converts this DatastoreFirestoreMigrationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * 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; - /** OperationType enum. */ - enum OperationType { - OPERATION_TYPE_UNSPECIFIED = 0, - EXPORT_ENTITIES = 1, - IMPORT_ENTITIES = 2, - CREATE_INDEX = 3, - DELETE_INDEX = 4 - } + /** + * 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; - /** Properties of an Index. */ - interface IIndex { + /** + * 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; - /** Index projectId */ - projectId?: (string|null); + /** + * 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; - /** Index indexId */ - indexId?: (string|null); + /** + * 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); - /** Index kind */ - kind?: (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; - /** Index ancestor */ - ancestor?: (google.datastore.admin.v1.Index.AncestorMode|null); + /** + * 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 }; - /** Index properties */ - properties?: (google.datastore.admin.v1.Index.IIndexedProperty[]|null); + /** + * Converts this ListValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Index state */ - state?: (google.datastore.admin.v1.Index.State|null); - } + /** Properties of a DoubleValue. */ + interface IDoubleValue { - /** Represents an Index. */ - class Index implements IIndex { + /** DoubleValue value */ + value?: (number|null); + } - /** - * Constructs a new Index. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IIndex); + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { - /** Index projectId. */ - public projectId: string; + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); - /** Index indexId. */ - public indexId: string; + /** DoubleValue value. */ + public value: number; - /** Index kind. */ - public kind: string; + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; - /** Index ancestor. */ - public ancestor: google.datastore.admin.v1.Index.AncestorMode; + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** Index properties. */ - public properties: google.datastore.admin.v1.Index.IIndexedProperty[]; + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** Index state. */ - public state: google.datastore.admin.v1.Index.State; + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; - /** - * Creates a new Index instance using the specified properties. - * @param [properties] Properties to set - * @returns Index instance - */ - public static create(properties?: google.datastore.admin.v1.IIndex): google.datastore.admin.v1.Index; + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; - /** - * Encodes the specified Index message. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. - * @param message Index message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.IIndex, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified Index message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. - * @param message Index message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.IIndex, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - /** - * Decodes an Index message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Index - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Index; + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an Index message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Index - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Index; + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies an Index message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a FloatValue. */ + interface IFloatValue { - /** - * Creates an Index message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Index - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Index; + /** FloatValue value */ + value?: (number|null); + } - /** - * Creates a plain object from an Index message. Also converts values to other types if specified. - * @param message Index - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.Index, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { - /** - * Converts this Index to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; - namespace Index { + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; - /** AncestorMode enum. */ - enum AncestorMode { - ANCESTOR_MODE_UNSPECIFIED = 0, - NONE = 1, - ALL_ANCESTORS = 2 - } + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** Direction enum. */ - enum Direction { - DIRECTION_UNSPECIFIED = 0, - ASCENDING = 1, - DESCENDING = 2 - } + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an IndexedProperty. */ - interface IIndexedProperty { + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; - /** IndexedProperty name */ - name?: (string|null); + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; - /** IndexedProperty direction */ - direction?: (google.datastore.admin.v1.Index.Direction|null); - } + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents an IndexedProperty. */ - class IndexedProperty implements IIndexedProperty { + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - /** - * Constructs a new IndexedProperty. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.Index.IIndexedProperty); + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** IndexedProperty name. */ - public name: string; + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** IndexedProperty direction. */ - public direction: google.datastore.admin.v1.Index.Direction; + /** Properties of an Int64Value. */ + interface IInt64Value { - /** - * Creates a new IndexedProperty instance using the specified properties. - * @param [properties] Properties to set - * @returns IndexedProperty instance - */ - public static create(properties?: google.datastore.admin.v1.Index.IIndexedProperty): google.datastore.admin.v1.Index.IndexedProperty; + /** Int64Value value */ + value?: (number|Long|string|null); + } - /** - * Encodes the specified IndexedProperty message. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. - * @param message IndexedProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.admin.v1.Index.IIndexedProperty, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { - /** - * Encodes the specified IndexedProperty message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. - * @param message IndexedProperty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.admin.v1.Index.IIndexedProperty, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); - /** - * Decodes an IndexedProperty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IndexedProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.admin.v1.Index.IndexedProperty; + /** Int64Value value. */ + public value: (number|Long|string); - /** - * Decodes an IndexedProperty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IndexedProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.admin.v1.Index.IndexedProperty; + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - /** - * Verifies an IndexedProperty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an IndexedProperty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IndexedProperty - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Index.IndexedProperty; + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an IndexedProperty message. Also converts values to other types if specified. - * @param message IndexedProperty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.Index.IndexedProperty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; - /** - * Converts this IndexedProperty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - DELETING = 3, - ERROR = 4 - } - } - } - } - } + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Namespace type. */ - namespace type { + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - /** Properties of a LatLng. */ - interface ILatLng { + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** LatLng latitude */ - latitude?: (number|null); + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** LatLng longitude */ - longitude?: (number|null); + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); } - /** Represents a LatLng. */ - class LatLng implements ILatLng { + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { /** - * Constructs a new LatLng. + * Constructs a new UInt64Value. * @param [properties] Properties to set */ - constructor(properties?: google.type.ILatLng); - - /** LatLng latitude. */ - public latitude: number; + constructor(properties?: google.protobuf.IUInt64Value); - /** LatLng longitude. */ - public longitude: number; + /** UInt64Value value. */ + public value: (number|Long|string); /** - * Creates a new LatLng instance using the specified properties. + * Creates a new UInt64Value instance using the specified properties. * @param [properties] Properties to set - * @returns LatLng instance + * @returns UInt64Value instance */ - public static create(properties?: google.type.ILatLng): google.type.LatLng; + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; /** - * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. - * @param message LatLng message or plain object to encode + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. - * @param message LatLng message or plain object to encode + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LatLng message from the specified reader or buffer. + * Decodes a UInt64Value message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LatLng + * @returns UInt64Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.LatLng; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; /** - * Decodes a LatLng message from the specified reader or buffer, length delimited. + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LatLng + * @returns UInt64Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.LatLng; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; /** - * Verifies a LatLng message. + * Verifies a UInt64Value message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LatLng + * @returns UInt64Value */ - public static fromObject(object: { [k: string]: any }): google.type.LatLng; + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. - * @param message LatLng + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LatLng to JSON. + * Converts this UInt64Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - - /** 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 - } - - /** Properties of a Http. */ - interface IHttp { - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); + /** Properties of an Int32Value. */ + interface IInt32Value { - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); + /** Int32Value value */ + value?: (number|null); } - /** Represents a Http. */ - class Http implements IHttp { + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { /** - * Constructs a new Http. + * Constructs a new Int32Value. * @param [properties] Properties to set */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; + constructor(properties?: google.protobuf.IInt32Value); - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; + /** Int32Value value. */ + public value: number; /** - * Creates a new Http instance using the specified properties. + * Creates a new Int32Value instance using the specified properties. * @param [properties] Properties to set - * @returns Http instance + * @returns Int32Value instance */ - public static create(properties?: google.api.IHttp): google.api.Http; + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes an Int32Value message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Http + * @returns Int32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes an Int32Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Http + * @returns Int32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; /** - * Verifies a Http message. + * Verifies an Int32Value message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Http + * @returns Int32Value */ - public static fromObject(object: { [k: string]: any }): google.api.Http; + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Http to JSON. + * Converts this Int32Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); + /** Properties of a UInt32Value. */ + interface IUInt32Value { - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); + /** UInt32Value value */ + value?: (number|null); } - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { /** - * Constructs a new HttpRule. + * Constructs a new UInt32Value. * @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[]; + constructor(properties?: google.protobuf.IUInt32Value); - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + /** UInt32Value value. */ + public value: number; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new UInt32Value instance using the specified properties. * @param [properties] Properties to set - * @returns HttpRule instance + * @returns UInt32Value instance */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a UInt32Value message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns HttpRule + * @returns UInt32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns HttpRule + * @returns UInt32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; /** - * Verifies a HttpRule message. + * Verifies a UInt32Value message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns HttpRule + * @returns UInt32Value */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this HttpRule to JSON. + * Converts this UInt32Value to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); + /** Properties of a BoolValue. */ + interface IBoolValue { - /** CustomHttpPattern path */ - path?: (string|null); + /** BoolValue value */ + value?: (boolean|null); } - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { /** - * Constructs a new CustomHttpPattern. + * Constructs a new BoolValue. * @param [properties] Properties to set */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; + constructor(properties?: google.protobuf.IBoolValue); - /** CustomHttpPattern path. */ - public path: string; + /** BoolValue value. */ + public value: boolean; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new BoolValue instance using the specified properties. * @param [properties] Properties to set - * @returns CustomHttpPattern instance + * @returns BoolValue instance */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a BoolValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CustomHttpPattern + * @returns BoolValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a BoolValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern + * @returns BoolValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; /** - * Verifies a CustomHttpPattern message. + * Verifies a BoolValue message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CustomHttpPattern + * @returns BoolValue */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this BoolValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); + /** Properties of a StringValue. */ + interface IStringValue { - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); + /** StringValue value */ + value?: (string|null); } - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { + /** Represents a StringValue. */ + class StringValue implements IStringValue { /** - * Constructs a new ResourceDescriptor. + * Constructs a new StringValue. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: google.api.ResourceDescriptor.History; - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; + constructor(properties?: google.protobuf.IStringValue); - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; + /** StringValue value. */ + public value: string; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new StringValue instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceDescriptor instance + * @returns StringValue instance */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a StringValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceDescriptor + * @returns StringValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a StringValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor + * @returns StringValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; /** - * Verifies a ResourceDescriptor message. + * Verifies a StringValue message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceDescriptor + * @returns StringValue */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this StringValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); + /** Properties of a BytesValue. */ + interface IBytesValue { - /** ResourceReference childType */ - childType?: (string|null); + /** BytesValue value */ + value?: (Uint8Array|string|null); } - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { /** - * Constructs a new ResourceReference. + * Constructs a new BytesValue. * @param [properties] Properties to set */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; + constructor(properties?: google.protobuf.IBytesValue); - /** ResourceReference childType. */ - public childType: string; + /** BytesValue value. */ + public value: (Uint8Array|string); /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new BytesValue instance using the specified properties. * @param [properties] Properties to set - * @returns ResourceReference instance + * @returns BytesValue instance */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a BytesValue message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourceReference + * @returns BytesValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a BytesValue message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourceReference + * @returns BytesValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; /** - * Verifies a ResourceReference message. + * Verifies a BytesValue message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourceReference + * @returns BytesValue */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourceReference to JSON. + * Converts this BytesValue to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -13626,307 +12519,104 @@ export namespace google { public toJSON(): { [k: string]: any }; } } -} -/** Properties of a Reference. */ -export interface IReference { + /** Namespace type. */ + namespace type { - /** Reference app */ - app: string; + /** Properties of a LatLng. */ + interface ILatLng { - /** Reference namespace */ - namespace?: (string|null); + /** LatLng latitude */ + latitude?: (number|null); - /** Reference path */ - path: IPath; + /** LatLng longitude */ + longitude?: (number|null); + } - /** Reference databaseId */ - databaseId?: (string|null); -} + /** Represents a LatLng. */ + class LatLng implements ILatLng { -/** Represents a Reference. */ -export class Reference implements IReference { - - /** - * Constructs a new Reference. - * @param [properties] Properties to set - */ - constructor(properties?: IReference); - - /** Reference app. */ - public app: string; - - /** Reference namespace. */ - public namespace: string; - - /** Reference path. */ - public path: IPath; - - /** Reference databaseId. */ - public databaseId: string; - - /** - * Creates a new Reference instance using the specified properties. - * @param [properties] Properties to set - * @returns Reference instance - */ - public static create(properties?: IReference): Reference; - - /** - * Encodes the specified Reference message. Does not implicitly {@link Reference.verify|verify} messages. - * @param message Reference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Reference message, length delimited. Does not implicitly {@link Reference.verify|verify} messages. - * @param message Reference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Reference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Reference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Reference; - - /** - * Decodes a Reference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Reference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Reference; - - /** - * Verifies a Reference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Reference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Reference - */ - public static fromObject(object: { [k: string]: any }): Reference; - - /** - * Creates a plain object from a Reference message. Also converts values to other types if specified. - * @param message Reference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: Reference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Reference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} + /** + * Constructs a new LatLng. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILatLng); -/** Properties of a Path. */ -export interface IPath { + /** LatLng latitude. */ + public latitude: number; - /** Path element */ - element?: (Path.IElement[]|null); -} + /** LatLng longitude. */ + public longitude: number; -/** Represents a Path. */ -export class Path implements IPath { - - /** - * Constructs a new Path. - * @param [properties] Properties to set - */ - constructor(properties?: IPath); - - /** Path element. */ - public element: Path.IElement[]; - - /** - * Creates a new Path instance using the specified properties. - * @param [properties] Properties to set - * @returns Path instance - */ - public static create(properties?: IPath): Path; - - /** - * Encodes the specified Path message. Does not implicitly {@link Path.verify|verify} messages. - * @param message Path message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: IPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Path message, length delimited. Does not implicitly {@link Path.verify|verify} messages. - * @param message Path message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: IPath, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Path message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Path - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Path; - - /** - * Decodes a Path message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Path - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Path; - - /** - * Verifies a Path message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Path message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Path - */ - public static fromObject(object: { [k: string]: any }): Path; - - /** - * Creates a plain object from a Path message. Also converts values to other types if specified. - * @param message Path - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: Path, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Path to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; -} + /** + * Creates a new LatLng instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLng instance + */ + public static create(properties?: google.type.ILatLng): google.type.LatLng; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; -export namespace Path { + /** + * Decodes a LatLng message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLng + * @throws {Error} If the payload is not 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.LatLng; - /** Properties of an Element. */ - interface IElement { + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLng + * @throws {Error} If the payload 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.LatLng; - /** Element type */ - type: string; + /** + * Verifies a LatLng message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Element id */ - id?: (number|Long|null); + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLng + */ + public static fromObject(object: { [k: string]: any }): google.type.LatLng; - /** Element name */ - name?: (string|null); - } + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents an Element. */ - class Element implements IElement { - - /** - * Constructs a new Element. - * @param [properties] Properties to set - */ - constructor(properties?: Path.IElement); - - /** Element type. */ - public type: string; - - /** Element id. */ - public id: (number|Long); - - /** Element name. */ - public name: string; - - /** - * Creates a new Element instance using the specified properties. - * @param [properties] Properties to set - * @returns Element instance - */ - public static create(properties?: Path.IElement): Path.Element; - - /** - * Encodes the specified Element message. Does not implicitly {@link Path.Element.verify|verify} messages. - * @param message Element message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: Path.IElement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Element message, length delimited. Does not implicitly {@link Path.Element.verify|verify} messages. - * @param message Element message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: Path.IElement, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Element message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Element - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Path.Element; - - /** - * Decodes an Element message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Element - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Path.Element; - - /** - * Verifies an Element message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Element message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Element - */ - public static fromObject(object: { [k: string]: any }): Path.Element; - - /** - * Creates a plain object from an Element message. Also converts values to other types if specified. - * @param message Element - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: Path.Element, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Element to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this LatLng to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } diff --git a/protos/protos.js b/protos/protos.js index db72d5d00..58051ce19 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -1,3 +1,17 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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 */ @@ -5,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("protobufjs/minimal")); + module.exports = factory(require("google-gax").protobufMinimal); })(this, function($protobuf) { "use strict"; @@ -14,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + var $root = $protobuf.roots._google_cloud_datastore_protos || ($protobuf.roots._google_cloud_datastore_protos = {}); $root.google = (function() { @@ -25,12150 +39,7894 @@ */ var google = {}; - google.protobuf = (function() { + google.datastore = (function() { /** - * Namespace protobuf. + * Namespace datastore. * @memberof google * @namespace */ - var protobuf = {}; + var datastore = {}; - protobuf.Struct = (function() { + datastore.admin = (function() { /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields + * Namespace admin. + * @memberof google.datastore + * @namespace */ + var admin = {}; - /** - * 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]]; - } + admin.v1 = (function() { - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; + /** + * Namespace v1. + * @memberof google.datastore.admin + * @namespace + */ + var v1 = {}; - /** - * 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); - }; + v1.DatastoreAdmin = (function() { - /** - * 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(); + /** + * Constructs a new DatastoreAdmin service. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a DatastoreAdmin + * @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 DatastoreAdmin(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - 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(); - }; + (DatastoreAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatastoreAdmin; - /** - * 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) { - 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(); - 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; - }; + /** + * Creates new DatastoreAdmin service using the specified rpc implementation. + * @function create + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @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 {DatastoreAdmin} RPC service. Useful where requests and/or responses are streamed. + */ + DatastoreAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * 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()); - }; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#exportEntities}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef ExportEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * 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; - }; + /** + * Calls ExportEntities. + * @function exportEntities + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IExportEntitiesRequest} request ExportEntitiesRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.ExportEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.exportEntities = function exportEntities(request, callback) { + return this.rpcCall(exportEntities, $root.google.datastore.admin.v1.ExportEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportEntities" }); - /** - * 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; - }; + /** + * Calls ExportEntities. + * @function exportEntities + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IExportEntitiesRequest} request ExportEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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; - }; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#importEntities}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef ImportEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * 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); - }; + /** + * Calls ImportEntities. + * @function importEntities + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IImportEntitiesRequest} request ImportEntitiesRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.ImportEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.importEntities = function importEntities(request, callback) { + return this.rpcCall(importEntities, $root.google.datastore.admin.v1.ImportEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportEntities" }); - return Struct; - })(); + /** + * Calls ImportEntities. + * @function importEntities + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IImportEntitiesRequest} request ImportEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - protobuf.Value = (function() { + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#createIndex}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef CreateIndexCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * 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 - */ + /** + * Calls CreateIndex. + * @function createIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.ICreateIndexRequest} request CreateIndexRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.CreateIndexCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.createIndex = function createIndex(request, callback) { + return this.rpcCall(createIndex, $root.google.datastore.admin.v1.CreateIndexRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateIndex" }); - /** - * 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]]; - } + /** + * Calls CreateIndex. + * @function createIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.ICreateIndexRequest} request CreateIndexRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#deleteIndex}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef DeleteIndexCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; + /** + * Calls DeleteIndex. + * @function deleteIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IDeleteIndexRequest} request DeleteIndexRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.DeleteIndexCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.deleteIndex = function deleteIndex(request, callback) { + return this.rpcCall(deleteIndex, $root.google.datastore.admin.v1.DeleteIndexRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteIndex" }); - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; + /** + * Calls DeleteIndex. + * @function deleteIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IDeleteIndexRequest} request DeleteIndexRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#getIndex}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef GetIndexCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.admin.v1.Index} [response] Index + */ - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; + /** + * Calls GetIndex. + * @function getIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IGetIndexRequest} request GetIndexRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.GetIndexCallback} callback Node-style callback called with the error, if any, and Index + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.getIndex = function getIndex(request, callback) { + return this.rpcCall(getIndex, $root.google.datastore.admin.v1.GetIndexRequest, $root.google.datastore.admin.v1.Index, request, callback); + }, "name", { value: "GetIndex" }); - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; + /** + * Calls GetIndex. + * @function getIndex + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IGetIndexRequest} request GetIndexRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#listIndexes}. + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @typedef ListIndexesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.admin.v1.ListIndexesResponse} [response] ListIndexesResponse + */ - /** - * 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) - }); + /** + * Calls ListIndexes. + * @function listIndexes + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IListIndexesRequest} request ListIndexesRequest message or plain object + * @param {google.datastore.admin.v1.DatastoreAdmin.ListIndexesCallback} callback Node-style callback called with the error, if any, and ListIndexesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DatastoreAdmin.prototype.listIndexes = function listIndexes(request, callback) { + return this.rpcCall(listIndexes, $root.google.datastore.admin.v1.ListIndexesRequest, $root.google.datastore.admin.v1.ListIndexesResponse, request, callback); + }, "name", { value: "ListIndexes" }); - /** - * 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; - }; + /** + * Calls ListIndexes. + * @function listIndexes + * @memberof google.datastore.admin.v1.DatastoreAdmin + * @instance + * @param {google.datastore.admin.v1.IListIndexesRequest} request ListIndexesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * 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(); - }; + return DatastoreAdmin; + })(); - /** - * 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) { - 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(); - 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; - }; + v1.CommonMetadata = (function() { - /** - * 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()); - }; + /** + * Properties of a CommonMetadata. + * @memberof google.datastore.admin.v1 + * @interface ICommonMetadata + * @property {google.protobuf.ITimestamp|null} [startTime] CommonMetadata startTime + * @property {google.protobuf.ITimestamp|null} [endTime] CommonMetadata endTime + * @property {google.datastore.admin.v1.OperationType|null} [operationType] CommonMetadata operationType + * @property {Object.|null} [labels] CommonMetadata labels + * @property {google.datastore.admin.v1.CommonMetadata.State|null} [state] CommonMetadata state + */ - /** - * 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; + /** + * Constructs a new CommonMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a CommonMetadata. + * @implements ICommonMetadata + * @constructor + * @param {google.datastore.admin.v1.ICommonMetadata=} [properties] Properties to set + */ + function CommonMetadata(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]]; } - } - 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) { - 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; - }; + /** + * CommonMetadata startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.startTime = null; - /** - * 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] : 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; - }; + /** + * CommonMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.endTime = null; - /** - * 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); - }; + /** + * CommonMetadata operationType. + * @member {google.datastore.admin.v1.OperationType} operationType + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.operationType = 0; - return Value; - })(); + /** + * CommonMetadata labels. + * @member {Object.} labels + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.labels = $util.emptyObject; - /** - * 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; - })(); + /** + * CommonMetadata state. + * @member {google.datastore.admin.v1.CommonMetadata.State} state + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + */ + CommonMetadata.prototype.state = 0; - protobuf.ListValue = (function() { + /** + * Creates a new CommonMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {google.datastore.admin.v1.ICommonMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata instance + */ + CommonMetadata.create = function create(properties) { + return new CommonMetadata(properties); + }; - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ + /** + * Encodes the specified CommonMetadata message. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {google.datastore.admin.v1.ICommonMetadata} message CommonMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonMetadata.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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operationType); + 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(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + return writer; + }; - /** - * 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]]; - } + /** + * Encodes the specified CommonMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {google.datastore.admin.v1.ICommonMetadata} message CommonMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CommonMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; + /** + * Decodes a CommonMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.CommonMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.operationType = reader.int32(); + 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; + case 5: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes a CommonMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CommonMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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(); - }; + /** + * Verifies a CommonMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CommonMetadata.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.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.operationType != null && message.hasOwnProperty("operationType")) + switch (message.operationType) { + default: + return "operationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + 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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; - /** - * 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) { - 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(); - 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; - }; + /** + * Creates a CommonMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata + */ + CommonMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.CommonMetadata) + return object; + var message = new $root.google.datastore.admin.v1.CommonMetadata(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.datastore.admin.v1.CommonMetadata.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.datastore.admin.v1.CommonMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.operationType) { + case "OPERATION_TYPE_UNSPECIFIED": + case 0: + message.operationType = 0; + break; + case "EXPORT_ENTITIES": + case 1: + message.operationType = 1; + break; + case "IMPORT_ENTITIES": + case 2: + message.operationType = 2; + break; + case "CREATE_INDEX": + case 3: + message.operationType = 3; + break; + case "DELETE_INDEX": + case 4: + message.operationType = 4; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.datastore.admin.v1.CommonMetadata.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.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "INITIALIZING": + case 1: + message.state = 1; + break; + case "PROCESSING": + case 2: + message.state = 2; + break; + case "CANCELLING": + case 3: + message.state = 3; + break; + case "FINALIZING": + case 4: + message.state = 4; + break; + case "SUCCESSFUL": + case 5: + message.state = 5; + break; + case "FAILED": + case 6: + message.state = 6; + break; + case "CANCELLED": + case 7: + message.state = 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()); - }; + /** + * Creates a plain object from a CommonMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.CommonMetadata + * @static + * @param {google.datastore.admin.v1.CommonMetadata} message CommonMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CommonMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.operationType = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.operationType != null && message.hasOwnProperty("operationType")) + object.operationType = options.enums === String ? $root.google.datastore.admin.v1.OperationType[message.operationType] : message.operationType; + 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.datastore.admin.v1.CommonMetadata.State[message.state] : message.state; + return object; + }; - /** - * 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; - }; + /** + * Converts this CommonMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.CommonMetadata + * @instance + * @returns {Object.} JSON object + */ + CommonMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + /** + * State enum. + * @name google.datastore.admin.v1.CommonMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} INITIALIZING=1 INITIALIZING value + * @property {number} PROCESSING=2 PROCESSING value + * @property {number} CANCELLING=3 CANCELLING value + * @property {number} FINALIZING=4 FINALIZING value + * @property {number} SUCCESSFUL=5 SUCCESSFUL value + * @property {number} FAILED=6 FAILED value + * @property {number} CANCELLED=7 CANCELLED value + */ + CommonMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INITIALIZING"] = 1; + values[valuesById[2] = "PROCESSING"] = 2; + values[valuesById[3] = "CANCELLING"] = 3; + values[valuesById[4] = "FINALIZING"] = 4; + values[valuesById[5] = "SUCCESSFUL"] = 5; + values[valuesById[6] = "FAILED"] = 6; + values[valuesById[7] = "CANCELLED"] = 7; + return values; + })(); - /** - * 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); - }; + return CommonMetadata; + })(); - return ListValue; - })(); + v1.Progress = (function() { - protobuf.Timestamp = (function() { + /** + * Properties of a Progress. + * @memberof google.datastore.admin.v1 + * @interface IProgress + * @property {number|Long|null} [workCompleted] Progress workCompleted + * @property {number|Long|null} [workEstimated] Progress workEstimated + */ - /** - * 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 Progress. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a Progress. + * @implements IProgress + * @constructor + * @param {google.datastore.admin.v1.IProgress=} [properties] Properties to set + */ + function Progress(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * 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]]; - } + /** + * Progress workCompleted. + * @member {number|Long} workCompleted + * @memberof google.datastore.admin.v1.Progress + * @instance + */ + Progress.prototype.workCompleted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Progress workEstimated. + * @member {number|Long} workEstimated + * @memberof google.datastore.admin.v1.Progress + * @instance + */ + Progress.prototype.workEstimated = $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 Progress instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {google.datastore.admin.v1.IProgress=} [properties] Properties to set + * @returns {google.datastore.admin.v1.Progress} Progress instance + */ + Progress.create = function create(properties) { + return new Progress(properties); + }; - /** - * 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 Progress message. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {google.datastore.admin.v1.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.workCompleted != null && Object.hasOwnProperty.call(message, "workCompleted")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.workCompleted); + if (message.workEstimated != null && Object.hasOwnProperty.call(message, "workEstimated")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.workEstimated); + return writer; + }; - /** - * 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 Progress message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {google.datastore.admin.v1.IProgress} message Progress message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Progress.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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 Progress message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Progress(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.workCompleted = reader.int64(); + break; + case 2: + message.workEstimated = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a Progress message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.Progress} Progress + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Progress.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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 Progress message. + * @function verify + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Progress.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.workCompleted != null && message.hasOwnProperty("workCompleted")) + if (!$util.isInteger(message.workCompleted) && !(message.workCompleted && $util.isInteger(message.workCompleted.low) && $util.isInteger(message.workCompleted.high))) + return "workCompleted: integer|Long expected"; + if (message.workEstimated != null && message.hasOwnProperty("workEstimated")) + if (!$util.isInteger(message.workEstimated) && !(message.workEstimated && $util.isInteger(message.workEstimated.low) && $util.isInteger(message.workEstimated.high))) + return "workEstimated: integer|Long expected"; + return null; + }; - /** - * 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 Progress message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.Progress} Progress + */ + Progress.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.Progress) + return object; + var message = new $root.google.datastore.admin.v1.Progress(); + if (object.workCompleted != null) + if ($util.Long) + (message.workCompleted = $util.Long.fromValue(object.workCompleted)).unsigned = false; + else if (typeof object.workCompleted === "string") + message.workCompleted = parseInt(object.workCompleted, 10); + else if (typeof object.workCompleted === "number") + message.workCompleted = object.workCompleted; + else if (typeof object.workCompleted === "object") + message.workCompleted = new $util.LongBits(object.workCompleted.low >>> 0, object.workCompleted.high >>> 0).toNumber(); + if (object.workEstimated != null) + if ($util.Long) + (message.workEstimated = $util.Long.fromValue(object.workEstimated)).unsigned = false; + else if (typeof object.workEstimated === "string") + message.workEstimated = parseInt(object.workEstimated, 10); + else if (typeof object.workEstimated === "number") + message.workEstimated = object.workEstimated; + else if (typeof object.workEstimated === "object") + message.workEstimated = new $util.LongBits(object.workEstimated.low >>> 0, object.workEstimated.high >>> 0).toNumber(); + return message; + }; - /** - * 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 Progress message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.Progress + * @static + * @param {google.datastore.admin.v1.Progress} message Progress + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Progress.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.workCompleted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.workCompleted = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.workEstimated = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.workEstimated = options.longs === String ? "0" : 0; + } + if (message.workCompleted != null && message.hasOwnProperty("workCompleted")) + if (typeof message.workCompleted === "number") + object.workCompleted = options.longs === String ? String(message.workCompleted) : message.workCompleted; + else + object.workCompleted = options.longs === String ? $util.Long.prototype.toString.call(message.workCompleted) : options.longs === Number ? new $util.LongBits(message.workCompleted.low >>> 0, message.workCompleted.high >>> 0).toNumber() : message.workCompleted; + if (message.workEstimated != null && message.hasOwnProperty("workEstimated")) + if (typeof message.workEstimated === "number") + object.workEstimated = options.longs === String ? String(message.workEstimated) : message.workEstimated; + else + object.workEstimated = options.longs === String ? $util.Long.prototype.toString.call(message.workEstimated) : options.longs === Number ? new $util.LongBits(message.workEstimated.low >>> 0, message.workEstimated.high >>> 0).toNumber() : message.workEstimated; + return object; + }; - /** - * 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 Progress to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.Progress + * @instance + * @returns {Object.} JSON object + */ + Progress.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Progress; + })(); - return Timestamp; - })(); + v1.ExportEntitiesRequest = (function() { - protobuf.FileDescriptorSet = (function() { + /** + * Properties of an ExportEntitiesRequest. + * @memberof google.datastore.admin.v1 + * @interface IExportEntitiesRequest + * @property {string|null} [projectId] ExportEntitiesRequest projectId + * @property {Object.|null} [labels] ExportEntitiesRequest labels + * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ExportEntitiesRequest entityFilter + * @property {string|null} [outputUrlPrefix] ExportEntitiesRequest outputUrlPrefix + */ - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ + /** + * Constructs a new ExportEntitiesRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ExportEntitiesRequest. + * @implements IExportEntitiesRequest + * @constructor + * @param {google.datastore.admin.v1.IExportEntitiesRequest=} [properties] Properties to set + */ + function ExportEntitiesRequest(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]]; + } - /** - * 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]]; - } + /** + * ExportEntitiesRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + */ + ExportEntitiesRequest.prototype.projectId = ""; - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; + /** + * ExportEntitiesRequest labels. + * @member {Object.} labels + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + */ + ExportEntitiesRequest.prototype.labels = $util.emptyObject; - /** - * 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); - }; + /** + * ExportEntitiesRequest entityFilter. + * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + */ + ExportEntitiesRequest.prototype.entityFilter = null; - /** - * 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; - }; + /** + * ExportEntitiesRequest outputUrlPrefix. + * @member {string} outputUrlPrefix + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + */ + ExportEntitiesRequest.prototype.outputUrlPrefix = ""; - /** - * 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(); - }; + /** + * Creates a new ExportEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IExportEntitiesRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest instance + */ + ExportEntitiesRequest.create = function create(properties) { + return new ExportEntitiesRequest(properties); + }; - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified ExportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IExportEntitiesRequest} message ExportEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesRequest.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.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.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) + $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputUrlPrefix != null && Object.hasOwnProperty.call(message, "outputUrlPrefix")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputUrlPrefix); + return writer; + }; - /** - * 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()); - }; + /** + * Encodes the specified ExportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IExportEntitiesRequest} message ExportEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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; - }; + /** + * Decodes an ExportEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = 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.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); + break; + case 4: + message.outputUrlPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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; - }; + /** + * Decodes an ExportEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; - }; + /** + * Verifies an ExportEntitiesRequest message. + * @function verify + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntitiesRequest.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.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.entityFilter != null && message.hasOwnProperty("entityFilter")) { + var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); + if (error) + return "entityFilter." + error; + } + if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) + if (!$util.isString(message.outputUrlPrefix)) + return "outputUrlPrefix: string expected"; + return null; + }; - /** - * 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); - }; + /** + * Creates an ExportEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest + */ + ExportEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesRequest) + return object; + var message = new $root.google.datastore.admin.v1.ExportEntitiesRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesRequest.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.entityFilter != null) { + if (typeof object.entityFilter !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesRequest.entityFilter: object expected"); + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); + } + if (object.outputUrlPrefix != null) + message.outputUrlPrefix = String(object.outputUrlPrefix); + return message; + }; - return FileDescriptorSet; - })(); + /** + * Creates a plain object from an ExportEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.ExportEntitiesRequest} message ExportEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.projectId = ""; + object.entityFilter = null; + object.outputUrlPrefix = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + 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.entityFilter != null && message.hasOwnProperty("entityFilter")) + object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); + if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) + object.outputUrlPrefix = message.outputUrlPrefix; + return object; + }; - protobuf.FileDescriptorProto = (function() { + /** + * Converts this ExportEntitiesRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ExportEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + ExportEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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 - */ + return ExportEntitiesRequest; + })(); - /** - * 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]]; - } + v1.ImportEntitiesRequest = (function() { - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; + /** + * Properties of an ImportEntitiesRequest. + * @memberof google.datastore.admin.v1 + * @interface IImportEntitiesRequest + * @property {string|null} [projectId] ImportEntitiesRequest projectId + * @property {Object.|null} [labels] ImportEntitiesRequest labels + * @property {string|null} [inputUrl] ImportEntitiesRequest inputUrl + * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ImportEntitiesRequest entityFilter + */ - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; + /** + * Constructs a new ImportEntitiesRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ImportEntitiesRequest. + * @implements IImportEntitiesRequest + * @constructor + * @param {google.datastore.admin.v1.IImportEntitiesRequest=} [properties] Properties to set + */ + function ImportEntitiesRequest(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]]; + } - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; + /** + * ImportEntitiesRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + */ + ImportEntitiesRequest.prototype.projectId = ""; - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + /** + * ImportEntitiesRequest labels. + * @member {Object.} labels + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + */ + ImportEntitiesRequest.prototype.labels = $util.emptyObject; - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + /** + * ImportEntitiesRequest inputUrl. + * @member {string} inputUrl + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + */ + ImportEntitiesRequest.prototype.inputUrl = ""; - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; + /** + * ImportEntitiesRequest entityFilter. + * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + */ + ImportEntitiesRequest.prototype.entityFilter = null; - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; + /** + * Creates a new ImportEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IImportEntitiesRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest instance + */ + ImportEntitiesRequest.create = function create(properties) { + return new ImportEntitiesRequest(properties); + }; - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; + /** + * Encodes the specified ImportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IImportEntitiesRequest} message ImportEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntitiesRequest.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.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.inputUrl != null && Object.hasOwnProperty.call(message, "inputUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.inputUrl); + if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) + $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; + /** + * Encodes the specified ImportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.IImportEntitiesRequest} message ImportEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; + /** + * Decodes an ImportEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ImportEntitiesRequest(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = 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.inputUrl = reader.string(); + break; + case 4: + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; + /** + * Decodes an ImportEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; + /** + * Verifies an ImportEntitiesRequest message. + * @function verify + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntitiesRequest.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.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.inputUrl != null && message.hasOwnProperty("inputUrl")) + if (!$util.isString(message.inputUrl)) + return "inputUrl: string expected"; + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { + var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); + if (error) + return "entityFilter." + error; + } + return null; + }; - /** - * 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); - }; + /** + * Creates an ImportEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest + */ + ImportEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesRequest) + return object; + var message = new $root.google.datastore.admin.v1.ImportEntitiesRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesRequest.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.inputUrl != null) + message.inputUrl = String(object.inputUrl); + if (object.entityFilter != null) { + if (typeof object.entityFilter !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesRequest.entityFilter: object expected"); + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); + } + return message; + }; - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - return writer; - }; + /** + * Creates a plain object from an ImportEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @static + * @param {google.datastore.admin.v1.ImportEntitiesRequest} message ImportEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.projectId = ""; + object.inputUrl = ""; + object.entityFilter = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + 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.inputUrl != null && message.hasOwnProperty("inputUrl")) + object.inputUrl = message.inputUrl; + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) + object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); + return object; + }; - /** - * 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(); - }; + /** + * Converts this ImportEntitiesRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ImportEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + ImportEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - case 11: - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - case 4: - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return ImportEntitiesRequest; + })(); - /** - * 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()); - }; + v1.ExportEntitiesResponse = (function() { - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - return null; - }; + /** + * Properties of an ExportEntitiesResponse. + * @memberof google.datastore.admin.v1 + * @interface IExportEntitiesResponse + * @property {string|null} [outputUrl] ExportEntitiesResponse outputUrl + */ - /** - * 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]); + /** + * Constructs a new ExportEntitiesResponse. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ExportEntitiesResponse. + * @implements IExportEntitiesResponse + * @constructor + * @param {google.datastore.admin.v1.IExportEntitiesResponse=} [properties] Properties to set + */ + function ExportEntitiesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - return message; - }; - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - return object; - }; + /** + * ExportEntitiesResponse outputUrl. + * @member {string} outputUrl + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @instance + */ + ExportEntitiesResponse.prototype.outputUrl = ""; - /** - * 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); - }; + /** + * Creates a new ExportEntitiesResponse instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {google.datastore.admin.v1.IExportEntitiesResponse=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse instance + */ + ExportEntitiesResponse.create = function create(properties) { + return new ExportEntitiesResponse(properties); + }; - return FileDescriptorProto; - })(); + /** + * Encodes the specified ExportEntitiesResponse message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {google.datastore.admin.v1.IExportEntitiesResponse} message ExportEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputUrl != null && Object.hasOwnProperty.call(message, "outputUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUrl); + return writer; + }; - protobuf.DescriptorProto = (function() { + /** + * Encodes the specified ExportEntitiesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {google.datastore.admin.v1.IExportEntitiesResponse} message ExportEntitiesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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 - */ + /** + * Decodes an ExportEntitiesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.outputUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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]]; - } + /** + * Decodes an ExportEntitiesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; + /** + * Verifies an ExportEntitiesResponse message. + * @function verify + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntitiesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputUrl != null && message.hasOwnProperty("outputUrl")) + if (!$util.isString(message.outputUrl)) + return "outputUrl: string expected"; + return null; + }; - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; + /** + * Creates an ExportEntitiesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse + */ + ExportEntitiesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesResponse) + return object; + var message = new $root.google.datastore.admin.v1.ExportEntitiesResponse(); + if (object.outputUrl != null) + message.outputUrl = String(object.outputUrl); + return message; + }; - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; + /** + * Creates a plain object from an ExportEntitiesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @static + * @param {google.datastore.admin.v1.ExportEntitiesResponse} message ExportEntitiesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntitiesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputUrl = ""; + if (message.outputUrl != null && message.hasOwnProperty("outputUrl")) + object.outputUrl = message.outputUrl; + return object; + }; - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; + /** + * Converts this ExportEntitiesResponse to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ExportEntitiesResponse + * @instance + * @returns {Object.} JSON object + */ + ExportEntitiesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; + return ExportEntitiesResponse; + })(); - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; + v1.ExportEntitiesMetadata = (function() { - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; + /** + * Properties of an ExportEntitiesMetadata. + * @memberof google.datastore.admin.v1 + * @interface IExportEntitiesMetadata + * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] ExportEntitiesMetadata common + * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] ExportEntitiesMetadata progressEntities + * @property {google.datastore.admin.v1.IProgress|null} [progressBytes] ExportEntitiesMetadata progressBytes + * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ExportEntitiesMetadata entityFilter + * @property {string|null} [outputUrlPrefix] ExportEntitiesMetadata outputUrlPrefix + */ - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; + /** + * Constructs a new ExportEntitiesMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ExportEntitiesMetadata. + * @implements IExportEntitiesMetadata + * @constructor + * @param {google.datastore.admin.v1.IExportEntitiesMetadata=} [properties] Properties to set + */ + function ExportEntitiesMetadata(properties) { + if (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 reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; + /** + * ExportEntitiesMetadata common. + * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.common = null; - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * ExportEntitiesMetadata progressEntities. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.progressEntities = null; - /** - * 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); - }; + /** + * ExportEntitiesMetadata progressBytes. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressBytes + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.progressBytes = null; - /** - * 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; - }; + /** + * ExportEntitiesMetadata entityFilter. + * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.entityFilter = null; - /** - * 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(); - }; + /** + * ExportEntitiesMetadata outputUrlPrefix. + * @member {string} outputUrlPrefix + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + */ + ExportEntitiesMetadata.prototype.outputUrlPrefix = ""; - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new ExportEntitiesMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IExportEntitiesMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata instance + */ + ExportEntitiesMetadata.create = function create(properties) { + return new ExportEntitiesMetadata(properties); + }; - /** - * 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()); - }; + /** + * Encodes the specified ExportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IExportEntitiesMetadata} message ExportEntitiesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) + $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.progressBytes != null && Object.hasOwnProperty.call(message, "progressBytes")) + $root.google.datastore.admin.v1.Progress.encode(message.progressBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) + $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputUrlPrefix != null && Object.hasOwnProperty.call(message, "outputUrlPrefix")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.outputUrlPrefix); + return writer; + }; - /** - * 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; - }; + /** + * Encodes the specified ExportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IExportEntitiesMetadata} message ExportEntitiesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEntitiesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes an ExportEntitiesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 3: + message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 4: + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); + break; + case 5: + message.outputUrlPrefix = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - DescriptorProto.ExtensionRange = (function() { + /** + * Decodes an ExportEntitiesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEntitiesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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 - */ + /** + * Verifies an ExportEntitiesMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEntitiesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); + if (error) + return "common." + error; + } + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); + if (error) + return "progressEntities." + error; + } + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes); + if (error) + return "progressBytes." + error; + } + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { + var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); + if (error) + return "entityFilter." + error; + } + if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) + if (!$util.isString(message.outputUrlPrefix)) + return "outputUrlPrefix: string expected"; + return null; + }; - /** - * 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]]; - } + /** + * Creates an ExportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata + */ + ExportEntitiesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesMetadata) + return object; + var message = new $root.google.datastore.admin.v1.ExportEntitiesMetadata(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.common: object expected"); + message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); + } + if (object.progressEntities != null) { + if (typeof object.progressEntities !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.progressEntities: object expected"); + message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); + } + if (object.progressBytes != null) { + if (typeof object.progressBytes !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.progressBytes: object expected"); + message.progressBytes = $root.google.datastore.admin.v1.Progress.fromObject(object.progressBytes); + } + if (object.entityFilter != null) { + if (typeof object.entityFilter !== "object") + throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.entityFilter: object expected"); + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); + } + if (object.outputUrlPrefix != null) + message.outputUrlPrefix = String(object.outputUrlPrefix); + return message; + }; - /** - * 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; + /** + * Creates a plain object from an ExportEntitiesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.ExportEntitiesMetadata} message ExportEntitiesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEntitiesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.progressEntities = null; + object.progressBytes = null; + object.entityFilter = null; + object.outputUrlPrefix = ""; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) + object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) + object.progressBytes = $root.google.datastore.admin.v1.Progress.toObject(message.progressBytes, options); + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) + object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); + if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) + object.outputUrlPrefix = message.outputUrlPrefix; + return object; + }; - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; + /** + * Converts this ExportEntitiesMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ExportEntitiesMetadata + * @instance + * @returns {Object.} JSON object + */ + ExportEntitiesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return ExportEntitiesMetadata; + })(); - /** - * 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; - }; + v1.ImportEntitiesMetadata = (function() { - /** - * 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(); - }; + /** + * Properties of an ImportEntitiesMetadata. + * @memberof google.datastore.admin.v1 + * @interface IImportEntitiesMetadata + * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] ImportEntitiesMetadata common + * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] ImportEntitiesMetadata progressEntities + * @property {google.datastore.admin.v1.IProgress|null} [progressBytes] ImportEntitiesMetadata progressBytes + * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ImportEntitiesMetadata entityFilter + * @property {string|null} [inputUrl] ImportEntitiesMetadata inputUrl + */ - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new ImportEntitiesMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an ImportEntitiesMetadata. + * @implements IImportEntitiesMetadata + * @constructor + * @param {google.datastore.admin.v1.IImportEntitiesMetadata=} [properties] Properties to set + */ + function ImportEntitiesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes 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()); - }; + /** + * ImportEntitiesMetadata common. + * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.common = null; - /** - * 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; - }; + /** + * ImportEntitiesMetadata progressEntities. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.progressEntities = 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; - }; + /** + * ImportEntitiesMetadata progressBytes. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressBytes + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.progressBytes = null; - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRange; - })(); + /** + * ImportEntitiesMetadata entityFilter. + * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.entityFilter = null; - DescriptorProto.ReservedRange = (function() { + /** + * ImportEntitiesMetadata inputUrl. + * @member {string} inputUrl + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + */ + ImportEntitiesMetadata.prototype.inputUrl = ""; - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ + /** + * Creates a new ImportEntitiesMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IImportEntitiesMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata instance + */ + ImportEntitiesMetadata.create = function create(properties) { + return new ImportEntitiesMetadata(properties); + }; - /** - * 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]]; - } + /** + * Encodes the specified ImportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IImportEntitiesMetadata} message ImportEntitiesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntitiesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) + $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.progressBytes != null && Object.hasOwnProperty.call(message, "progressBytes")) + $root.google.datastore.admin.v1.Progress.encode(message.progressBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) + $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputUrl != null && Object.hasOwnProperty.call(message, "inputUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.inputUrl); + return writer; + }; - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; + /** + * Encodes the specified ImportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.IImportEntitiesMetadata} message ImportEntitiesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportEntitiesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; + /** + * Decodes an ImportEntitiesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntitiesMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ImportEntitiesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 3: + message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 4: + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); + break; + case 5: + message.inputUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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); - }; + /** + * Decodes an ImportEntitiesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportEntitiesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; - }; + /** + * Verifies an ImportEntitiesMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportEntitiesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); + if (error) + return "common." + error; + } + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); + if (error) + return "progressEntities." + error; + } + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes); + if (error) + return "progressBytes." + error; + } + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { + var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); + if (error) + return "entityFilter." + error; + } + if (message.inputUrl != null && message.hasOwnProperty("inputUrl")) + if (!$util.isString(message.inputUrl)) + return "inputUrl: string expected"; + return null; + }; - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates an ImportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata + */ + ImportEntitiesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesMetadata) + return object; + var message = new $root.google.datastore.admin.v1.ImportEntitiesMetadata(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.common: object expected"); + message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); + } + if (object.progressEntities != null) { + if (typeof object.progressEntities !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.progressEntities: object expected"); + message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); + } + if (object.progressBytes != null) { + if (typeof object.progressBytes !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.progressBytes: object expected"); + message.progressBytes = $root.google.datastore.admin.v1.Progress.fromObject(object.progressBytes); + } + if (object.entityFilter != null) { + if (typeof object.entityFilter !== "object") + throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.entityFilter: object expected"); + message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); + } + if (object.inputUrl != null) + message.inputUrl = String(object.inputUrl); + return message; + }; - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from an ImportEntitiesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @static + * @param {google.datastore.admin.v1.ImportEntitiesMetadata} message ImportEntitiesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportEntitiesMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.progressEntities = null; + object.progressBytes = null; + object.entityFilter = null; + object.inputUrl = ""; } - } - return message; - }; + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) + object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); + if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) + object.progressBytes = $root.google.datastore.admin.v1.Progress.toObject(message.progressBytes, options); + if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) + object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); + if (message.inputUrl != null && message.hasOwnProperty("inputUrl")) + object.inputUrl = message.inputUrl; + return object; + }; - /** - * 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()); - }; + /** + * Converts this ImportEntitiesMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ImportEntitiesMetadata + * @instance + * @returns {Object.} JSON object + */ + ImportEntitiesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return ImportEntitiesMetadata; + })(); - /** - * 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; - }; + v1.EntityFilter = (function() { - /** - * 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; - }; + /** + * Properties of an EntityFilter. + * @memberof google.datastore.admin.v1 + * @interface IEntityFilter + * @property {Array.|null} [kinds] EntityFilter kinds + * @property {Array.|null} [namespaceIds] EntityFilter namespaceIds + */ - /** - * 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); - }; + /** + * Constructs a new EntityFilter. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an EntityFilter. + * @implements IEntityFilter + * @constructor + * @param {google.datastore.admin.v1.IEntityFilter=} [properties] Properties to set + */ + function EntityFilter(properties) { + this.kinds = []; + this.namespaceIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return ReservedRange; - })(); + /** + * EntityFilter kinds. + * @member {Array.} kinds + * @memberof google.datastore.admin.v1.EntityFilter + * @instance + */ + EntityFilter.prototype.kinds = $util.emptyArray; - return DescriptorProto; - })(); + /** + * EntityFilter namespaceIds. + * @member {Array.} namespaceIds + * @memberof google.datastore.admin.v1.EntityFilter + * @instance + */ + EntityFilter.prototype.namespaceIds = $util.emptyArray; - protobuf.ExtensionRangeOptions = (function() { + /** + * Creates a new EntityFilter instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {google.datastore.admin.v1.IEntityFilter=} [properties] Properties to set + * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter instance + */ + EntityFilter.create = function create(properties) { + return new EntityFilter(properties); + }; - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Encodes the specified EntityFilter message. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {google.datastore.admin.v1.IEntityFilter} message EntityFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kinds != null && message.kinds.length) + for (var i = 0; i < message.kinds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kinds[i]); + if (message.namespaceIds != null && message.namespaceIds.length) + for (var i = 0; i < message.namespaceIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.namespaceIds[i]); + return writer; + }; - /** - * 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 EntityFilter message, length delimited. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {google.datastore.admin.v1.IEntityFilter} message EntityFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; + /** + * Decodes an EntityFilter message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.EntityFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.kinds && message.kinds.length)) + message.kinds = []; + message.kinds.push(reader.string()); + break; + case 2: + if (!(message.namespaceIds && message.namespaceIds.length)) + message.namespaceIds = []; + message.namespaceIds.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * 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 EntityFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies an EntityFilter message. + * @function verify + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kinds != null && message.hasOwnProperty("kinds")) { + if (!Array.isArray(message.kinds)) + return "kinds: array expected"; + for (var i = 0; i < message.kinds.length; ++i) + if (!$util.isString(message.kinds[i])) + return "kinds: string[] expected"; + } + if (message.namespaceIds != null && message.hasOwnProperty("namespaceIds")) { + if (!Array.isArray(message.namespaceIds)) + return "namespaceIds: array expected"; + for (var i = 0; i < message.namespaceIds.length; ++i) + if (!$util.isString(message.namespaceIds[i])) + return "namespaceIds: string[] expected"; + } + return null; + }; - /** - * 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()); - }; + /** + * Creates an EntityFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter + */ + EntityFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.EntityFilter) + return object; + var message = new $root.google.datastore.admin.v1.EntityFilter(); + if (object.kinds) { + if (!Array.isArray(object.kinds)) + throw TypeError(".google.datastore.admin.v1.EntityFilter.kinds: array expected"); + message.kinds = []; + for (var i = 0; i < object.kinds.length; ++i) + message.kinds[i] = String(object.kinds[i]); + } + if (object.namespaceIds) { + if (!Array.isArray(object.namespaceIds)) + throw TypeError(".google.datastore.admin.v1.EntityFilter.namespaceIds: array expected"); + message.namespaceIds = []; + for (var i = 0; i < object.namespaceIds.length; ++i) + message.namespaceIds[i] = String(object.namespaceIds[i]); + } + return message; + }; - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; + /** + * Creates a plain object from an EntityFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.EntityFilter + * @static + * @param {google.datastore.admin.v1.EntityFilter} message EntityFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.kinds = []; + object.namespaceIds = []; + } + if (message.kinds && message.kinds.length) { + object.kinds = []; + for (var j = 0; j < message.kinds.length; ++j) + object.kinds[j] = message.kinds[j]; + } + if (message.namespaceIds && message.namespaceIds.length) { + object.namespaceIds = []; + for (var j = 0; j < message.namespaceIds.length; ++j) + object.namespaceIds[j] = message.namespaceIds[j]; + } + 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); - }; + /** + * Converts this EntityFilter to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.EntityFilter + * @instance + * @returns {Object.} JSON object + */ + EntityFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ExtensionRangeOptions; - })(); + return EntityFilter; + })(); - protobuf.FieldDescriptorProto = (function() { + v1.CreateIndexRequest = (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 - */ + /** + * Properties of a CreateIndexRequest. + * @memberof google.datastore.admin.v1 + * @interface ICreateIndexRequest + * @property {string|null} [projectId] CreateIndexRequest projectId + * @property {google.datastore.admin.v1.IIndex|null} [index] CreateIndexRequest index + */ - /** - * 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]]; - } + /** + * Constructs a new CreateIndexRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a CreateIndexRequest. + * @implements ICreateIndexRequest + * @constructor + * @param {google.datastore.admin.v1.ICreateIndexRequest=} [properties] Properties to set + */ + function CreateIndexRequest(properties) { + if (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 = ""; + /** + * CreateIndexRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @instance + */ + CreateIndexRequest.prototype.projectId = ""; - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; + /** + * CreateIndexRequest index. + * @member {google.datastore.admin.v1.IIndex|null|undefined} index + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @instance + */ + CreateIndexRequest.prototype.index = null; - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; + /** + * Creates a new CreateIndexRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {google.datastore.admin.v1.ICreateIndexRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest instance + */ + CreateIndexRequest.create = function create(properties) { + return new CreateIndexRequest(properties); + }; - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; + /** + * Encodes the specified CreateIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {google.datastore.admin.v1.ICreateIndexRequest} message CreateIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIndexRequest.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.index != null && Object.hasOwnProperty.call(message, "index")) + $root.google.datastore.admin.v1.Index.encode(message.index, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; + /** + * Encodes the specified CreateIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {google.datastore.admin.v1.ICreateIndexRequest} message CreateIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; + /** + * Decodes a CreateIndexRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIndexRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.CreateIndexRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 3: + message.index = $root.google.datastore.admin.v1.Index.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; + /** + * Decodes a CreateIndexRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIndexRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; + /** + * Verifies a CreateIndexRequest message. + * @function verify + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateIndexRequest.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.index != null && message.hasOwnProperty("index")) { + var error = $root.google.datastore.admin.v1.Index.verify(message.index); + if (error) + return "index." + error; + } + return null; + }; - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; + /** + * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest + */ + CreateIndexRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.CreateIndexRequest) + return object; + var message = new $root.google.datastore.admin.v1.CreateIndexRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.index != null) { + if (typeof object.index !== "object") + throw TypeError(".google.datastore.admin.v1.CreateIndexRequest.index: object expected"); + message.index = $root.google.datastore.admin.v1.Index.fromObject(object.index); + } + return message; + }; - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; + /** + * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @static + * @param {google.datastore.admin.v1.CreateIndexRequest} message CreateIndexRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateIndexRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.index = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.index != null && message.hasOwnProperty("index")) + object.index = $root.google.datastore.admin.v1.Index.toObject(message.index, options); + return object; + }; - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; + /** + * Converts this CreateIndexRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.CreateIndexRequest + * @instance + * @returns {Object.} JSON object + */ + CreateIndexRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return CreateIndexRequest; + })(); - /** - * 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; - }; + v1.DeleteIndexRequest = (function() { - /** - * 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(); - }; + /** + * Properties of a DeleteIndexRequest. + * @memberof google.datastore.admin.v1 + * @interface IDeleteIndexRequest + * @property {string|null} [projectId] DeleteIndexRequest projectId + * @property {string|null} [indexId] DeleteIndexRequest indexId + */ - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.typeName = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.defaultValue = reader.string(); - break; - case 9: - message.oneofIndex = reader.int32(); - break; - case 10: - message.jsonName = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3Optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Constructs a new DeleteIndexRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a DeleteIndexRequest. + * @implements IDeleteIndexRequest + * @constructor + * @param {google.datastore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set + */ + function DeleteIndexRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Decodes a 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()); - }; + /** + * DeleteIndexRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @instance + */ + DeleteIndexRequest.prototype.projectId = ""; - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; + /** + * DeleteIndexRequest indexId. + * @member {string} indexId + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @instance + */ + DeleteIndexRequest.prototype.indexId = ""; - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new DeleteIndexRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {google.datastore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest instance + */ + DeleteIndexRequest.create = function create(properties) { + return new DeleteIndexRequest(properties); + }; - /** - * 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; - })(); + /** + * Encodes the specified DeleteIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {google.datastore.admin.v1.IDeleteIndexRequest} message DeleteIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIndexRequest.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); + return writer; + }; - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); + /** + * Encodes the specified DeleteIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {google.datastore.admin.v1.IDeleteIndexRequest} message DeleteIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return FieldDescriptorProto; - })(); + /** + * Decodes a DeleteIndexRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIndexRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.DeleteIndexRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 3: + message.indexId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - protobuf.OneofDescriptorProto = (function() { + /** + * Decodes a DeleteIndexRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIndexRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ + /** + * Verifies a DeleteIndexRequest message. + * @function verify + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteIndexRequest.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.indexId != null && message.hasOwnProperty("indexId")) + if (!$util.isString(message.indexId)) + return "indexId: string expected"; + return null; + }; - /** - * 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]]; - } + /** + * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest + */ + DeleteIndexRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.DeleteIndexRequest) + return object; + var message = new $root.google.datastore.admin.v1.DeleteIndexRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.indexId != null) + message.indexId = String(object.indexId); + return message; + }; - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; + /** + * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @static + * @param {google.datastore.admin.v1.DeleteIndexRequest} message DeleteIndexRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteIndexRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.indexId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.indexId != null && message.hasOwnProperty("indexId")) + object.indexId = message.indexId; + return object; + }; - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; + /** + * Converts this DeleteIndexRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.DeleteIndexRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteIndexRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return DeleteIndexRequest; + })(); - /** - * 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; - }; + v1.GetIndexRequest = (function() { - /** - * 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(); - }; + /** + * Properties of a GetIndexRequest. + * @memberof google.datastore.admin.v1 + * @interface IGetIndexRequest + * @property {string|null} [projectId] GetIndexRequest projectId + * @property {string|null} [indexId] GetIndexRequest indexId + */ - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Constructs a new GetIndexRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a GetIndexRequest. + * @implements IGetIndexRequest + * @constructor + * @param {google.datastore.admin.v1.IGetIndexRequest=} [properties] Properties to set + */ + function GetIndexRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Decodes 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()); - }; + /** + * GetIndexRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.GetIndexRequest + * @instance + */ + GetIndexRequest.prototype.projectId = ""; - /** - * 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; - }; + /** + * GetIndexRequest indexId. + * @member {string} indexId + * @memberof google.datastore.admin.v1.GetIndexRequest + * @instance + */ + GetIndexRequest.prototype.indexId = ""; - /** - * 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 new GetIndexRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {google.datastore.admin.v1.IGetIndexRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest instance + */ + GetIndexRequest.create = function create(properties) { + return new GetIndexRequest(properties); + }; - /** - * 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; - }; + /** + * Encodes the specified GetIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {google.datastore.admin.v1.IGetIndexRequest} message GetIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIndexRequest.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); + return writer; + }; - /** - * 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); - }; + /** + * Encodes the specified GetIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {google.datastore.admin.v1.IGetIndexRequest} message GetIndexRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return OneofDescriptorProto; - })(); + /** + * Decodes a GetIndexRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIndexRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.GetIndexRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 3: + message.indexId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - protobuf.EnumDescriptorProto = (function() { + /** + * Decodes a GetIndexRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIndexRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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 - */ + /** + * Verifies a GetIndexRequest message. + * @function verify + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIndexRequest.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.indexId != null && message.hasOwnProperty("indexId")) + if (!$util.isString(message.indexId)) + return "indexId: string expected"; + return null; + }; - /** - * 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]]; - } + /** + * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest + */ + GetIndexRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.GetIndexRequest) + return object; + var message = new $root.google.datastore.admin.v1.GetIndexRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.indexId != null) + message.indexId = String(object.indexId); + return message; + }; - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; + /** + * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.GetIndexRequest + * @static + * @param {google.datastore.admin.v1.GetIndexRequest} message GetIndexRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIndexRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.indexId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.indexId != null && message.hasOwnProperty("indexId")) + object.indexId = message.indexId; + return object; + }; - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; + /** + * Converts this GetIndexRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.GetIndexRequest + * @instance + * @returns {Object.} JSON object + */ + GetIndexRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; + return GetIndexRequest; + })(); - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + v1.ListIndexesRequest = (function() { - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + /** + * Properties of a ListIndexesRequest. + * @memberof google.datastore.admin.v1 + * @interface IListIndexesRequest + * @property {string|null} [projectId] ListIndexesRequest projectId + * @property {string|null} [filter] ListIndexesRequest filter + * @property {number|null} [pageSize] ListIndexesRequest pageSize + * @property {string|null} [pageToken] ListIndexesRequest pageToken + */ - /** - * 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); - }; + /** + * Constructs a new ListIndexesRequest. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a ListIndexesRequest. + * @implements IListIndexesRequest + * @constructor + * @param {google.datastore.admin.v1.IListIndexesRequest=} [properties] Properties to set + */ + function ListIndexesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified 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; - }; + /** + * ListIndexesRequest projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.projectId = ""; - /** - * 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(); - }; + /** + * ListIndexesRequest filter. + * @member {string} filter + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.filter = ""; - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ListIndexesRequest pageSize. + * @member {number} pageSize + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.pageSize = 0; - /** - * 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()); - }; + /** + * ListIndexesRequest pageToken. + * @member {string} pageToken + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + */ + ListIndexesRequest.prototype.pageToken = ""; - /** - * 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 a new ListIndexesRequest instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {google.datastore.admin.v1.IListIndexesRequest=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest instance + */ + ListIndexesRequest.create = function create(properties) { + return new ListIndexesRequest(properties); + }; - /** - * 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; - }; + /** + * Encodes the specified ListIndexesRequest message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {google.datastore.admin.v1.IListIndexesRequest} message ListIndexesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIndexesRequest.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 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; + }; - /** - * 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); - }; + /** + * Encodes the specified ListIndexesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {google.datastore.admin.v1.IListIndexesRequest} message ListIndexesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIndexesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - EnumDescriptorProto.EnumReservedRange = (function() { + /** + * Decodes a ListIndexesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIndexesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ListIndexesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = 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; + }; - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ + /** + * Decodes a ListIndexesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIndexesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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]]; - } + /** + * Verifies a ListIndexesRequest message. + * @function verify + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIndexesRequest.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.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; + }; - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; + /** + * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest + */ + ListIndexesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ListIndexesRequest) + return object; + var message = new $root.google.datastore.admin.v1.ListIndexesRequest(); + 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; + }; - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; + /** + * Creates a plain object from a ListIndexesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @static + * @param {google.datastore.admin.v1.ListIndexesRequest} message ListIndexesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIndexesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + 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; + }; - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this ListIndexesRequest to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ListIndexesRequest + * @instance + * @returns {Object.} JSON object + */ + ListIndexesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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()); - }; + return ListIndexesRequest; + })(); - /** - * 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; - }; + v1.ListIndexesResponse = (function() { - /** - * 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; - }; + /** + * Properties of a ListIndexesResponse. + * @memberof google.datastore.admin.v1 + * @interface IListIndexesResponse + * @property {Array.|null} [indexes] ListIndexesResponse indexes + * @property {string|null} [nextPageToken] ListIndexesResponse nextPageToken + */ - /** - * 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; + /** + * Constructs a new ListIndexesResponse. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a ListIndexesResponse. + * @implements IListIndexesResponse + * @constructor + * @param {google.datastore.admin.v1.IListIndexesResponse=} [properties] Properties to set + */ + function ListIndexesResponse(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]]; } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return EnumReservedRange; - })(); + /** + * ListIndexesResponse indexes. + * @member {Array.} indexes + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @instance + */ + ListIndexesResponse.prototype.indexes = $util.emptyArray; - return EnumDescriptorProto; - })(); + /** + * ListIndexesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @instance + */ + ListIndexesResponse.prototype.nextPageToken = ""; - protobuf.EnumValueDescriptorProto = (function() { + /** + * Creates a new ListIndexesResponse instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {google.datastore.admin.v1.IListIndexesResponse=} [properties] Properties to set + * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse instance + */ + ListIndexesResponse.create = function create(properties) { + return new ListIndexesResponse(properties); + }; - /** - * 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 - */ + /** + * Encodes the specified ListIndexesResponse message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {google.datastore.admin.v1.IListIndexesResponse} message ListIndexesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIndexesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexes != null && message.indexes.length) + for (var i = 0; i < message.indexes.length; ++i) + $root.google.datastore.admin.v1.Index.encode(message.indexes[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; + }; - /** - * 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]]; - } + /** + * Encodes the specified ListIndexesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {google.datastore.admin.v1.IListIndexesResponse} message ListIndexesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIndexesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; + /** + * Decodes a ListIndexesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIndexesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ListIndexesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.indexes && message.indexes.length)) + message.indexes = []; + message.indexes.push($root.google.datastore.admin.v1.Index.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; + /** + * Decodes a ListIndexesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIndexesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; + /** + * Verifies a ListIndexesResponse message. + * @function verify + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIndexesResponse.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) { + var error = $root.google.datastore.admin.v1.Index.verify(message.indexes[i]); + if (error) + return "indexes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return 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); - }; + /** + * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse + */ + ListIndexesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.ListIndexesResponse) + return object; + var message = new $root.google.datastore.admin.v1.ListIndexesResponse(); + if (object.indexes) { + if (!Array.isArray(object.indexes)) + throw TypeError(".google.datastore.admin.v1.ListIndexesResponse.indexes: array expected"); + message.indexes = []; + for (var i = 0; i < object.indexes.length; ++i) { + if (typeof object.indexes[i] !== "object") + throw TypeError(".google.datastore.admin.v1.ListIndexesResponse.indexes: object expected"); + message.indexes[i] = $root.google.datastore.admin.v1.Index.fromObject(object.indexes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * 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; - }; + /** + * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @static + * @param {google.datastore.admin.v1.ListIndexesResponse} message ListIndexesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIndexesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.indexes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.indexes && message.indexes.length) { + object.indexes = []; + for (var j = 0; j < message.indexes.length; ++j) + object.indexes[j] = $root.google.datastore.admin.v1.Index.toObject(message.indexes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * 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(); - }; + /** + * Converts this ListIndexesResponse to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.ListIndexesResponse + * @instance + * @returns {Object.} JSON object + */ + ListIndexesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return ListIndexesResponse; + })(); - /** - * 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; - }; + v1.IndexOperationMetadata = (function() { - /** - * 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; - }; + /** + * Properties of an IndexOperationMetadata. + * @memberof google.datastore.admin.v1 + * @interface IIndexOperationMetadata + * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] IndexOperationMetadata common + * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] IndexOperationMetadata progressEntities + * @property {string|null} [indexId] IndexOperationMetadata indexId + */ - /** - * 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; - }; + /** + * Constructs a new IndexOperationMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an IndexOperationMetadata. + * @implements IIndexOperationMetadata + * @constructor + * @param {google.datastore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set + */ + function IndexOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * 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); - }; + /** + * IndexOperationMetadata common. + * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.common = null; - return EnumValueDescriptorProto; - })(); + /** + * IndexOperationMetadata progressEntities. + * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.progressEntities = null; - protobuf.ServiceDescriptorProto = (function() { + /** + * IndexOperationMetadata indexId. + * @member {string} indexId + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @instance + */ + IndexOperationMetadata.prototype.indexId = ""; - /** - * 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 - */ + /** + * Creates a new IndexOperationMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {google.datastore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata instance + */ + IndexOperationMetadata.create = function create(properties) { + return new IndexOperationMetadata(properties); + }; - /** - * 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]]; - } + /** + * Encodes the specified IndexOperationMetadata message. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {google.datastore.admin.v1.IIndexOperationMetadata} message IndexOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.common != null && Object.hasOwnProperty.call(message, "common")) + $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) + $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.indexId != null && Object.hasOwnProperty.call(message, "indexId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); + return writer; + }; - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; + /** + * Encodes the specified IndexOperationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {google.datastore.admin.v1.IIndexOperationMetadata} message IndexOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; + /** + * Decodes an IndexOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.IndexOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); + break; + case 2: + message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); + break; + case 3: + message.indexId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; + /** + * Decodes an IndexOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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); - }; + /** + * Verifies an IndexOperationMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.common != null && message.hasOwnProperty("common")) { + var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); + if (error) + return "common." + error; + } + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { + var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); + if (error) + return "progressEntities." + error; + } + if (message.indexId != null && message.hasOwnProperty("indexId")) + if (!$util.isString(message.indexId)) + return "indexId: string expected"; + return null; + }; - /** - * 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; - }; + /** + * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata + */ + IndexOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.IndexOperationMetadata) + return object; + var message = new $root.google.datastore.admin.v1.IndexOperationMetadata(); + if (object.common != null) { + if (typeof object.common !== "object") + throw TypeError(".google.datastore.admin.v1.IndexOperationMetadata.common: object expected"); + message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); + } + if (object.progressEntities != null) { + if (typeof object.progressEntities !== "object") + throw TypeError(".google.datastore.admin.v1.IndexOperationMetadata.progressEntities: object expected"); + message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); + } + if (object.indexId != null) + message.indexId = String(object.indexId); + return message; + }; - /** - * 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(); - }; + /** + * Creates a plain object from an IndexOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @static + * @param {google.datastore.admin.v1.IndexOperationMetadata} message IndexOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.common = null; + object.progressEntities = null; + object.indexId = ""; + } + if (message.common != null && message.hasOwnProperty("common")) + object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); + if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) + object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); + if (message.indexId != null && message.hasOwnProperty("indexId")) + object.indexId = message.indexId; + return object; + }; - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this IndexOperationMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.IndexOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + IndexOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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()); - }; + return IndexOperationMetadata; + })(); - /** - * 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; - }; + v1.DatastoreFirestoreMigrationMetadata = (function() { - /** - * 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]); + /** + * Properties of a DatastoreFirestoreMigrationMetadata. + * @memberof google.datastore.admin.v1 + * @interface IDatastoreFirestoreMigrationMetadata + * @property {google.datastore.admin.v1.MigrationState|null} [migrationState] DatastoreFirestoreMigrationMetadata migrationState + * @property {google.datastore.admin.v1.MigrationStep|null} [migrationStep] DatastoreFirestoreMigrationMetadata migrationStep + */ + + /** + * Constructs a new DatastoreFirestoreMigrationMetadata. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a DatastoreFirestoreMigrationMetadata. + * @implements IDatastoreFirestoreMigrationMetadata + * @constructor + * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata=} [properties] Properties to set + */ + function DatastoreFirestoreMigrationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - if (object.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; - }; + /** + * DatastoreFirestoreMigrationMetadata migrationState. + * @member {google.datastore.admin.v1.MigrationState} migrationState + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @instance + */ + DatastoreFirestoreMigrationMetadata.prototype.migrationState = 0; - /** - * 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); - }; + /** + * DatastoreFirestoreMigrationMetadata migrationStep. + * @member {google.datastore.admin.v1.MigrationStep} migrationStep + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @instance + */ + DatastoreFirestoreMigrationMetadata.prototype.migrationStep = 0; - return ServiceDescriptorProto; - })(); + /** + * Creates a new DatastoreFirestoreMigrationMetadata instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata=} [properties] Properties to set + * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata instance + */ + DatastoreFirestoreMigrationMetadata.create = function create(properties) { + return new DatastoreFirestoreMigrationMetadata(properties); + }; - protobuf.MethodDescriptorProto = (function() { + /** + * Encodes the specified DatastoreFirestoreMigrationMetadata message. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreFirestoreMigrationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.migrationState != null && Object.hasOwnProperty.call(message, "migrationState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.migrationState); + if (message.migrationStep != null && Object.hasOwnProperty.call(message, "migrationStep")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.migrationStep); + return writer; + }; - /** - * 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 - */ + /** + * Encodes the specified DatastoreFirestoreMigrationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DatastoreFirestoreMigrationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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]]; - } + /** + * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreFirestoreMigrationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.migrationState = reader.int32(); + break; + case 2: + message.migrationStep = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; + /** + * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DatastoreFirestoreMigrationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; + /** + * Verifies a DatastoreFirestoreMigrationMetadata message. + * @function verify + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DatastoreFirestoreMigrationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.migrationState != null && message.hasOwnProperty("migrationState")) + switch (message.migrationState) { + default: + return "migrationState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) + switch (message.migrationStep) { + default: + return "migrationStep: enum value expected"; + case 0: + case 6: + case 1: + case 7: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; - /** - * 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; + /** + * Creates a DatastoreFirestoreMigrationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata + */ + DatastoreFirestoreMigrationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) + return object; + var message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); + switch (object.migrationState) { + case "MIGRATION_STATE_UNSPECIFIED": + case 0: + message.migrationState = 0; + break; + case "RUNNING": + case 1: + message.migrationState = 1; + break; + case "PAUSED": + case 2: + message.migrationState = 2; + break; + case "COMPLETE": + case 3: + message.migrationState = 3; + break; + } + switch (object.migrationStep) { + case "MIGRATION_STEP_UNSPECIFIED": + case 0: + message.migrationStep = 0; + break; + case "PREPARE": + case 6: + message.migrationStep = 6; + break; + case "START": + case 1: + message.migrationStep = 1; + break; + case "APPLY_WRITES_SYNCHRONOUSLY": + case 7: + message.migrationStep = 7; + break; + case "COPY_AND_VERIFY": + case 2: + message.migrationStep = 2; + break; + case "REDIRECT_EVENTUALLY_CONSISTENT_READS": + case 3: + message.migrationStep = 3; + break; + case "REDIRECT_STRONGLY_CONSISTENT_READS": + case 4: + message.migrationStep = 4; + break; + case "REDIRECT_WRITES": + case 5: + message.migrationStep = 5; + break; + } + return message; + }; - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; + /** + * Creates a plain object from a DatastoreFirestoreMigrationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @static + * @param {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DatastoreFirestoreMigrationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.migrationState = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; + object.migrationStep = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; + } + if (message.migrationState != null && message.hasOwnProperty("migrationState")) + object.migrationState = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.migrationState] : message.migrationState; + if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) + object.migrationStep = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] : message.migrationStep; + return object; + }; - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; + /** + * Converts this DatastoreFirestoreMigrationMetadata to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata + * @instance + * @returns {Object.} JSON object + */ + DatastoreFirestoreMigrationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; + return DatastoreFirestoreMigrationMetadata; + })(); - /** - * 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; - }; + /** + * OperationType enum. + * @name google.datastore.admin.v1.OperationType + * @enum {number} + * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value + * @property {number} EXPORT_ENTITIES=1 EXPORT_ENTITIES value + * @property {number} IMPORT_ENTITIES=2 IMPORT_ENTITIES value + * @property {number} CREATE_INDEX=3 CREATE_INDEX value + * @property {number} DELETE_INDEX=4 DELETE_INDEX value + */ + v1.OperationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXPORT_ENTITIES"] = 1; + values[valuesById[2] = "IMPORT_ENTITIES"] = 2; + values[valuesById[3] = "CREATE_INDEX"] = 3; + values[valuesById[4] = "DELETE_INDEX"] = 4; + return values; + })(); - /** - * 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(); - }; + v1.Index = (function() { - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.inputType = reader.string(); - break; - case 3: - message.outputType = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.clientStreaming = reader.bool(); - break; - case 6: - message.serverStreaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of an Index. + * @memberof google.datastore.admin.v1 + * @interface IIndex + * @property {string|null} [projectId] Index projectId + * @property {string|null} [indexId] Index indexId + * @property {string|null} [kind] Index kind + * @property {google.datastore.admin.v1.Index.AncestorMode|null} [ancestor] Index ancestor + * @property {Array.|null} [properties] Index properties + * @property {google.datastore.admin.v1.Index.State|null} [state] Index state + */ - /** - * 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()); - }; + /** + * Constructs a new Index. + * @memberof google.datastore.admin.v1 + * @classdesc Represents an Index. + * @implements IIndex + * @constructor + * @param {google.datastore.admin.v1.IIndex=} [properties] Properties to set + */ + function Index(properties) { + this.properties = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * 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; - }; + /** + * Index projectId. + * @member {string} projectId + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.projectId = ""; - /** - * 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; - }; + /** + * Index indexId. + * @member {string} indexId + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.indexId = ""; - /** - * 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; - }; + /** + * Index kind. + * @member {string} kind + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.kind = ""; - /** - * 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); - }; + /** + * Index ancestor. + * @member {google.datastore.admin.v1.Index.AncestorMode} ancestor + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.ancestor = 0; - return MethodDescriptorProto; - })(); + /** + * Index properties. + * @member {Array.} properties + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.properties = $util.emptyArray; - protobuf.FileOptions = (function() { + /** + * Index state. + * @member {google.datastore.admin.v1.Index.State} state + * @memberof google.datastore.admin.v1.Index + * @instance + */ + Index.prototype.state = 0; - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition - */ + /** + * Creates a new Index instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.Index + * @static + * @param {google.datastore.admin.v1.IIndex=} [properties] Properties to set + * @returns {google.datastore.admin.v1.Index} Index instance + */ + Index.create = function create(properties) { + return new Index(properties); + }; - /** - * 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]]; - } + /** + * Encodes the specified Index message. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.Index + * @static + * @param {google.datastore.admin.v1.IIndex} message Index message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Index.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kind); + if (message.ancestor != null && Object.hasOwnProperty.call(message, "ancestor")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ancestor); + if (message.properties != null && message.properties.length) + for (var i = 0; i < message.properties.length; ++i) + $root.google.datastore.admin.v1.Index.IndexedProperty.encode(message.properties[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + return writer; + }; - /** - * 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; + /** + * Encodes the specified Index message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.Index + * @static + * @param {google.datastore.admin.v1.IIndex} message Index message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Index.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; + /** + * Decodes an Index message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.Index + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.Index} Index + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Index.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Index(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.string(); + break; + case 3: + message.indexId = reader.string(); + break; + case 4: + message.kind = reader.string(); + break; + case 5: + message.ancestor = reader.int32(); + break; + case 6: + if (!(message.properties && message.properties.length)) + message.properties = []; + message.properties.push($root.google.datastore.admin.v1.Index.IndexedProperty.decode(reader, reader.uint32())); + break; + case 7: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; + /** + * Decodes an Index message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.Index + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.Index} Index + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Index.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; + /** + * Verifies an Index message. + * @function verify + * @memberof google.datastore.admin.v1.Index + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Index.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.indexId != null && message.hasOwnProperty("indexId")) + if (!$util.isString(message.indexId)) + return "indexId: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.ancestor != null && message.hasOwnProperty("ancestor")) + switch (message.ancestor) { + default: + return "ancestor: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!Array.isArray(message.properties)) + return "properties: array expected"; + for (var i = 0; i < message.properties.length; ++i) { + var error = $root.google.datastore.admin.v1.Index.IndexedProperty.verify(message.properties[i]); + if (error) + return "properties." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; + /** + * Creates an Index message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.Index + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.Index} Index + */ + Index.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.Index) + return object; + var message = new $root.google.datastore.admin.v1.Index(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.indexId != null) + message.indexId = String(object.indexId); + if (object.kind != null) + message.kind = String(object.kind); + switch (object.ancestor) { + case "ANCESTOR_MODE_UNSPECIFIED": + case 0: + message.ancestor = 0; + break; + case "NONE": + case 1: + message.ancestor = 1; + break; + case "ALL_ANCESTORS": + case 2: + message.ancestor = 2; + break; + } + if (object.properties) { + if (!Array.isArray(object.properties)) + throw TypeError(".google.datastore.admin.v1.Index.properties: array expected"); + message.properties = []; + for (var i = 0; i < object.properties.length; ++i) { + if (typeof object.properties[i] !== "object") + throw TypeError(".google.datastore.admin.v1.Index.properties: object expected"); + message.properties[i] = $root.google.datastore.admin.v1.Index.IndexedProperty.fromObject(object.properties[i]); + } + } + switch (object.state) { + 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 "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + return message; + }; - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; + /** + * Creates a plain object from an Index message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.Index + * @static + * @param {google.datastore.admin.v1.Index} message Index + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Index.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.properties = []; + if (options.defaults) { + object.projectId = ""; + object.indexId = ""; + object.kind = ""; + object.ancestor = options.enums === String ? "ANCESTOR_MODE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.indexId != null && message.hasOwnProperty("indexId")) + object.indexId = message.indexId; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.ancestor != null && message.hasOwnProperty("ancestor")) + object.ancestor = options.enums === String ? $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] : message.ancestor; + if (message.properties && message.properties.length) { + object.properties = []; + for (var j = 0; j < message.properties.length; ++j) + object.properties[j] = $root.google.datastore.admin.v1.Index.IndexedProperty.toObject(message.properties[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.datastore.admin.v1.Index.State[message.state] : message.state; + return object; + }; - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; + /** + * Converts this Index to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.Index + * @instance + * @returns {Object.} JSON object + */ + Index.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; + /** + * AncestorMode enum. + * @name google.datastore.admin.v1.Index.AncestorMode + * @enum {number} + * @property {number} ANCESTOR_MODE_UNSPECIFIED=0 ANCESTOR_MODE_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} ALL_ANCESTORS=2 ALL_ANCESTORS value + */ + Index.AncestorMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANCESTOR_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "ALL_ANCESTORS"] = 2; + return values; + })(); - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; + /** + * Direction enum. + * @name google.datastore.admin.v1.Index.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} ASCENDING=1 ASCENDING value + * @property {number} DESCENDING=2 DESCENDING value + */ + Index.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ASCENDING"] = 1; + values[valuesById[2] = "DESCENDING"] = 2; + return values; + })(); - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; + Index.IndexedProperty = (function() { - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; + /** + * Properties of an IndexedProperty. + * @memberof google.datastore.admin.v1.Index + * @interface IIndexedProperty + * @property {string|null} [name] IndexedProperty name + * @property {google.datastore.admin.v1.Index.Direction|null} [direction] IndexedProperty direction + */ - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; + /** + * Constructs a new IndexedProperty. + * @memberof google.datastore.admin.v1.Index + * @classdesc Represents an IndexedProperty. + * @implements IIndexedProperty + * @constructor + * @param {google.datastore.admin.v1.Index.IIndexedProperty=} [properties] Properties to set + */ + function IndexedProperty(properties) { + if (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 phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; + /** + * IndexedProperty name. + * @member {string} name + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @instance + */ + IndexedProperty.prototype.name = ""; - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; + /** + * IndexedProperty direction. + * @member {google.datastore.admin.v1.Index.Direction} direction + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @instance + */ + IndexedProperty.prototype.direction = 0; - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * Creates a new IndexedProperty instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {google.datastore.admin.v1.Index.IIndexedProperty=} [properties] Properties to set + * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty instance + */ + IndexedProperty.create = function create(properties) { + return new IndexedProperty(properties); + }; - /** - * FileOptions .google.api.resourceDefinition. - * @member {Array.} .google.api.resourceDefinition - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + /** + * Encodes the specified IndexedProperty message. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {google.datastore.admin.v1.Index.IIndexedProperty} message IndexedProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexedProperty.encode = function encode(message, writer) { + 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.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); + return writer; + }; - /** - * 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 IndexedProperty message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {google.datastore.admin.v1.Index.IIndexedProperty} message IndexedProperty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IndexedProperty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified 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 an IndexedProperty message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexedProperty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Index.IndexedProperty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.direction = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.javaPackage = reader.string(); - break; - case 8: - message.javaOuterClassname = reader.string(); - break; - case 10: - message.javaMultipleFiles = reader.bool(); - break; - case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; - case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; - case 9: - message.optimizeFor = reader.int32(); - break; - case 11: - message.goPackage = reader.string(); - break; - case 16: - message.ccGenericServices = reader.bool(); - break; - case 17: - message.javaGenericServices = reader.bool(); - break; - case 18: - message.pyGenericServices = reader.bool(); - break; - case 42: - message.phpGenericServices = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.ccEnableArenas = reader.bool(); - break; - case 36: - message.objcClassPrefix = reader.string(); - break; - case 37: - message.csharpNamespace = reader.string(); - break; - case 39: - message.swiftPrefix = reader.string(); - break; - case 40: - message.phpClassPrefix = reader.string(); - break; - case 41: - message.phpNamespace = reader.string(); - break; - case 44: - message.phpMetadataNamespace = reader.string(); - break; - case 45: - message.rubyPackage = reader.string(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) - message[".google.api.resourceDefinition"] = []; - message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an IndexedProperty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IndexedProperty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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 an IndexedProperty message. + * @function verify + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IndexedProperty.verify = function verify(message) { + if (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.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { - if (!Array.isArray(message[".google.api.resourceDefinition"])) - return ".google.api.resourceDefinition: array expected"; - for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); - if (error) - return ".google.api.resourceDefinition." + error; - } - } - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resourceDefinition"]) { - if (!Array.isArray(object[".google.api.resourceDefinition"])) - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); - message[".google.api.resourceDefinition"] = []; - for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { - if (typeof object[".google.api.resourceDefinition"][i] !== "object") - throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); - message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.resourceDefinition"] = []; - } - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { - object[".google.api.resourceDefinition"] = []; - for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) - object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {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 {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .google.api.resource. - * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".google.api.resource"] = null; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) - $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messageSetWireFormat = reader.bool(); - break; - case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.mapEntry = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1053: - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { - var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); - if (error) - return ".google.api.resource." + error; - } - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.resource"] != null) { - if (typeof object[".google.api.resource"] !== "object") - throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); - message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object[".google.api.resource"] = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) - object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions 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 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.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { - writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.int32(message[".google.api.fieldBehavior"][i]); - writer.ldelim(); - } - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 15: - message.unverifiedLazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1052: - if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) - message[".google.api.fieldBehavior"] = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message[".google.api.fieldBehavior"].push(reader.int32()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - 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.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: - break; - } - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.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.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - } - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object[".google.api.resourceReference"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 1049: - message[".google.api.defaultHost"] = reader.string(); - break; - case 1050: - message[".google.api.oauthScopes"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @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 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.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 72295728: - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); - break; - case 1051: - if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) - message[".google.api.methodSignature"] = []; - message[".google.api.methodSignature"].push(reader.string()); - break; - 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.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) { - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.http"] != null) { - if (typeof object[".google.api.http"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); - message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); - } - if (object[".google.api.methodSignature"]) { - if (!Array.isArray(object[".google.api.methodSignature"])) - throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); - message[".google.api.methodSignature"] = []; - for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) - message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); - } - 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[".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] : message.idempotencyLevel; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.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); - }; - - /** - * 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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifierValue = reader.string(); - break; - case 4: - message.positiveIntValue = reader.uint64(); - break; - case 5: - message.negativeIntValue = reader.int64(); - break; - case 6: - message.doubleValue = reader.double(); - break; - case 7: - message.stringValue = reader.bytes(); - break; - case 8: - message.aggregateValue = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.namePart = reader.string(); - break; - case 2: - message.isExtension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leadingComments = reader.string(); - break; - case 4: - message.trailingComments = reader.string(); - break; - case 6: - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; + /** + * Creates an IndexedProperty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty + */ + IndexedProperty.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.Index.IndexedProperty) + return object; + var message = new $root.google.datastore.admin.v1.Index.IndexedProperty(); + if (object.name != null) + message.name = String(object.name); + switch (object.direction) { + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "ASCENDING": + case 1: + message.direction = 1; + break; + case "DESCENDING": + case 2: + message.direction = 2; + break; + } + return message; + }; - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @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; - }; + /** + * Creates a plain object from an IndexedProperty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @static + * @param {google.datastore.admin.v1.Index.IndexedProperty} message IndexedProperty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IndexedProperty.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.datastore.admin.v1.Index.Direction[message.direction] : message.direction; + 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); - }; + /** + * Converts this IndexedProperty to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.Index.IndexedProperty + * @instance + * @returns {Object.} JSON object + */ + IndexedProperty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - GeneratedCodeInfo.Annotation = (function() { + return IndexedProperty; + })(); - /** - * 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 - */ + /** + * State enum. + * @name google.datastore.admin.v1.Index.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} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + */ + Index.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] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); - /** - * 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]]; - } + return Index; + })(); - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; + v1.MigrationStateEvent = (function() { - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; + /** + * Properties of a MigrationStateEvent. + * @memberof google.datastore.admin.v1 + * @interface IMigrationStateEvent + * @property {google.datastore.admin.v1.MigrationState|null} [state] MigrationStateEvent state + */ - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; + /** + * Constructs a new MigrationStateEvent. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a MigrationStateEvent. + * @implements IMigrationStateEvent + * @constructor + * @param {google.datastore.admin.v1.IMigrationStateEvent=} [properties] Properties to set + */ + function MigrationStateEvent(properties) { + if (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 end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; + /** + * MigrationStateEvent state. + * @member {google.datastore.admin.v1.MigrationState} state + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @instance + */ + MigrationStateEvent.prototype.state = 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); - }; + /** + * Creates a new MigrationStateEvent instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {google.datastore.admin.v1.IMigrationStateEvent=} [properties] Properties to set + * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent instance + */ + MigrationStateEvent.create = function create(properties) { + return new MigrationStateEvent(properties); + }; - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - return writer; - }; + /** + * Encodes the specified MigrationStateEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {google.datastore.admin.v1.IMigrationStateEvent} message MigrationStateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationStateEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + 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(); - }; + /** + * Encodes the specified MigrationStateEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {google.datastore.admin.v1.IMigrationStateEvent} message MigrationStateEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationStateEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MigrationStateEvent message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationStateEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationStateEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MigrationStateEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationStateEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Verifies a MigrationStateEvent message. + * @function verify + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationStateEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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; + } + return null; + }; + + /** + * Creates a MigrationStateEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent + */ + MigrationStateEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.MigrationStateEvent) + return object; + var message = new $root.google.datastore.admin.v1.MigrationStateEvent(); + switch (object.state) { + case "MIGRATION_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "RUNNING": 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()); + message.state = 1; break; + case "PAUSED": case 2: - message.sourceFile = reader.string(); + message.state = 2; break; + case "COMPLETE": case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); + message.state = 3; break; } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; + return message; + }; - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + /** + * Creates a plain object from a MigrationStateEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @static + * @param {google.datastore.admin.v1.MigrationStateEvent} message MigrationStateEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationStateEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.state = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.state] : message.state; return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; + }; - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; + /** + * Converts this MigrationStateEvent to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.MigrationStateEvent + * @instance + * @returns {Object.} JSON object + */ + MigrationStateEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return MigrationStateEvent; + })(); - return Annotation; - })(); + v1.MigrationProgressEvent = (function() { - return GeneratedCodeInfo; - })(); + /** + * Properties of a MigrationProgressEvent. + * @memberof google.datastore.admin.v1 + * @interface IMigrationProgressEvent + * @property {google.datastore.admin.v1.MigrationStep|null} [step] MigrationProgressEvent step + * @property {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null} [prepareStepDetails] MigrationProgressEvent prepareStepDetails + * @property {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null} [redirectWritesStepDetails] MigrationProgressEvent redirectWritesStepDetails + */ + + /** + * Constructs a new MigrationProgressEvent. + * @memberof google.datastore.admin.v1 + * @classdesc Represents a MigrationProgressEvent. + * @implements IMigrationProgressEvent + * @constructor + * @param {google.datastore.admin.v1.IMigrationProgressEvent=} [properties] Properties to set + */ + function MigrationProgressEvent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - protobuf.DoubleValue = (function() { + /** + * MigrationProgressEvent step. + * @member {google.datastore.admin.v1.MigrationStep} step + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + */ + MigrationProgressEvent.prototype.step = 0; - /** - * Properties of a DoubleValue. - * @memberof google.protobuf - * @interface IDoubleValue - * @property {number|null} [value] DoubleValue value - */ + /** + * MigrationProgressEvent prepareStepDetails. + * @member {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null|undefined} prepareStepDetails + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + */ + MigrationProgressEvent.prototype.prepareStepDetails = null; - /** - * Constructs a new DoubleValue. - * @memberof google.protobuf - * @classdesc Represents a DoubleValue. - * @implements IDoubleValue - * @constructor - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - */ - function DoubleValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * MigrationProgressEvent redirectWritesStepDetails. + * @member {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null|undefined} redirectWritesStepDetails + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + */ + MigrationProgressEvent.prototype.redirectWritesStepDetails = null; - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; + /** + * MigrationProgressEvent stepDetails. + * @member {"prepareStepDetails"|"redirectWritesStepDetails"|undefined} stepDetails + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + */ + Object.defineProperty(MigrationProgressEvent.prototype, "stepDetails", { + get: $util.oneOfGetter($oneOfFields = ["prepareStepDetails", "redirectWritesStepDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; + /** + * Creates a new MigrationProgressEvent instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {google.datastore.admin.v1.IMigrationProgressEvent=} [properties] Properties to set + * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent instance + */ + MigrationProgressEvent.create = function create(properties) { + return new MigrationProgressEvent(properties); + }; - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified MigrationProgressEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {google.datastore.admin.v1.IMigrationProgressEvent} message MigrationProgressEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationProgressEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.step != null && Object.hasOwnProperty.call(message, "step")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.step); + if (message.prepareStepDetails != null && Object.hasOwnProperty.call(message, "prepareStepDetails")) + $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.encode(message.prepareStepDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.redirectWritesStepDetails != null && Object.hasOwnProperty.call(message, "redirectWritesStepDetails")) + $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.encode(message.redirectWritesStepDetails, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified MigrationProgressEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {google.datastore.admin.v1.IMigrationProgressEvent} message MigrationProgressEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MigrationProgressEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a MigrationProgressEvent message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationProgressEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.step = reader.int32(); + break; + case 2: + message.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.decode(reader, reader.uint32()); + break; + case 3: + message.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies a DoubleValue message. - * @function verify - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DoubleValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; + /** + * Decodes a MigrationProgressEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MigrationProgressEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DoubleValue} DoubleValue - */ - DoubleValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; + /** + * Verifies a MigrationProgressEvent message. + * @function verify + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MigrationProgressEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.step != null && message.hasOwnProperty("step")) + switch (message.step) { + default: + return "step: enum value expected"; + case 0: + case 6: + case 1: + case 7: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { + properties.stepDetails = 1; + { + var error = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify(message.prepareStepDetails); + if (error) + return "prepareStepDetails." + error; + } + } + if (message.redirectWritesStepDetails != null && message.hasOwnProperty("redirectWritesStepDetails")) { + if (properties.stepDetails === 1) + return "stepDetails: multiple values"; + properties.stepDetails = 1; + { + var error = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify(message.redirectWritesStepDetails); + if (error) + return "redirectWritesStepDetails." + error; + } + } + return null; + }; - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; + /** + * Creates a MigrationProgressEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent + */ + MigrationProgressEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent) + return object; + var message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); + switch (object.step) { + case "MIGRATION_STEP_UNSPECIFIED": + case 0: + message.step = 0; + break; + case "PREPARE": + case 6: + message.step = 6; + break; + case "START": + case 1: + message.step = 1; + break; + case "APPLY_WRITES_SYNCHRONOUSLY": + case 7: + message.step = 7; + break; + case "COPY_AND_VERIFY": + case 2: + message.step = 2; + break; + case "REDIRECT_EVENTUALLY_CONSISTENT_READS": + case 3: + message.step = 3; + break; + case "REDIRECT_STRONGLY_CONSISTENT_READS": + case 4: + message.step = 4; + break; + case "REDIRECT_WRITES": + case 5: + message.step = 5; + break; + } + if (object.prepareStepDetails != null) { + if (typeof object.prepareStepDetails !== "object") + throw TypeError(".google.datastore.admin.v1.MigrationProgressEvent.prepareStepDetails: object expected"); + message.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.fromObject(object.prepareStepDetails); + } + if (object.redirectWritesStepDetails != null) { + if (typeof object.redirectWritesStepDetails !== "object") + throw TypeError(".google.datastore.admin.v1.MigrationProgressEvent.redirectWritesStepDetails: object expected"); + message.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.fromObject(object.redirectWritesStepDetails); + } + return message; + }; - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a MigrationProgressEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent} message MigrationProgressEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MigrationProgressEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.step = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; + if (message.step != null && message.hasOwnProperty("step")) + object.step = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.step] : message.step; + if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { + object.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.toObject(message.prepareStepDetails, options); + if (options.oneofs) + object.stepDetails = "prepareStepDetails"; + } + if (message.redirectWritesStepDetails != null && message.hasOwnProperty("redirectWritesStepDetails")) { + object.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.toObject(message.redirectWritesStepDetails, options); + if (options.oneofs) + object.stepDetails = "redirectWritesStepDetails"; + } + return object; + }; - return DoubleValue; - })(); + /** + * Converts this MigrationProgressEvent to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @instance + * @returns {Object.} JSON object + */ + MigrationProgressEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - protobuf.FloatValue = (function() { + /** + * ConcurrencyMode enum. + * @name google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode + * @enum {number} + * @property {number} CONCURRENCY_MODE_UNSPECIFIED=0 CONCURRENCY_MODE_UNSPECIFIED value + * @property {number} PESSIMISTIC=1 PESSIMISTIC value + * @property {number} OPTIMISTIC=2 OPTIMISTIC value + * @property {number} OPTIMISTIC_WITH_ENTITY_GROUPS=3 OPTIMISTIC_WITH_ENTITY_GROUPS value + */ + MigrationProgressEvent.ConcurrencyMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONCURRENCY_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PESSIMISTIC"] = 1; + values[valuesById[2] = "OPTIMISTIC"] = 2; + values[valuesById[3] = "OPTIMISTIC_WITH_ENTITY_GROUPS"] = 3; + return values; + })(); - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ + MigrationProgressEvent.PrepareStepDetails = (function() { - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a PrepareStepDetails. + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @interface IPrepareStepDetails + * @property {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null} [concurrencyMode] PrepareStepDetails concurrencyMode + */ - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; + /** + * Constructs a new PrepareStepDetails. + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @classdesc Represents a PrepareStepDetails. + * @implements IPrepareStepDetails + * @constructor + * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails=} [properties] Properties to set + */ + function PrepareStepDetails(properties) { + if (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 FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; + /** + * PrepareStepDetails concurrencyMode. + * @member {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} concurrencyMode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @instance + */ + PrepareStepDetails.prototype.concurrencyMode = 0; - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; + /** + * Creates a new PrepareStepDetails instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails=} [properties] Properties to set + * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails instance + */ + PrepareStepDetails.create = function create(properties) { + return new PrepareStepDetails(properties); + }; - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified PrepareStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails} message PrepareStepDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareStepDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.concurrencyMode != null && Object.hasOwnProperty.call(message, "concurrencyMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.concurrencyMode); + return writer; + }; - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified PrepareStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails} message PrepareStepDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrepareStepDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a PrepareStepDetails message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareStepDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.concurrencyMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; + /** + * Decodes a PrepareStepDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrepareStepDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; + /** + * Verifies a PrepareStepDetails message. + * @function verify + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrepareStepDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) + switch (message.concurrencyMode) { + default: + return "concurrencyMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a PrepareStepDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails + */ + PrepareStepDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) + return object; + var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); + switch (object.concurrencyMode) { + case "CONCURRENCY_MODE_UNSPECIFIED": + case 0: + message.concurrencyMode = 0; + break; + case "PESSIMISTIC": + case 1: + message.concurrencyMode = 1; + break; + case "OPTIMISTIC": + case 2: + message.concurrencyMode = 2; + break; + case "OPTIMISTIC_WITH_ENTITY_GROUPS": + case 3: + message.concurrencyMode = 3; + break; + } + return message; + }; - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; + /** + * Creates a plain object from a PrepareStepDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} message PrepareStepDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrepareStepDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; + if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) + object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; + return object; + }; - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this PrepareStepDetails to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails + * @instance + * @returns {Object.} JSON object + */ + PrepareStepDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return FloatValue; - })(); + return PrepareStepDetails; + })(); - protobuf.Int64Value = (function() { + MigrationProgressEvent.RedirectWritesStepDetails = (function() { - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ + /** + * Properties of a RedirectWritesStepDetails. + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @interface IRedirectWritesStepDetails + * @property {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null} [concurrencyMode] RedirectWritesStepDetails concurrencyMode + */ - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new RedirectWritesStepDetails. + * @memberof google.datastore.admin.v1.MigrationProgressEvent + * @classdesc Represents a RedirectWritesStepDetails. + * @implements IRedirectWritesStepDetails + * @constructor + * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails=} [properties] Properties to set + */ + function RedirectWritesStepDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * RedirectWritesStepDetails concurrencyMode. + * @member {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} concurrencyMode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @instance + */ + RedirectWritesStepDetails.prototype.concurrencyMode = 0; - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; + /** + * Creates a new RedirectWritesStepDetails instance using the specified properties. + * @function create + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails=} [properties] Properties to set + * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails instance + */ + RedirectWritesStepDetails.create = function create(properties) { + return new RedirectWritesStepDetails(properties); + }; - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; + /** + * Encodes the specified RedirectWritesStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. + * @function encode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails} message RedirectWritesStepDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectWritesStepDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.concurrencyMode != null && Object.hasOwnProperty.call(message, "concurrencyMode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.concurrencyMode); + return writer; + }; - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified RedirectWritesStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails} message RedirectWritesStepDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RedirectWritesStepDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a RedirectWritesStepDetails message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectWritesStepDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.concurrencyMode = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a RedirectWritesStepDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RedirectWritesStepDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; + /** + * Verifies a RedirectWritesStepDetails message. + * @function verify + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RedirectWritesStepDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) + switch (message.concurrencyMode) { + default: + return "concurrencyMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; + /** + * Creates a RedirectWritesStepDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails + */ + RedirectWritesStepDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) + return object; + var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); + switch (object.concurrencyMode) { + case "CONCURRENCY_MODE_UNSPECIFIED": + case 0: + message.concurrencyMode = 0; + break; + case "PESSIMISTIC": + case 1: + message.concurrencyMode = 1; + break; + case "OPTIMISTIC": + case 2: + message.concurrencyMode = 2; + break; + case "OPTIMISTIC_WITH_ENTITY_GROUPS": + case 3: + message.concurrencyMode = 3; + break; + } + return message; + }; - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; + /** + * Creates a plain object from a RedirectWritesStepDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @static + * @param {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} message RedirectWritesStepDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RedirectWritesStepDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; + if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) + object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; + return object; + }; - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this RedirectWritesStepDetails to JSON. + * @function toJSON + * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails + * @instance + * @returns {Object.} JSON object + */ + RedirectWritesStepDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Int64Value; - })(); + return RedirectWritesStepDetails; + })(); - protobuf.UInt64Value = (function() { + return MigrationProgressEvent; + })(); - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ + /** + * MigrationState enum. + * @name google.datastore.admin.v1.MigrationState + * @enum {number} + * @property {number} MIGRATION_STATE_UNSPECIFIED=0 MIGRATION_STATE_UNSPECIFIED value + * @property {number} RUNNING=1 RUNNING value + * @property {number} PAUSED=2 PAUSED value + * @property {number} COMPLETE=3 COMPLETE value + */ + v1.MigrationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUNNING"] = 1; + values[valuesById[2] = "PAUSED"] = 2; + values[valuesById[3] = "COMPLETE"] = 3; + return values; + })(); - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * MigrationStep enum. + * @name google.datastore.admin.v1.MigrationStep + * @enum {number} + * @property {number} MIGRATION_STEP_UNSPECIFIED=0 MIGRATION_STEP_UNSPECIFIED value + * @property {number} PREPARE=6 PREPARE value + * @property {number} START=1 START value + * @property {number} APPLY_WRITES_SYNCHRONOUSLY=7 APPLY_WRITES_SYNCHRONOUSLY value + * @property {number} COPY_AND_VERIFY=2 COPY_AND_VERIFY value + * @property {number} REDIRECT_EVENTUALLY_CONSISTENT_READS=3 REDIRECT_EVENTUALLY_CONSISTENT_READS value + * @property {number} REDIRECT_STRONGLY_CONSISTENT_READS=4 REDIRECT_STRONGLY_CONSISTENT_READS value + * @property {number} REDIRECT_WRITES=5 REDIRECT_WRITES value + */ + v1.MigrationStep = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MIGRATION_STEP_UNSPECIFIED"] = 0; + values[valuesById[6] = "PREPARE"] = 6; + values[valuesById[1] = "START"] = 1; + values[valuesById[7] = "APPLY_WRITES_SYNCHRONOUSLY"] = 7; + values[valuesById[2] = "COPY_AND_VERIFY"] = 2; + values[valuesById[3] = "REDIRECT_EVENTUALLY_CONSISTENT_READS"] = 3; + values[valuesById[4] = "REDIRECT_STRONGLY_CONSISTENT_READS"] = 4; + values[valuesById[5] = "REDIRECT_WRITES"] = 5; + return values; + })(); - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + return v1; + })(); - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; + return admin; + })(); - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; + datastore.v1 = (function() { /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Namespace v1. + * @memberof google.datastore + * @namespace */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + var v1 = {}; - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v1.Datastore = (function() { - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new Datastore service. + * @memberof google.datastore.v1 + * @classdesc Represents a Datastore + * @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 Datastore(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; + (Datastore.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Datastore; - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; + /** + * Creates new Datastore service using the specified rpc implementation. + * @function create + * @memberof google.datastore.v1.Datastore + * @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 {Datastore} RPC service. Useful where requests and/or responses are streamed. + */ + Datastore.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; + /** + * Callback as used by {@link google.datastore.v1.Datastore#lookup}. + * @memberof google.datastore.v1.Datastore + * @typedef LookupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.LookupResponse} [response] LookupResponse + */ - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls Lookup. + * @function lookup + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.ILookupRequest} request LookupRequest message or plain object + * @param {google.datastore.v1.Datastore.LookupCallback} callback Node-style callback called with the error, if any, and LookupResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.lookup = function lookup(request, callback) { + return this.rpcCall(lookup, $root.google.datastore.v1.LookupRequest, $root.google.datastore.v1.LookupResponse, request, callback); + }, "name", { value: "Lookup" }); - return UInt64Value; - })(); + /** + * Calls Lookup. + * @function lookup + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.ILookupRequest} request LookupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - protobuf.Int32Value = (function() { + /** + * Callback as used by {@link google.datastore.v1.Datastore#runQuery}. + * @memberof google.datastore.v1.Datastore + * @typedef RunQueryCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.RunQueryResponse} [response] RunQueryResponse + */ - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ + /** + * Calls RunQuery. + * @function runQuery + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRunQueryRequest} request RunQueryRequest message or plain object + * @param {google.datastore.v1.Datastore.RunQueryCallback} callback Node-style callback called with the error, if any, and RunQueryResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.runQuery = function runQuery(request, callback) { + return this.rpcCall(runQuery, $root.google.datastore.v1.RunQueryRequest, $root.google.datastore.v1.RunQueryResponse, request, callback); + }, "name", { value: "RunQuery" }); - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls RunQuery. + * @function runQuery + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRunQueryRequest} request RunQueryRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; + /** + * Callback as used by {@link google.datastore.v1.Datastore#beginTransaction}. + * @memberof google.datastore.v1.Datastore + * @typedef BeginTransactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.BeginTransactionResponse} [response] BeginTransactionResponse + */ - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; + /** + * Calls BeginTransaction. + * @function beginTransaction + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object + * @param {google.datastore.v1.Datastore.BeginTransactionCallback} callback Node-style callback called with the error, if any, and BeginTransactionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.beginTransaction = function beginTransaction(request, callback) { + return this.rpcCall(beginTransaction, $root.google.datastore.v1.BeginTransactionRequest, $root.google.datastore.v1.BeginTransactionResponse, request, callback); + }, "name", { value: "BeginTransaction" }); - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; + /** + * Calls BeginTransaction. + * @function beginTransaction + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Callback as used by {@link google.datastore.v1.Datastore#commit}. + * @memberof google.datastore.v1.Datastore + * @typedef CommitCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.CommitResponse} [response] CommitResponse + */ - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls Commit. + * @function commit + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.ICommitRequest} request CommitRequest message or plain object + * @param {google.datastore.v1.Datastore.CommitCallback} callback Node-style callback called with the error, if any, and CommitResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.commit = function commit(request, callback) { + return this.rpcCall(commit, $root.google.datastore.v1.CommitRequest, $root.google.datastore.v1.CommitResponse, request, callback); + }, "name", { value: "Commit" }); - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls Commit. + * @function commit + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.ICommitRequest} request CommitRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; + /** + * Callback as used by {@link google.datastore.v1.Datastore#rollback}. + * @memberof google.datastore.v1.Datastore + * @typedef RollbackCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.RollbackResponse} [response] RollbackResponse + */ - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int32Value} Int32Value - */ - Int32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; + /** + * Calls Rollback. + * @function rollback + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRollbackRequest} request RollbackRequest message or plain object + * @param {google.datastore.v1.Datastore.RollbackCallback} callback Node-style callback called with the error, if any, and RollbackResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.rollback = function rollback(request, callback) { + return this.rpcCall(rollback, $root.google.datastore.v1.RollbackRequest, $root.google.datastore.v1.RollbackResponse, request, callback); + }, "name", { value: "Rollback" }); - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; + /** + * Calls Rollback. + * @function rollback + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IRollbackRequest} request RollbackRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Callback as used by {@link google.datastore.v1.Datastore#allocateIds}. + * @memberof google.datastore.v1.Datastore + * @typedef AllocateIdsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.AllocateIdsResponse} [response] AllocateIdsResponse + */ - return Int32Value; - })(); + /** + * Calls AllocateIds. + * @function allocateIds + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IAllocateIdsRequest} request AllocateIdsRequest message or plain object + * @param {google.datastore.v1.Datastore.AllocateIdsCallback} callback Node-style callback called with the error, if any, and AllocateIdsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.allocateIds = function allocateIds(request, callback) { + return this.rpcCall(allocateIds, $root.google.datastore.v1.AllocateIdsRequest, $root.google.datastore.v1.AllocateIdsResponse, request, callback); + }, "name", { value: "AllocateIds" }); - protobuf.UInt32Value = (function() { + /** + * Calls AllocateIds. + * @function allocateIds + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IAllocateIdsRequest} request AllocateIdsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ + /** + * Callback as used by {@link google.datastore.v1.Datastore#reserveIds}. + * @memberof google.datastore.v1.Datastore + * @typedef ReserveIdsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.datastore.v1.ReserveIdsResponse} [response] ReserveIdsResponse + */ - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls ReserveIds. + * @function reserveIds + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IReserveIdsRequest} request ReserveIdsRequest message or plain object + * @param {google.datastore.v1.Datastore.ReserveIdsCallback} callback Node-style callback called with the error, if any, and ReserveIdsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Datastore.prototype.reserveIds = function reserveIds(request, callback) { + return this.rpcCall(reserveIds, $root.google.datastore.v1.ReserveIdsRequest, $root.google.datastore.v1.ReserveIdsResponse, request, callback); + }, "name", { value: "ReserveIds" }); - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; + /** + * Calls ReserveIds. + * @function reserveIds + * @memberof google.datastore.v1.Datastore + * @instance + * @param {google.datastore.v1.IReserveIdsRequest} request ReserveIdsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; + return Datastore; + })(); - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; + v1.LookupRequest = (function() { - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a LookupRequest. + * @memberof google.datastore.v1 + * @interface ILookupRequest + * @property {string|null} [projectId] LookupRequest projectId + * @property {google.datastore.v1.IReadOptions|null} [readOptions] LookupRequest readOptions + * @property {Array.|null} [keys] LookupRequest keys + */ - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new LookupRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a LookupRequest. + * @implements ILookupRequest + * @constructor + * @param {google.datastore.v1.ILookupRequest=} [properties] Properties to set + */ + function LookupRequest(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]]; } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; + /** + * LookupRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.LookupRequest + * @instance + */ + LookupRequest.prototype.projectId = ""; - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; + /** + * LookupRequest readOptions. + * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions + * @memberof google.datastore.v1.LookupRequest + * @instance + */ + LookupRequest.prototype.readOptions = null; - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; + /** + * LookupRequest keys. + * @member {Array.} keys + * @memberof google.datastore.v1.LookupRequest + * @instance + */ + LookupRequest.prototype.keys = $util.emptyArray; - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new LookupRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {google.datastore.v1.ILookupRequest=} [properties] Properties to set + * @returns {google.datastore.v1.LookupRequest} LookupRequest instance + */ + LookupRequest.create = function create(properties) { + return new LookupRequest(properties); + }; - return UInt32Value; - })(); + /** + * Encodes the specified LookupRequest message. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {google.datastore.v1.ILookupRequest} message LookupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) + $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + return writer; + }; - protobuf.BoolValue = (function() { + /** + * Encodes the specified LookupRequest message, length delimited. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {google.datastore.v1.ILookupRequest} message LookupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ + /** + * Decodes a LookupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.LookupRequest} LookupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 1: + message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes a LookupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.LookupRequest} LookupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; + /** + * Verifies a LookupRequest message. + * @function verify + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupRequest.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.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); + if (error) + return "readOptions." + error; + } + 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.datastore.v1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; + } + } + return null; + }; + + /** + * Creates a LookupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.LookupRequest} LookupRequest + */ + LookupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.LookupRequest) + return object; + var message = new $root.google.datastore.v1.LookupRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.datastore.v1.LookupRequest.readOptions: object expected"); + message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); + } + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.datastore.v1.LookupRequest.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.datastore.v1.LookupRequest.keys: object expected"); + message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LookupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.LookupRequest + * @static + * @param {google.datastore.v1.LookupRequest} message LookupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (options.defaults) { + object.readOptions = null; + object.projectId = ""; + } + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; + /** + * Converts this LookupRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.LookupRequest + * @instance + * @returns {Object.} JSON object + */ + LookupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; + return LookupRequest; + })(); - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v1.LookupResponse = (function() { - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Properties of a LookupResponse. + * @memberof google.datastore.v1 + * @interface ILookupResponse + * @property {Array.|null} [found] LookupResponse found + * @property {Array.|null} [missing] LookupResponse missing + * @property {Array.|null} [deferred] LookupResponse deferred + * @property {google.protobuf.ITimestamp|null} [readTime] LookupResponse readTime + */ + + /** + * Constructs a new LookupResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a LookupResponse. + * @implements ILookupResponse + * @constructor + * @param {google.datastore.v1.ILookupResponse=} [properties] Properties to set + */ + function LookupResponse(properties) { + this.found = []; + this.missing = []; + this.deferred = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * LookupResponse found. + * @member {Array.} found + * @memberof google.datastore.v1.LookupResponse + * @instance + */ + LookupResponse.prototype.found = $util.emptyArray; - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; + /** + * LookupResponse missing. + * @member {Array.} missing + * @memberof google.datastore.v1.LookupResponse + * @instance + */ + LookupResponse.prototype.missing = $util.emptyArray; - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; + /** + * LookupResponse deferred. + * @member {Array.} deferred + * @memberof google.datastore.v1.LookupResponse + * @instance + */ + LookupResponse.prototype.deferred = $util.emptyArray; - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; + /** + * LookupResponse readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.LookupResponse + * @instance + */ + LookupResponse.prototype.readTime = null; - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new LookupResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {google.datastore.v1.ILookupResponse=} [properties] Properties to set + * @returns {google.datastore.v1.LookupResponse} LookupResponse instance + */ + LookupResponse.create = function create(properties) { + return new LookupResponse(properties); + }; - return BoolValue; - })(); + /** + * Encodes the specified LookupResponse message. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {google.datastore.v1.ILookupResponse} message LookupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.found != null && message.found.length) + for (var i = 0; i < message.found.length; ++i) + $root.google.datastore.v1.EntityResult.encode(message.found[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.missing != null && message.missing.length) + for (var i = 0; i < message.missing.length; ++i) + $root.google.datastore.v1.EntityResult.encode(message.missing[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.deferred != null && message.deferred.length) + for (var i = 0; i < message.deferred.length; ++i) + $root.google.datastore.v1.Key.encode(message.deferred[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LookupResponse message, length delimited. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {google.datastore.v1.ILookupResponse} message LookupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LookupResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - protobuf.StringValue = (function() { + /** + * Decodes a LookupResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.LookupResponse} LookupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.found && message.found.length)) + message.found = []; + message.found.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.missing && message.missing.length)) + message.missing = []; + message.missing.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.deferred && message.deferred.length)) + message.deferred = []; + message.deferred.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + break; + case 7: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ + /** + * Decodes a LookupResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.LookupResponse} LookupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LookupResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Verifies a LookupResponse message. + * @function verify + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LookupResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.found != null && message.hasOwnProperty("found")) { + if (!Array.isArray(message.found)) + return "found: array expected"; + for (var i = 0; i < message.found.length; ++i) { + var error = $root.google.datastore.v1.EntityResult.verify(message.found[i]); + if (error) + return "found." + error; + } + } + if (message.missing != null && message.hasOwnProperty("missing")) { + if (!Array.isArray(message.missing)) + return "missing: array expected"; + for (var i = 0; i < message.missing.length; ++i) { + var error = $root.google.datastore.v1.EntityResult.verify(message.missing[i]); + if (error) + return "missing." + error; + } + } + if (message.deferred != null && message.hasOwnProperty("deferred")) { + if (!Array.isArray(message.deferred)) + return "deferred: array expected"; + for (var i = 0; i < message.deferred.length; ++i) { + var error = $root.google.datastore.v1.Key.verify(message.deferred[i]); + if (error) + return "deferred." + error; + } + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; + }; - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; + /** + * Creates a LookupResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.LookupResponse} LookupResponse + */ + LookupResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.LookupResponse) + return object; + var message = new $root.google.datastore.v1.LookupResponse(); + if (object.found) { + if (!Array.isArray(object.found)) + throw TypeError(".google.datastore.v1.LookupResponse.found: array expected"); + message.found = []; + for (var i = 0; i < object.found.length; ++i) { + if (typeof object.found[i] !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.found: object expected"); + message.found[i] = $root.google.datastore.v1.EntityResult.fromObject(object.found[i]); + } + } + if (object.missing) { + if (!Array.isArray(object.missing)) + throw TypeError(".google.datastore.v1.LookupResponse.missing: array expected"); + message.missing = []; + for (var i = 0; i < object.missing.length; ++i) { + if (typeof object.missing[i] !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.missing: object expected"); + message.missing[i] = $root.google.datastore.v1.EntityResult.fromObject(object.missing[i]); + } + } + if (object.deferred) { + if (!Array.isArray(object.deferred)) + throw TypeError(".google.datastore.v1.LookupResponse.deferred: array expected"); + message.deferred = []; + for (var i = 0; i < object.deferred.length; ++i) { + if (typeof object.deferred[i] !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.deferred: object expected"); + message.deferred[i] = $root.google.datastore.v1.Key.fromObject(object.deferred[i]); + } + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + return message; + }; - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; + /** + * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.LookupResponse + * @static + * @param {google.datastore.v1.LookupResponse} message LookupResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LookupResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.found = []; + object.missing = []; + object.deferred = []; + } + if (options.defaults) + object.readTime = null; + if (message.found && message.found.length) { + object.found = []; + for (var j = 0; j < message.found.length; ++j) + object.found[j] = $root.google.datastore.v1.EntityResult.toObject(message.found[j], options); + } + if (message.missing && message.missing.length) { + object.missing = []; + for (var j = 0; j < message.missing.length; ++j) + object.missing[j] = $root.google.datastore.v1.EntityResult.toObject(message.missing[j], options); + } + if (message.deferred && message.deferred.length) { + object.deferred = []; + for (var j = 0; j < message.deferred.length; ++j) + object.deferred[j] = $root.google.datastore.v1.Key.toObject(message.deferred[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + return object; + }; - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; + /** + * Converts this LookupResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.LookupResponse + * @instance + * @returns {Object.} JSON object + */ + LookupResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return LookupResponse; + })(); - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v1.RunQueryRequest = (function() { - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of a RunQueryRequest. + * @memberof google.datastore.v1 + * @interface IRunQueryRequest + * @property {string|null} [projectId] RunQueryRequest projectId + * @property {google.datastore.v1.IPartitionId|null} [partitionId] RunQueryRequest partitionId + * @property {google.datastore.v1.IReadOptions|null} [readOptions] RunQueryRequest readOptions + * @property {google.datastore.v1.IQuery|null} [query] RunQueryRequest query + * @property {google.datastore.v1.IGqlQuery|null} [gqlQuery] RunQueryRequest gqlQuery + */ - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; + /** + * Constructs a new RunQueryRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a RunQueryRequest. + * @implements IRunQueryRequest + * @constructor + * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set + */ + function RunQueryRequest(properties) { + if (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 StringValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.StringValue} StringValue - */ - StringValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; + /** + * RunQueryRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.projectId = ""; - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; + /** + * RunQueryRequest partitionId. + * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.partitionId = null; - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * RunQueryRequest readOptions. + * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.readOptions = null; - return StringValue; - })(); + /** + * RunQueryRequest query. + * @member {google.datastore.v1.IQuery|null|undefined} query + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.query = null; - protobuf.BytesValue = (function() { + /** + * RunQueryRequest gqlQuery. + * @member {google.datastore.v1.IGqlQuery|null|undefined} gqlQuery + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.gqlQuery = null; - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * RunQueryRequest queryType. + * @member {"query"|"gqlQuery"|undefined} queryType + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + Object.defineProperty(RunQueryRequest.prototype, "queryType", { + get: $util.oneOfGetter($oneOfFields = ["query", "gqlQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); + /** + * Creates a new RunQueryRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest instance + */ + RunQueryRequest.create = function create(properties) { + return new RunQueryRequest(properties); + }; + + /** + * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) + $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gqlQuery != null && Object.hasOwnProperty.call(message, "gqlQuery")) + $root.google.datastore.v1.GqlQuery.encode(message.gqlQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + return writer; + }; - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; + /** + * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; + /** + * Decodes a RunQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 2: + message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); + break; + case 1: + message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); + break; + case 3: + message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); + break; + case 7: + message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Verifies a RunQueryRequest message. + * @function verify + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunQueryRequest.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.partitionId != null && message.hasOwnProperty("partitionId")) { + var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); + if (error) + return "partitionId." + error; } - } - return message; - }; + if (message.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); + if (error) + return "readOptions." + error; + } + if (message.query != null && message.hasOwnProperty("query")) { + properties.queryType = 1; + { + var error = $root.google.datastore.v1.Query.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { + if (properties.queryType === 1) + return "queryType: multiple values"; + properties.queryType = 1; + { + var error = $root.google.datastore.v1.GqlQuery.verify(message.gqlQuery); + if (error) + return "gqlQuery." + error; + } + } + return null; + }; - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + */ + RunQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RunQueryRequest) + return object; + var message = new $root.google.datastore.v1.RunQueryRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.partitionId != null) { + if (typeof object.partitionId !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.partitionId: object expected"); + message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); + } + if (object.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.readOptions: object expected"); + message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.query: object expected"); + message.query = $root.google.datastore.v1.Query.fromObject(object.query); + } + if (object.gqlQuery != null) { + if (typeof object.gqlQuery !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.gqlQuery: object expected"); + message.gqlQuery = $root.google.datastore.v1.GqlQuery.fromObject(object.gqlQuery); + } + return message; + }; + + /** + * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {google.datastore.v1.RunQueryRequest} message RunQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readOptions = null; + object.partitionId = null; + object.projectId = ""; + } + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.google.datastore.v1.Query.toObject(message.query, options); + if (options.oneofs) + object.queryType = "query"; + } + if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { + object.gqlQuery = $root.google.datastore.v1.GqlQuery.toObject(message.gqlQuery, options); + if (options.oneofs) + object.queryType = "gqlQuery"; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; + /** + * Converts this RunQueryRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.RunQueryRequest + * @instance + * @returns {Object.} JSON object + */ + RunQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; + return RunQueryRequest; + })(); - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; + v1.RunQueryResponse = (function() { - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a RunQueryResponse. + * @memberof google.datastore.v1 + * @interface IRunQueryResponse + * @property {google.datastore.v1.IQueryResultBatch|null} [batch] RunQueryResponse batch + * @property {google.datastore.v1.IQuery|null} [query] RunQueryResponse query + */ - return BytesValue; - })(); + /** + * Constructs a new RunQueryResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a RunQueryResponse. + * @implements IRunQueryResponse + * @constructor + * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set + */ + function RunQueryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - protobuf.Any = (function() { + /** + * RunQueryResponse batch. + * @member {google.datastore.v1.IQueryResultBatch|null|undefined} batch + * @memberof google.datastore.v1.RunQueryResponse + * @instance + */ + RunQueryResponse.prototype.batch = null; - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ + /** + * RunQueryResponse query. + * @member {google.datastore.v1.IQuery|null|undefined} query + * @memberof google.datastore.v1.RunQueryResponse + * @instance + */ + RunQueryResponse.prototype.query = null; - /** - * 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]]; - } + /** + * Creates a new RunQueryResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse instance + */ + RunQueryResponse.create = function create(properties) { + return new RunQueryResponse(properties); + }; - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; + /** + * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) + $root.google.datastore.v1.QueryResultBatch.encode(message.batch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); + /** + * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes a RunQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.batch = $root.google.datastore.v1.QueryResultBatch.decode(reader, reader.uint32()); + break; + case 2: + message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * 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; - }; + /** + * Verifies a RunQueryResponse message. + * @function verify + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.batch != null && message.hasOwnProperty("batch")) { + var error = $root.google.datastore.v1.QueryResultBatch.verify(message.batch); + if (error) + return "batch." + error; + } + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.google.datastore.v1.Query.verify(message.query); + if (error) + return "query." + error; + } + return null; + }; - /** - * 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(); - }; + /** + * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + */ + RunQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RunQueryResponse) + return object; + var message = new $root.google.datastore.v1.RunQueryResponse(); + if (object.batch != null) { + if (typeof object.batch !== "object") + throw TypeError(".google.datastore.v1.RunQueryResponse.batch: object expected"); + message.batch = $root.google.datastore.v1.QueryResultBatch.fromObject(object.batch); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.datastore.v1.RunQueryResponse.query: object expected"); + message.query = $root.google.datastore.v1.Query.fromObject(object.query); + } + return message; + }; - /** - * 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) { - 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(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.RunQueryResponse} message RunQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.batch = null; + object.query = null; } - } - return message; - }; + if (message.batch != null && message.hasOwnProperty("batch")) + object.batch = $root.google.datastore.v1.QueryResultBatch.toObject(message.batch, options); + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.google.datastore.v1.Query.toObject(message.query, options); + return object; + }; - /** - * 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()); - }; + /** + * Converts this RunQueryResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.RunQueryResponse + * @instance + * @returns {Object.} JSON object + */ + RunQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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; - }; + return RunQueryResponse; + })(); - /** - * 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) - message.value = object.value; - return message; - }; + v1.BeginTransactionRequest = (function() { - /** - * 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; - }; + /** + * Properties of a BeginTransactionRequest. + * @memberof google.datastore.v1 + * @interface IBeginTransactionRequest + * @property {string|null} [projectId] BeginTransactionRequest projectId + * @property {google.datastore.v1.ITransactionOptions|null} [transactionOptions] BeginTransactionRequest transactionOptions + */ + + /** + * Constructs a new BeginTransactionRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a BeginTransactionRequest. + * @implements IBeginTransactionRequest + * @constructor + * @param {google.datastore.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]]; + } - /** - * 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); - }; + /** + * BeginTransactionRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.projectId = ""; - return Any; - })(); + /** + * BeginTransactionRequest transactionOptions. + * @member {google.datastore.v1.ITransactionOptions|null|undefined} transactionOptions + * @memberof google.datastore.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.transactionOptions = null; - protobuf.Duration = (function() { + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {google.datastore.v1.IBeginTransactionRequest=} [properties] Properties to set + * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest instance + */ + BeginTransactionRequest.create = function create(properties) { + return new BeginTransactionRequest(properties); + }; - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {google.datastore.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.transactionOptions != null && Object.hasOwnProperty.call(message, "transactionOptions")) + $root.google.datastore.v1.TransactionOptions.encode(message.transactionOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; - /** - * 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]]; - } + /** + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {google.datastore.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(); + }; - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 10: + message.transactionOptions = $root.google.datastore.v1.TransactionOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; + /** + * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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()); + }; - /** - * 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); - }; + /** + * Verifies a BeginTransactionRequest message. + * @function verify + * @memberof google.datastore.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.transactionOptions != null && message.hasOwnProperty("transactionOptions")) { + var error = $root.google.datastore.v1.TransactionOptions.verify(message.transactionOptions); + if (error) + return "transactionOptions." + error; + } + return null; + }; - /** - * 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; - }; + /** + * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest + */ + BeginTransactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.BeginTransactionRequest) + return object; + var message = new $root.google.datastore.v1.BeginTransactionRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.transactionOptions != null) { + if (typeof object.transactionOptions !== "object") + throw TypeError(".google.datastore.v1.BeginTransactionRequest.transactionOptions: object expected"); + message.transactionOptions = $root.google.datastore.v1.TransactionOptions.fromObject(object.transactionOptions); + } + return message; + }; + + /** + * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {google.datastore.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.projectId = ""; + object.transactionOptions = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.transactionOptions != null && message.hasOwnProperty("transactionOptions")) + object.transactionOptions = $root.google.datastore.v1.TransactionOptions.toObject(message.transactionOptions, options); + return object; + }; + + /** + * Converts this BeginTransactionRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.BeginTransactionRequest + * @instance + * @returns {Object.} JSON object + */ + BeginTransactionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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(); - }; + return BeginTransactionRequest; + })(); - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.seconds = reader.int64(); - break; - case 2: - message.nanos = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } + v1.BeginTransactionResponse = (function() { + + /** + * Properties of a BeginTransactionResponse. + * @memberof google.datastore.v1 + * @interface IBeginTransactionResponse + * @property {Uint8Array|null} [transaction] BeginTransactionResponse transaction + */ + + /** + * Constructs a new BeginTransactionResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a BeginTransactionResponse. + * @implements IBeginTransactionResponse + * @constructor + * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set + */ + function BeginTransactionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes a 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()); - }; + /** + * BeginTransactionResponse transaction. + * @member {Uint8Array} transaction + * @memberof google.datastore.v1.BeginTransactionResponse + * @instance + */ + BeginTransactionResponse.prototype.transaction = $util.newBuffer([]); - /** - * 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 new BeginTransactionResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse instance + */ + BeginTransactionResponse.create = function create(properties) { + return new BeginTransactionResponse(properties); + }; - /** - * 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; - }; + /** + * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + return writer; + }; - /** - * 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; - }; + /** + * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * 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); - }; + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.transaction = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return Duration; - })(); + /** + * Verifies a BeginTransactionResponse message. + * @function verify + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BeginTransactionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + return null; + }; - protobuf.Empty = (function() { + /** + * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse + */ + BeginTransactionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.BeginTransactionResponse) + return object; + var message = new $root.google.datastore.v1.BeginTransactionResponse(); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length) + message.transaction = object.transaction; + return message; + }; - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ + /** + * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.BeginTransactionResponse} message BeginTransactionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BeginTransactionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.transaction = ""; + else { + object.transaction = []; + if (options.bytes !== Array) + object.transaction = $util.newBuffer(object.transaction); + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + return object; + }; - /** - * 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]]; - } + /** + * Converts this BeginTransactionResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.BeginTransactionResponse + * @instance + * @returns {Object.} JSON object + */ + BeginTransactionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * 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); - }; + return BeginTransactionResponse; + })(); - /** - * 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; - }; + v1.RollbackRequest = (function() { - /** - * 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(); - }; + /** + * Properties of a RollbackRequest. + * @memberof google.datastore.v1 + * @interface IRollbackRequest + * @property {string|null} [projectId] RollbackRequest projectId + * @property {Uint8Array|null} [transaction] RollbackRequest transaction + */ - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new RollbackRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a RollbackRequest. + * @implements IRollbackRequest + * @constructor + * @param {google.datastore.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]]; } - 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()); - }; + /** + * RollbackRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.projectId = ""; - /** - * 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; - }; + /** + * RollbackRequest transaction. + * @member {Uint8Array} transaction + * @memberof google.datastore.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.transaction = $util.newBuffer([]); - /** - * 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 new RollbackRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.v1.IRollbackRequest=} [properties] Properties to set + * @returns {google.datastore.v1.RollbackRequest} RollbackRequest instance + */ + RollbackRequest.create = function create(properties) { + return new RollbackRequest(properties); + }; + + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + return writer; + }; - /** - * 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 {}; - }; + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.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(); + }; - /** - * 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); - }; + /** + * Decodes a RollbackRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 1: + message.transaction = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return Empty; - })(); + /** + * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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()); + }; - return protobuf; - })(); + /** + * Verifies a RollbackRequest message. + * @function verify + * @memberof google.datastore.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.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + return null; + }; - google.datastore = (function() { + /** + * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RollbackRequest} RollbackRequest + */ + RollbackRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RollbackRequest) + return object; + var message = new $root.google.datastore.v1.RollbackRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length) + message.transaction = object.transaction; + return message; + }; - /** - * Namespace datastore. - * @memberof google - * @namespace - */ - var datastore = {}; + /** + * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.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) { + if (options.bytes === String) + object.transaction = ""; + else { + object.transaction = []; + if (options.bytes !== Array) + object.transaction = $util.newBuffer(object.transaction); + } + object.projectId = ""; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + return object; + }; - datastore.v1 = (function() { + /** + * Converts this RollbackRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.RollbackRequest + * @instance + * @returns {Object.} JSON object + */ + RollbackRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Namespace v1. - * @memberof google.datastore - * @namespace - */ - var v1 = {}; + return RollbackRequest; + })(); - v1.AggregationResult = (function() { + v1.RollbackResponse = (function() { /** - * Properties of an AggregationResult. + * Properties of a RollbackResponse. * @memberof google.datastore.v1 - * @interface IAggregationResult - * @property {Object.|null} [aggregateProperties] AggregationResult aggregateProperties + * @interface IRollbackResponse */ /** - * Constructs a new AggregationResult. + * Constructs a new RollbackResponse. * @memberof google.datastore.v1 - * @classdesc Represents an AggregationResult. - * @implements IAggregationResult + * @classdesc Represents a RollbackResponse. + * @implements IRollbackResponse * @constructor - * @param {google.datastore.v1.IAggregationResult=} [properties] Properties to set + * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set */ - function AggregationResult(properties) { - this.aggregateProperties = {}; + function RollbackResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12176,98 +7934,63 @@ } /** - * AggregationResult aggregateProperties. - * @member {Object.} aggregateProperties - * @memberof google.datastore.v1.AggregationResult - * @instance - */ - AggregationResult.prototype.aggregateProperties = $util.emptyObject; - - /** - * Creates a new AggregationResult instance using the specified properties. + * Creates a new RollbackResponse instance using the specified properties. * @function create - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.RollbackResponse * @static - * @param {google.datastore.v1.IAggregationResult=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationResult} AggregationResult instance + * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse instance */ - AggregationResult.create = function create(properties) { - return new AggregationResult(properties); + RollbackResponse.create = function create(properties) { + return new RollbackResponse(properties); }; /** - * Encodes the specified AggregationResult message. Does not implicitly {@link google.datastore.v1.AggregationResult.verify|verify} messages. + * Encodes the specified RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.RollbackResponse * @static - * @param {google.datastore.v1.IAggregationResult} message AggregationResult message or plain object to encode + * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AggregationResult.encode = function encode(message, writer) { + RollbackResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.aggregateProperties != null && Object.hasOwnProperty.call(message, "aggregateProperties")) - for (var keys = Object.keys(message.aggregateProperties), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.datastore.v1.Value.encode(message.aggregateProperties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } return writer; }; /** - * Encodes the specified AggregationResult message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResult.verify|verify} messages. + * Encodes the specified RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.RollbackResponse * @static - * @param {google.datastore.v1.IAggregationResult} message AggregationResult message or plain object to encode + * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AggregationResult.encodeDelimited = function encodeDelimited(message, writer) { + RollbackResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AggregationResult message from the specified reader or buffer. + * Decodes a RollbackResponse message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.RollbackResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AggregationResult} AggregationResult + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AggregationResult.decode = function decode(reader, length) { + RollbackResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationResult(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - if (message.aggregateProperties === $util.emptyObject) - message.aggregateProperties = {}; - 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.datastore.v1.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.aggregateProperties[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -12277,129 +8000,98 @@ }; /** - * Decodes an AggregationResult message from the specified reader or buffer, length delimited. + * Decodes a RollbackResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.RollbackResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationResult} AggregationResult + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AggregationResult.decodeDelimited = function decodeDelimited(reader) { + RollbackResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AggregationResult message. + * Verifies a RollbackResponse message. * @function verify - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.RollbackResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AggregationResult.verify = function verify(message) { + RollbackResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.aggregateProperties != null && message.hasOwnProperty("aggregateProperties")) { - if (!$util.isObject(message.aggregateProperties)) - return "aggregateProperties: object expected"; - var key = Object.keys(message.aggregateProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.datastore.v1.Value.verify(message.aggregateProperties[key[i]]); - if (error) - return "aggregateProperties." + error; - } - } return null; }; /** - * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. + * Creates a RollbackResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.RollbackResponse * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationResult} AggregationResult + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse */ - AggregationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AggregationResult) - return object; - var message = new $root.google.datastore.v1.AggregationResult(); - if (object.aggregateProperties) { - if (typeof object.aggregateProperties !== "object") - throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); - message.aggregateProperties = {}; - for (var keys = Object.keys(object.aggregateProperties), i = 0; i < keys.length; ++i) { - if (typeof object.aggregateProperties[keys[i]] !== "object") - throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); - message.aggregateProperties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.aggregateProperties[keys[i]]); - } - } - return message; + RollbackResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RollbackResponse) + return object; + return new $root.google.datastore.v1.RollbackResponse(); }; /** - * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. + * Creates a plain object from a RollbackResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.RollbackResponse * @static - * @param {google.datastore.v1.AggregationResult} message AggregationResult + * @param {google.datastore.v1.RollbackResponse} message RollbackResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AggregationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.aggregateProperties = {}; - var keys2; - if (message.aggregateProperties && (keys2 = Object.keys(message.aggregateProperties)).length) { - object.aggregateProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.aggregateProperties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.aggregateProperties[keys2[j]], options); - } - return object; + RollbackResponse.toObject = function toObject() { + return {}; }; /** - * Converts this AggregationResult to JSON. + * Converts this RollbackResponse to JSON. * @function toJSON - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.RollbackResponse * @instance * @returns {Object.} JSON object */ - AggregationResult.prototype.toJSON = function toJSON() { + RollbackResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AggregationResult; + return RollbackResponse; })(); - v1.AggregationResultBatch = (function() { + v1.CommitRequest = (function() { /** - * Properties of an AggregationResultBatch. + * Properties of a CommitRequest. * @memberof google.datastore.v1 - * @interface IAggregationResultBatch - * @property {Array.|null} [aggregationResults] AggregationResultBatch aggregationResults - * @property {google.datastore.v1.QueryResultBatch.MoreResultsType|null} [moreResults] AggregationResultBatch moreResults - * @property {google.protobuf.ITimestamp|null} [readTime] AggregationResultBatch readTime + * @interface ICommitRequest + * @property {string|null} [projectId] CommitRequest projectId + * @property {google.datastore.v1.CommitRequest.Mode|null} [mode] CommitRequest mode + * @property {Uint8Array|null} [transaction] CommitRequest transaction + * @property {Array.|null} [mutations] CommitRequest mutations */ /** - * Constructs a new AggregationResultBatch. + * Constructs a new CommitRequest. * @memberof google.datastore.v1 - * @classdesc Represents an AggregationResultBatch. - * @implements IAggregationResultBatch + * @classdesc Represents a CommitRequest. + * @implements ICommitRequest * @constructor - * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set + * @param {google.datastore.v1.ICommitRequest=} [properties] Properties to set */ - function AggregationResultBatch(properties) { - this.aggregationResults = []; + function CommitRequest(properties) { + this.mutations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12407,104 +8099,131 @@ } /** - * AggregationResultBatch aggregationResults. - * @member {Array.} aggregationResults - * @memberof google.datastore.v1.AggregationResultBatch + * CommitRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.CommitRequest * @instance */ - AggregationResultBatch.prototype.aggregationResults = $util.emptyArray; + CommitRequest.prototype.projectId = ""; /** - * AggregationResultBatch moreResults. - * @member {google.datastore.v1.QueryResultBatch.MoreResultsType} moreResults - * @memberof google.datastore.v1.AggregationResultBatch + * CommitRequest mode. + * @member {google.datastore.v1.CommitRequest.Mode} mode + * @memberof google.datastore.v1.CommitRequest * @instance */ - AggregationResultBatch.prototype.moreResults = 0; + CommitRequest.prototype.mode = 0; /** - * AggregationResultBatch readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.AggregationResultBatch + * CommitRequest transaction. + * @member {Uint8Array|null|undefined} transaction + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.transaction = null; + + /** + * CommitRequest mutations. + * @member {Array.} mutations + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.mutations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitRequest transactionSelector. + * @member {"transaction"|undefined} transactionSelector + * @memberof google.datastore.v1.CommitRequest * @instance */ - AggregationResultBatch.prototype.readTime = null; + Object.defineProperty(CommitRequest.prototype, "transactionSelector", { + get: $util.oneOfGetter($oneOfFields = ["transaction"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new AggregationResultBatch instance using the specified properties. + * Creates a new CommitRequest instance using the specified properties. * @function create - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.CommitRequest * @static - * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch instance + * @param {google.datastore.v1.ICommitRequest=} [properties] Properties to set + * @returns {google.datastore.v1.CommitRequest} CommitRequest instance */ - AggregationResultBatch.create = function create(properties) { - return new AggregationResultBatch(properties); + CommitRequest.create = function create(properties) { + return new CommitRequest(properties); }; /** - * Encodes the specified AggregationResultBatch message. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.CommitRequest * @static - * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode + * @param {google.datastore.v1.ICommitRequest} message CommitRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AggregationResultBatch.encode = function encode(message, writer) { + CommitRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.aggregationResults != null && message.aggregationResults.length) - for (var i = 0; i < message.aggregationResults.length; ++i) - $root.google.datastore.v1.AggregationResult.encode(message.aggregationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.moreResults != null && Object.hasOwnProperty.call(message, "moreResults")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.moreResults); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.mode); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.datastore.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); return writer; }; /** - * Encodes the specified AggregationResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.CommitRequest * @static - * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode + * @param {google.datastore.v1.ICommitRequest} message CommitRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AggregationResultBatch.encodeDelimited = function encodeDelimited(message, writer) { + CommitRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AggregationResultBatch message from the specified reader or buffer. + * Decodes a CommitRequest message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.CommitRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + * @returns {google.datastore.v1.CommitRequest} CommitRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AggregationResultBatch.decode = function decode(reader, length) { + CommitRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationResultBatch(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.aggregationResults && message.aggregationResults.length)) - message.aggregationResults = []; - message.aggregationResults.push($root.google.datastore.v1.AggregationResult.decode(reader, reader.uint32())); + case 8: + message.projectId = reader.string(); break; - case 2: - message.moreResults = reader.int32(); + case 5: + message.mode = reader.int32(); break; - case 3: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 1: + message.transaction = reader.bytes(); + break; + case 6: + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.datastore.v1.Mutation.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -12515,177 +8234,195 @@ }; /** - * Decodes an AggregationResultBatch message from the specified reader or buffer, length delimited. + * Decodes a CommitRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.CommitRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + * @returns {google.datastore.v1.CommitRequest} CommitRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AggregationResultBatch.decodeDelimited = function decodeDelimited(reader) { + CommitRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AggregationResultBatch message. + * Verifies a CommitRequest message. * @function verify - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.CommitRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AggregationResultBatch.verify = function verify(message) { + CommitRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.aggregationResults != null && message.hasOwnProperty("aggregationResults")) { - if (!Array.isArray(message.aggregationResults)) - return "aggregationResults: array expected"; - for (var i = 0; i < message.aggregationResults.length; ++i) { - var error = $root.google.datastore.v1.AggregationResult.verify(message.aggregationResults[i]); - if (error) - return "aggregationResults." + error; - } - } - if (message.moreResults != null && message.hasOwnProperty("moreResults")) - switch (message.moreResults) { + var properties = {}; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { default: - return "moreResults: enum value expected"; + return "mode: enum value expected"; case 0: case 1: case 2: - case 4: - case 3: break; } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + properties.transactionSelector = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.datastore.v1.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } } return null; }; /** - * Creates an AggregationResultBatch message from a plain object. Also converts values to their respective internal types. + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.CommitRequest * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + * @returns {google.datastore.v1.CommitRequest} CommitRequest */ - AggregationResultBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AggregationResultBatch) + CommitRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.CommitRequest) return object; - var message = new $root.google.datastore.v1.AggregationResultBatch(); - if (object.aggregationResults) { - if (!Array.isArray(object.aggregationResults)) - throw TypeError(".google.datastore.v1.AggregationResultBatch.aggregationResults: array expected"); - message.aggregationResults = []; - for (var i = 0; i < object.aggregationResults.length; ++i) { - if (typeof object.aggregationResults[i] !== "object") - throw TypeError(".google.datastore.v1.AggregationResultBatch.aggregationResults: object expected"); - message.aggregationResults[i] = $root.google.datastore.v1.AggregationResult.fromObject(object.aggregationResults[i]); - } - } - switch (object.moreResults) { - case "MORE_RESULTS_TYPE_UNSPECIFIED": + var message = new $root.google.datastore.v1.CommitRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + switch (object.mode) { + case "MODE_UNSPECIFIED": case 0: - message.moreResults = 0; + message.mode = 0; break; - case "NOT_FINISHED": + case "TRANSACTIONAL": case 1: - message.moreResults = 1; + message.mode = 1; break; - case "MORE_RESULTS_AFTER_LIMIT": + case "NON_TRANSACTIONAL": case 2: - message.moreResults = 2; - break; - case "MORE_RESULTS_AFTER_CURSOR": - case 4: - message.moreResults = 4; - break; - case "NO_MORE_RESULTS": - case 3: - message.moreResults = 3; + message.mode = 2; break; } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.AggregationResultBatch.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length) + message.transaction = object.transaction; + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.datastore.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.datastore.v1.CommitRequest.mutations: object expected"); + message.mutations[i] = $root.google.datastore.v1.Mutation.fromObject(object.mutations[i]); + } } return message; }; /** - * Creates a plain object from an AggregationResultBatch message. Also converts values to other types if specified. + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.CommitRequest * @static - * @param {google.datastore.v1.AggregationResultBatch} message AggregationResultBatch + * @param {google.datastore.v1.CommitRequest} message CommitRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AggregationResultBatch.toObject = function toObject(message, options) { + CommitRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.aggregationResults = []; + object.mutations = []; if (options.defaults) { - object.moreResults = options.enums === String ? "MORE_RESULTS_TYPE_UNSPECIFIED" : 0; - object.readTime = null; + object.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.projectId = ""; } - if (message.aggregationResults && message.aggregationResults.length) { - object.aggregationResults = []; - for (var j = 0; j < message.aggregationResults.length; ++j) - object.aggregationResults[j] = $root.google.datastore.v1.AggregationResult.toObject(message.aggregationResults[j], options); + if (message.transaction != null && message.hasOwnProperty("transaction")) { + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (options.oneofs) + object.transactionSelector = "transaction"; } - if (message.moreResults != null && message.hasOwnProperty("moreResults")) - object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.datastore.v1.CommitRequest.Mode[message.mode] : message.mode; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.datastore.v1.Mutation.toObject(message.mutations[j], options); + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; return object; }; /** - * Converts this AggregationResultBatch to JSON. + * Converts this CommitRequest to JSON. * @function toJSON - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.CommitRequest * @instance * @returns {Object.} JSON object */ - AggregationResultBatch.prototype.toJSON = function toJSON() { + CommitRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AggregationResultBatch; + /** + * Mode enum. + * @name google.datastore.v1.CommitRequest.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} TRANSACTIONAL=1 TRANSACTIONAL value + * @property {number} NON_TRANSACTIONAL=2 NON_TRANSACTIONAL value + */ + CommitRequest.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRANSACTIONAL"] = 1; + values[valuesById[2] = "NON_TRANSACTIONAL"] = 2; + return values; + })(); + + return CommitRequest; })(); - v1.PartitionId = (function() { + v1.CommitResponse = (function() { /** - * Properties of a PartitionId. - * @memberof google.datastore.v1 - * @interface IPartitionId - * @property {string|null} [projectId] PartitionId projectId - * @property {string|null} [databaseId] PartitionId databaseId - * @property {string|null} [namespaceId] PartitionId namespaceId + * Properties of a CommitResponse. + * @memberof google.datastore.v1 + * @interface ICommitResponse + * @property {Array.|null} [mutationResults] CommitResponse mutationResults + * @property {number|null} [indexUpdates] CommitResponse indexUpdates + * @property {google.protobuf.ITimestamp|null} [commitTime] CommitResponse commitTime */ /** - * Constructs a new PartitionId. + * Constructs a new CommitResponse. * @memberof google.datastore.v1 - * @classdesc Represents a PartitionId. - * @implements IPartitionId + * @classdesc Represents a CommitResponse. + * @implements ICommitResponse * @constructor - * @param {google.datastore.v1.IPartitionId=} [properties] Properties to set + * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set */ - function PartitionId(properties) { + function CommitResponse(properties) { + this.mutationResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12693,101 +8430,104 @@ } /** - * PartitionId projectId. - * @member {string} projectId - * @memberof google.datastore.v1.PartitionId + * CommitResponse mutationResults. + * @member {Array.} mutationResults + * @memberof google.datastore.v1.CommitResponse * @instance */ - PartitionId.prototype.projectId = ""; + CommitResponse.prototype.mutationResults = $util.emptyArray; /** - * PartitionId databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.PartitionId + * CommitResponse indexUpdates. + * @member {number} indexUpdates + * @memberof google.datastore.v1.CommitResponse * @instance */ - PartitionId.prototype.databaseId = ""; + CommitResponse.prototype.indexUpdates = 0; /** - * PartitionId namespaceId. - * @member {string} namespaceId - * @memberof google.datastore.v1.PartitionId + * CommitResponse commitTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitTime + * @memberof google.datastore.v1.CommitResponse * @instance */ - PartitionId.prototype.namespaceId = ""; + CommitResponse.prototype.commitTime = null; /** - * Creates a new PartitionId instance using the specified properties. + * Creates a new CommitResponse instance using the specified properties. * @function create - * @memberof google.datastore.v1.PartitionId + * @memberof google.datastore.v1.CommitResponse * @static - * @param {google.datastore.v1.IPartitionId=} [properties] Properties to set - * @returns {google.datastore.v1.PartitionId} PartitionId instance + * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set + * @returns {google.datastore.v1.CommitResponse} CommitResponse instance */ - PartitionId.create = function create(properties) { - return new PartitionId(properties); + CommitResponse.create = function create(properties) { + return new CommitResponse(properties); }; /** - * Encodes the specified PartitionId message. Does not implicitly {@link google.datastore.v1.PartitionId.verify|verify} messages. + * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.PartitionId + * @memberof google.datastore.v1.CommitResponse * @static - * @param {google.datastore.v1.IPartitionId} message PartitionId message or plain object to encode + * @param {google.datastore.v1.ICommitResponse} message CommitResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionId.encode = function encode(message, writer) { + CommitResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - 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.namespaceId != null && Object.hasOwnProperty.call(message, "namespaceId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.namespaceId); + if (message.mutationResults != null && message.mutationResults.length) + for (var i = 0; i < message.mutationResults.length; ++i) + $root.google.datastore.v1.MutationResult.encode(message.mutationResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.indexUpdates != null && Object.hasOwnProperty.call(message, "indexUpdates")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.indexUpdates); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified PartitionId message, length delimited. Does not implicitly {@link google.datastore.v1.PartitionId.verify|verify} messages. + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.PartitionId + * @memberof google.datastore.v1.CommitResponse * @static - * @param {google.datastore.v1.IPartitionId} message PartitionId message or plain object to encode + * @param {google.datastore.v1.ICommitResponse} message CommitResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PartitionId.encodeDelimited = function encodeDelimited(message, writer) { + CommitResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PartitionId message from the specified reader or buffer. + * Decodes a CommitResponse message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.PartitionId + * @memberof google.datastore.v1.CommitResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.PartitionId} PartitionId + * @returns {google.datastore.v1.CommitResponse} CommitResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionId.decode = function decode(reader, length) { + CommitResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PartitionId(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - message.projectId = reader.string(); - break; case 3: - message.databaseId = reader.string(); + if (!(message.mutationResults && message.mutationResults.length)) + message.mutationResults = []; + message.mutationResults.push($root.google.datastore.v1.MutationResult.decode(reader, reader.uint32())); break; case 4: - message.namespaceId = reader.string(); + message.indexUpdates = reader.int32(); + break; + case 8: + message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -12798,126 +8538,149 @@ }; /** - * Decodes a PartitionId message from the specified reader or buffer, length delimited. + * Decodes a CommitResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.PartitionId + * @memberof google.datastore.v1.CommitResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.PartitionId} PartitionId + * @returns {google.datastore.v1.CommitResponse} CommitResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PartitionId.decodeDelimited = function decodeDelimited(reader) { + CommitResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PartitionId message. + * Verifies a CommitResponse message. * @function verify - * @memberof google.datastore.v1.PartitionId + * @memberof google.datastore.v1.CommitResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PartitionId.verify = function verify(message) { + CommitResponse.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.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.namespaceId != null && message.hasOwnProperty("namespaceId")) - if (!$util.isString(message.namespaceId)) - return "namespaceId: string expected"; + if (message.mutationResults != null && message.hasOwnProperty("mutationResults")) { + if (!Array.isArray(message.mutationResults)) + return "mutationResults: array expected"; + for (var i = 0; i < message.mutationResults.length; ++i) { + var error = $root.google.datastore.v1.MutationResult.verify(message.mutationResults[i]); + if (error) + return "mutationResults." + error; + } + } + if (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) + if (!$util.isInteger(message.indexUpdates)) + return "indexUpdates: integer expected"; + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTime); + if (error) + return "commitTime." + error; + } return null; }; /** - * Creates a PartitionId message from a plain object. Also converts values to their respective internal types. + * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.PartitionId + * @memberof google.datastore.v1.CommitResponse * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.PartitionId} PartitionId + * @returns {google.datastore.v1.CommitResponse} CommitResponse */ - PartitionId.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.PartitionId) + CommitResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.CommitResponse) return object; - var message = new $root.google.datastore.v1.PartitionId(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.namespaceId != null) - message.namespaceId = String(object.namespaceId); + var message = new $root.google.datastore.v1.CommitResponse(); + if (object.mutationResults) { + if (!Array.isArray(object.mutationResults)) + throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: array expected"); + message.mutationResults = []; + for (var i = 0; i < object.mutationResults.length; ++i) { + if (typeof object.mutationResults[i] !== "object") + throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: object expected"); + message.mutationResults[i] = $root.google.datastore.v1.MutationResult.fromObject(object.mutationResults[i]); + } + } + if (object.indexUpdates != null) + message.indexUpdates = object.indexUpdates | 0; + if (object.commitTime != null) { + if (typeof object.commitTime !== "object") + throw TypeError(".google.datastore.v1.CommitResponse.commitTime: object expected"); + message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); + } return message; }; /** - * Creates a plain object from a PartitionId message. Also converts values to other types if specified. + * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.PartitionId + * @memberof google.datastore.v1.CommitResponse * @static - * @param {google.datastore.v1.PartitionId} message PartitionId + * @param {google.datastore.v1.CommitResponse} message CommitResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PartitionId.toObject = function toObject(message, options) { + CommitResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.mutationResults = []; if (options.defaults) { - object.projectId = ""; - object.databaseId = ""; - object.namespaceId = ""; + object.indexUpdates = 0; + object.commitTime = null; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.namespaceId != null && message.hasOwnProperty("namespaceId")) - object.namespaceId = message.namespaceId; + if (message.mutationResults && message.mutationResults.length) { + object.mutationResults = []; + for (var j = 0; j < message.mutationResults.length; ++j) + object.mutationResults[j] = $root.google.datastore.v1.MutationResult.toObject(message.mutationResults[j], options); + } + if (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) + object.indexUpdates = message.indexUpdates; + if (message.commitTime != null && message.hasOwnProperty("commitTime")) + object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); return object; }; /** - * Converts this PartitionId to JSON. + * Converts this CommitResponse to JSON. * @function toJSON - * @memberof google.datastore.v1.PartitionId + * @memberof google.datastore.v1.CommitResponse * @instance * @returns {Object.} JSON object */ - PartitionId.prototype.toJSON = function toJSON() { + CommitResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PartitionId; + return CommitResponse; })(); - v1.Key = (function() { + v1.AllocateIdsRequest = (function() { /** - * Properties of a Key. + * Properties of an AllocateIdsRequest. * @memberof google.datastore.v1 - * @interface IKey - * @property {google.datastore.v1.IPartitionId|null} [partitionId] Key partitionId - * @property {Array.|null} [path] Key path + * @interface IAllocateIdsRequest + * @property {string|null} [projectId] AllocateIdsRequest projectId + * @property {Array.|null} [keys] AllocateIdsRequest keys */ /** - * Constructs a new Key. + * Constructs a new AllocateIdsRequest. * @memberof google.datastore.v1 - * @classdesc Represents a Key. - * @implements IKey + * @classdesc Represents an AllocateIdsRequest. + * @implements IAllocateIdsRequest * @constructor - * @param {google.datastore.v1.IKey=} [properties] Properties to set + * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set */ - function Key(properties) { - this.path = []; + function AllocateIdsRequest(properties) { + this.keys = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12925,91 +8688,91 @@ } /** - * Key partitionId. - * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId - * @memberof google.datastore.v1.Key + * AllocateIdsRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.AllocateIdsRequest * @instance */ - Key.prototype.partitionId = null; + AllocateIdsRequest.prototype.projectId = ""; /** - * Key path. - * @member {Array.} path - * @memberof google.datastore.v1.Key + * AllocateIdsRequest keys. + * @member {Array.} keys + * @memberof google.datastore.v1.AllocateIdsRequest * @instance */ - Key.prototype.path = $util.emptyArray; + AllocateIdsRequest.prototype.keys = $util.emptyArray; /** - * Creates a new Key instance using the specified properties. + * Creates a new AllocateIdsRequest instance using the specified properties. * @function create - * @memberof google.datastore.v1.Key + * @memberof google.datastore.v1.AllocateIdsRequest * @static - * @param {google.datastore.v1.IKey=} [properties] Properties to set - * @returns {google.datastore.v1.Key} Key instance + * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest instance */ - Key.create = function create(properties) { - return new Key(properties); + AllocateIdsRequest.create = function create(properties) { + return new AllocateIdsRequest(properties); }; /** - * Encodes the specified Key message. Does not implicitly {@link google.datastore.v1.Key.verify|verify} messages. + * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.Key + * @memberof google.datastore.v1.AllocateIdsRequest * @static - * @param {google.datastore.v1.IKey} message Key message or plain object to encode + * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Key.encode = function encode(message, writer) { + AllocateIdsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) - $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.path != null && message.path.length) - for (var i = 0; i < message.path.length; ++i) - $root.google.datastore.v1.Key.PathElement.encode(message.path[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); return writer; }; /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.datastore.v1.Key.verify|verify} messages. + * Encodes the specified AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.Key + * @memberof google.datastore.v1.AllocateIdsRequest * @static - * @param {google.datastore.v1.IKey} message Key message or plain object to encode + * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Key.encodeDelimited = function encodeDelimited(message, writer) { + AllocateIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Key message from the specified reader or buffer. + * Decodes an AllocateIdsRequest message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.Key + * @memberof google.datastore.v1.AllocateIdsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Key} Key + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest * @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) { + AllocateIdsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Key(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); + case 8: + message.projectId = reader.string(); break; - case 2: - if (!(message.path && message.path.length)) - message.path = []; - message.path.push($root.google.datastore.v1.Key.PathElement.decode(reader, reader.uint32())); + case 1: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -13020,405 +8783,344 @@ }; /** - * Decodes a Key message from the specified reader or buffer, length delimited. + * Decodes an AllocateIdsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.Key + * @memberof google.datastore.v1.AllocateIdsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Key} Key + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest * @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) { + AllocateIdsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Key message. + * Verifies an AllocateIdsRequest message. * @function verify - * @memberof google.datastore.v1.Key + * @memberof google.datastore.v1.AllocateIdsRequest * @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) { + AllocateIdsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.partitionId != null && message.hasOwnProperty("partitionId")) { - var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); - if (error) - return "partitionId." + error; - } - 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) { - var error = $root.google.datastore.v1.Key.PathElement.verify(message.path[i]); + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: 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.datastore.v1.Key.verify(message.keys[i]); if (error) - return "path." + error; + return "keys." + error; } } return null; }; /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. + * Creates an AllocateIdsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.Key + * @memberof google.datastore.v1.AllocateIdsRequest * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.Key} Key + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest */ - Key.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Key) + AllocateIdsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AllocateIdsRequest) return object; - var message = new $root.google.datastore.v1.Key(); - if (object.partitionId != null) { - if (typeof object.partitionId !== "object") - throw TypeError(".google.datastore.v1.Key.partitionId: object expected"); - message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); - } - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.datastore.v1.Key.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) { - if (typeof object.path[i] !== "object") - throw TypeError(".google.datastore.v1.Key.path: object expected"); - message.path[i] = $root.google.datastore.v1.Key.PathElement.fromObject(object.path[i]); + var message = new $root.google.datastore.v1.AllocateIdsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.datastore.v1.AllocateIdsRequest.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.datastore.v1.AllocateIdsRequest.keys: object expected"); + message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); } } return message; }; /** - * Creates a plain object from a Key message. Also converts values to other types if specified. + * Creates a plain object from an AllocateIdsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.Key + * @memberof google.datastore.v1.AllocateIdsRequest * @static - * @param {google.datastore.v1.Key} message Key + * @param {google.datastore.v1.AllocateIdsRequest} message AllocateIdsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Key.toObject = function toObject(message, options) { + AllocateIdsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.path = []; + object.keys = []; if (options.defaults) - object.partitionId = null; - if (message.partitionId != null && message.hasOwnProperty("partitionId")) - object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = $root.google.datastore.v1.Key.PathElement.toObject(message.path[j], options); + object.projectId = ""; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; return object; }; /** - * Converts this Key to JSON. - * @function toJSON - * @memberof google.datastore.v1.Key - * @instance - * @returns {Object.} JSON object - */ - Key.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Key.PathElement = (function() { - - /** - * Properties of a PathElement. - * @memberof google.datastore.v1.Key - * @interface IPathElement - * @property {string|null} [kind] PathElement kind - * @property {number|Long|null} [id] PathElement id - * @property {string|null} [name] PathElement name - */ - - /** - * Constructs a new PathElement. - * @memberof google.datastore.v1.Key - * @classdesc Represents a PathElement. - * @implements IPathElement - * @constructor - * @param {google.datastore.v1.Key.IPathElement=} [properties] Properties to set - */ - function PathElement(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PathElement kind. - * @member {string} kind - * @memberof google.datastore.v1.Key.PathElement - * @instance - */ - PathElement.prototype.kind = ""; - - /** - * PathElement id. - * @member {number|Long|null|undefined} id - * @memberof google.datastore.v1.Key.PathElement - * @instance - */ - PathElement.prototype.id = null; - - /** - * PathElement name. - * @member {string|null|undefined} name - * @memberof google.datastore.v1.Key.PathElement - * @instance - */ - PathElement.prototype.name = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PathElement idType. - * @member {"id"|"name"|undefined} idType - * @memberof google.datastore.v1.Key.PathElement - * @instance - */ - Object.defineProperty(PathElement.prototype, "idType", { - get: $util.oneOfGetter($oneOfFields = ["id", "name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PathElement instance using the specified properties. - * @function create - * @memberof google.datastore.v1.Key.PathElement - * @static - * @param {google.datastore.v1.Key.IPathElement=} [properties] Properties to set - * @returns {google.datastore.v1.Key.PathElement} PathElement instance - */ - PathElement.create = function create(properties) { - return new PathElement(properties); - }; - - /** - * Encodes the specified PathElement message. Does not implicitly {@link google.datastore.v1.Key.PathElement.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.Key.PathElement - * @static - * @param {google.datastore.v1.Key.IPathElement} message PathElement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PathElement.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.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.id); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); - return writer; - }; + * Converts this AllocateIdsRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.AllocateIdsRequest + * @instance + * @returns {Object.} JSON object + */ + AllocateIdsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified PathElement message, length delimited. Does not implicitly {@link google.datastore.v1.Key.PathElement.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.Key.PathElement - * @static - * @param {google.datastore.v1.Key.IPathElement} message PathElement message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PathElement.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return AllocateIdsRequest; + })(); - /** - * Decodes a PathElement message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.Key.PathElement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Key.PathElement} PathElement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PathElement.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Key.PathElement(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.kind = reader.string(); - break; - case 2: - message.id = reader.int64(); - break; - case 3: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v1.AllocateIdsResponse = (function() { - /** - * Decodes a PathElement message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.Key.PathElement - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Key.PathElement} PathElement - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PathElement.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of an AllocateIdsResponse. + * @memberof google.datastore.v1 + * @interface IAllocateIdsResponse + * @property {Array.|null} [keys] AllocateIdsResponse keys + */ - /** - * Verifies a PathElement message. - * @function verify - * @memberof google.datastore.v1.Key.PathElement - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PathElement.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.id != null && message.hasOwnProperty("id")) { - properties.idType = 1; - if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) - return "id: integer|Long expected"; - } - if (message.name != null && message.hasOwnProperty("name")) { - if (properties.idType === 1) - return "idType: multiple values"; - properties.idType = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - return null; - }; + /** + * Constructs a new AllocateIdsResponse. + * @memberof google.datastore.v1 + * @classdesc Represents an AllocateIdsResponse. + * @implements IAllocateIdsResponse + * @constructor + * @param {google.datastore.v1.IAllocateIdsResponse=} [properties] Properties to set + */ + function AllocateIdsResponse(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]]; + } - /** - * Creates a PathElement message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.Key.PathElement - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.Key.PathElement} PathElement - */ - PathElement.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Key.PathElement) - return object; - var message = new $root.google.datastore.v1.Key.PathElement(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.id != null) - if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = false; - else if (typeof object.id === "string") - message.id = parseInt(object.id, 10); - else if (typeof object.id === "number") - message.id = object.id; - else if (typeof object.id === "object") - message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * AllocateIdsResponse keys. + * @member {Array.} keys + * @memberof google.datastore.v1.AllocateIdsResponse + * @instance + */ + AllocateIdsResponse.prototype.keys = $util.emptyArray; - /** - * Creates a plain object from a PathElement message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.Key.PathElement - * @static - * @param {google.datastore.v1.Key.PathElement} message PathElement - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PathElement.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.kind = ""; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.id != null && message.hasOwnProperty("id")) { - if (typeof message.id === "number") - object.id = options.longs === String ? String(message.id) : message.id; - else - object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; - if (options.oneofs) - object.idType = "id"; + /** + * Creates a new AllocateIdsResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {google.datastore.v1.IAllocateIdsResponse=} [properties] Properties to set + * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse instance + */ + AllocateIdsResponse.create = function create(properties) { + return new AllocateIdsResponse(properties); + }; + + /** + * Encodes the specified AllocateIdsResponse message. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {google.datastore.v1.IAllocateIdsResponse} message AllocateIdsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocateIdsResponse.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AllocateIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {google.datastore.v1.IAllocateIdsResponse} message AllocateIdsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocateIdsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocateIdsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocateIdsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object.idType = "name"; + } + return message; + }; + + /** + * Decodes an AllocateIdsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocateIdsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocateIdsResponse message. + * @function verify + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocateIdsResponse.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.datastore.v1.Key.verify(message.keys[i]); + if (error) + return "keys." + error; } + } + return null; + }; + + /** + * Creates an AllocateIdsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse + */ + AllocateIdsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AllocateIdsResponse) return object; - }; + var message = new $root.google.datastore.v1.AllocateIdsResponse(); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.datastore.v1.AllocateIdsResponse.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.datastore.v1.AllocateIdsResponse.keys: object expected"); + message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); + } + } + return message; + }; - /** - * Converts this PathElement to JSON. - * @function toJSON - * @memberof google.datastore.v1.Key.PathElement - * @instance - * @returns {Object.} JSON object - */ - PathElement.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an AllocateIdsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AllocateIdsResponse + * @static + * @param {google.datastore.v1.AllocateIdsResponse} message AllocateIdsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocateIdsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keys = []; + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + } + return object; + }; - return PathElement; - })(); + /** + * Converts this AllocateIdsResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.AllocateIdsResponse + * @instance + * @returns {Object.} JSON object + */ + AllocateIdsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Key; + return AllocateIdsResponse; })(); - v1.ArrayValue = (function() { + v1.ReserveIdsRequest = (function() { /** - * Properties of an ArrayValue. + * Properties of a ReserveIdsRequest. * @memberof google.datastore.v1 - * @interface IArrayValue - * @property {Array.|null} [values] ArrayValue values + * @interface IReserveIdsRequest + * @property {string|null} [projectId] ReserveIdsRequest projectId + * @property {string|null} [databaseId] ReserveIdsRequest databaseId + * @property {Array.|null} [keys] ReserveIdsRequest keys */ /** - * Constructs a new ArrayValue. + * Constructs a new ReserveIdsRequest. * @memberof google.datastore.v1 - * @classdesc Represents an ArrayValue. - * @implements IArrayValue + * @classdesc Represents a ReserveIdsRequest. + * @implements IReserveIdsRequest * @constructor - * @param {google.datastore.v1.IArrayValue=} [properties] Properties to set + * @param {google.datastore.v1.IReserveIdsRequest=} [properties] Properties to set */ - function ArrayValue(properties) { - this.values = []; + function ReserveIdsRequest(properties) { + this.keys = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13426,78 +9128,104 @@ } /** - * ArrayValue values. - * @member {Array.} values - * @memberof google.datastore.v1.ArrayValue + * ReserveIdsRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.ReserveIdsRequest * @instance */ - ArrayValue.prototype.values = $util.emptyArray; + ReserveIdsRequest.prototype.projectId = ""; /** - * Creates a new ArrayValue instance using the specified properties. + * ReserveIdsRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.ReserveIdsRequest + * @instance + */ + ReserveIdsRequest.prototype.databaseId = ""; + + /** + * ReserveIdsRequest keys. + * @member {Array.} keys + * @memberof google.datastore.v1.ReserveIdsRequest + * @instance + */ + ReserveIdsRequest.prototype.keys = $util.emptyArray; + + /** + * Creates a new ReserveIdsRequest instance using the specified properties. * @function create - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.ReserveIdsRequest * @static - * @param {google.datastore.v1.IArrayValue=} [properties] Properties to set - * @returns {google.datastore.v1.ArrayValue} ArrayValue instance + * @param {google.datastore.v1.IReserveIdsRequest=} [properties] Properties to set + * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest instance */ - ArrayValue.create = function create(properties) { - return new ArrayValue(properties); + ReserveIdsRequest.create = function create(properties) { + return new ReserveIdsRequest(properties); }; /** - * Encodes the specified ArrayValue message. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. + * Encodes the specified ReserveIdsRequest message. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.ReserveIdsRequest * @static - * @param {google.datastore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {google.datastore.v1.IReserveIdsRequest} message ReserveIdsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArrayValue.encode = function encode(message, writer) { + ReserveIdsRequest.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.datastore.v1.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.keys != null && message.keys.length) + for (var i = 0; i < message.keys.length; ++i) + $root.google.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); return writer; }; /** - * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. + * Encodes the specified ReserveIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.ReserveIdsRequest * @static - * @param {google.datastore.v1.IArrayValue} message ArrayValue message or plain object to encode + * @param {google.datastore.v1.IReserveIdsRequest} message ReserveIdsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { + ReserveIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ArrayValue message from the specified reader or buffer. + * Decodes a ReserveIdsRequest message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.ReserveIdsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.ArrayValue} ArrayValue + * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArrayValue.decode = function decode(reader, length) { + ReserveIdsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ArrayValue(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 8: + message.projectId = reader.string(); + break; + case 9: + message.databaseId = reader.string(); + break; case 1: - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.datastore.v1.Value.decode(reader, reader.uint32())); + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -13508,136 +9236,141 @@ }; /** - * Decodes an ArrayValue message from the specified reader or buffer, length delimited. + * Decodes a ReserveIdsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.ReserveIdsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ArrayValue} ArrayValue + * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ArrayValue.decodeDelimited = function decodeDelimited(reader) { + ReserveIdsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ArrayValue message. + * Verifies a ReserveIdsRequest message. * @function verify - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.ReserveIdsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ArrayValue.verify = function verify(message) { + ReserveIdsRequest.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.datastore.v1.Value.verify(message.values[i]); + 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.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.datastore.v1.Key.verify(message.keys[i]); if (error) - return "values." + error; + return "keys." + error; } } return null; }; /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. + * Creates a ReserveIdsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.ReserveIdsRequest * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.ArrayValue} ArrayValue - */ - ArrayValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.ArrayValue) + * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest + */ + ReserveIdsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.ReserveIdsRequest) return object; - var message = new $root.google.datastore.v1.ArrayValue(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.datastore.v1.ArrayValue.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.datastore.v1.ArrayValue.values: object expected"); - message.values[i] = $root.google.datastore.v1.Value.fromObject(object.values[i]); + var message = new $root.google.datastore.v1.ReserveIdsRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.keys) { + if (!Array.isArray(object.keys)) + throw TypeError(".google.datastore.v1.ReserveIdsRequest.keys: array expected"); + message.keys = []; + for (var i = 0; i < object.keys.length; ++i) { + if (typeof object.keys[i] !== "object") + throw TypeError(".google.datastore.v1.ReserveIdsRequest.keys: object expected"); + message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); } } return message; }; /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. + * Creates a plain object from a ReserveIdsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.ReserveIdsRequest * @static - * @param {google.datastore.v1.ArrayValue} message ArrayValue + * @param {google.datastore.v1.ReserveIdsRequest} message ReserveIdsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ArrayValue.toObject = function toObject(message, options) { + ReserveIdsRequest.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.datastore.v1.Value.toObject(message.values[j], options); + object.keys = []; + if (options.defaults) { + object.projectId = ""; + object.databaseId = ""; + } + if (message.keys && message.keys.length) { + object.keys = []; + for (var j = 0; j < message.keys.length; ++j) + object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); } + 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 ArrayValue to JSON. + * Converts this ReserveIdsRequest to JSON. * @function toJSON - * @memberof google.datastore.v1.ArrayValue + * @memberof google.datastore.v1.ReserveIdsRequest * @instance * @returns {Object.} JSON object */ - ArrayValue.prototype.toJSON = function toJSON() { + ReserveIdsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ArrayValue; + return ReserveIdsRequest; })(); - v1.Value = (function() { + v1.ReserveIdsResponse = (function() { /** - * Properties of a Value. + * Properties of a ReserveIdsResponse. * @memberof google.datastore.v1 - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {boolean|null} [booleanValue] Value booleanValue - * @property {number|Long|null} [integerValue] Value integerValue - * @property {number|null} [doubleValue] Value doubleValue - * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue - * @property {google.datastore.v1.IKey|null} [keyValue] Value keyValue - * @property {string|null} [stringValue] Value stringValue - * @property {Uint8Array|null} [blobValue] Value blobValue - * @property {google.type.ILatLng|null} [geoPointValue] Value geoPointValue - * @property {google.datastore.v1.IEntity|null} [entityValue] Value entityValue - * @property {google.datastore.v1.IArrayValue|null} [arrayValue] Value arrayValue - * @property {number|null} [meaning] Value meaning - * @property {boolean|null} [excludeFromIndexes] Value excludeFromIndexes + * @interface IReserveIdsResponse */ /** - * Constructs a new Value. + * Constructs a new ReserveIdsResponse. * @memberof google.datastore.v1 - * @classdesc Represents a Value. - * @implements IValue + * @classdesc Represents a ReserveIdsResponse. + * @implements IReserveIdsResponse * @constructor - * @param {google.datastore.v1.IValue=} [properties] Properties to set + * @param {google.datastore.v1.IReserveIdsResponse=} [properties] Properties to set */ - function Value(properties) { + function ReserveIdsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13645,246 +9378,63 @@ } /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value booleanValue. - * @member {boolean|null|undefined} booleanValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.booleanValue = null; - - /** - * Value integerValue. - * @member {number|Long|null|undefined} integerValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.integerValue = null; - - /** - * Value doubleValue. - * @member {number|null|undefined} doubleValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.doubleValue = null; - - /** - * Value timestampValue. - * @member {google.protobuf.ITimestamp|null|undefined} timestampValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.timestampValue = null; - - /** - * Value keyValue. - * @member {google.datastore.v1.IKey|null|undefined} keyValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.keyValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value blobValue. - * @member {Uint8Array|null|undefined} blobValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.blobValue = null; - - /** - * Value geoPointValue. - * @member {google.type.ILatLng|null|undefined} geoPointValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.geoPointValue = null; - - /** - * Value entityValue. - * @member {google.datastore.v1.IEntity|null|undefined} entityValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.entityValue = null; - - /** - * Value arrayValue. - * @member {google.datastore.v1.IArrayValue|null|undefined} arrayValue - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.arrayValue = null; - - /** - * Value meaning. - * @member {number} meaning - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.meaning = 0; - - /** - * Value excludeFromIndexes. - * @member {boolean} excludeFromIndexes - * @memberof google.datastore.v1.Value - * @instance - */ - Value.prototype.excludeFromIndexes = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value valueType. - * @member {"nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"keyValue"|"stringValue"|"blobValue"|"geoPointValue"|"entityValue"|"arrayValue"|undefined} valueType - * @memberof google.datastore.v1.Value - * @instance - */ - Object.defineProperty(Value.prototype, "valueType", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "booleanValue", "integerValue", "doubleValue", "timestampValue", "keyValue", "stringValue", "blobValue", "geoPointValue", "entityValue", "arrayValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. + * Creates a new ReserveIdsResponse instance using the specified properties. * @function create - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.ReserveIdsResponse * @static - * @param {google.datastore.v1.IValue=} [properties] Properties to set - * @returns {google.datastore.v1.Value} Value instance + * @param {google.datastore.v1.IReserveIdsResponse=} [properties] Properties to set + * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse instance */ - Value.create = function create(properties) { - return new Value(properties); + ReserveIdsResponse.create = function create(properties) { + return new ReserveIdsResponse(properties); }; /** - * Encodes the specified Value message. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. + * Encodes the specified ReserveIdsResponse message. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.ReserveIdsResponse * @static - * @param {google.datastore.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.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.booleanValue); - if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.integerValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); - if (message.keyValue != null && Object.hasOwnProperty.call(message, "keyValue")) - $root.google.datastore.v1.Key.encode(message.keyValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.entityValue != null && Object.hasOwnProperty.call(message, "entityValue")) - $root.google.datastore.v1.Entity.encode(message.entityValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.geoPointValue != null && Object.hasOwnProperty.call(message, "geoPointValue")) - $root.google.type.LatLng.encode(message.geoPointValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) - $root.google.datastore.v1.ArrayValue.encode(message.arrayValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) - $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.nullValue); - if (message.meaning != null && Object.hasOwnProperty.call(message, "meaning")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.meaning); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.stringValue); - if (message.blobValue != null && Object.hasOwnProperty.call(message, "blobValue")) - writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.blobValue); - if (message.excludeFromIndexes != null && Object.hasOwnProperty.call(message, "excludeFromIndexes")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.excludeFromIndexes); + * @param {google.datastore.v1.IReserveIdsResponse} message ReserveIdsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReserveIdsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); return writer; }; /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. + * Encodes the specified ReserveIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.ReserveIdsResponse * @static - * @param {google.datastore.v1.IValue} message Value message or plain object to encode + * @param {google.datastore.v1.IReserveIdsResponse} message ReserveIdsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Value.encodeDelimited = function encodeDelimited(message, writer) { + ReserveIdsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Value message from the specified reader or buffer. + * Decodes a ReserveIdsResponse message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.ReserveIdsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Value} Value + * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse * @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) { + ReserveIdsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Value(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 11: - message.nullValue = reader.int32(); - break; - case 1: - message.booleanValue = reader.bool(); - break; - case 2: - message.integerValue = reader.int64(); - break; - case 3: - message.doubleValue = reader.double(); - break; - case 10: - message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.keyValue = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); - break; - case 17: - message.stringValue = reader.string(); - break; - case 18: - message.blobValue = reader.bytes(); - break; - case 8: - message.geoPointValue = $root.google.type.LatLng.decode(reader, reader.uint32()); - break; - case 6: - message.entityValue = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); - break; - case 9: - message.arrayValue = $root.google.datastore.v1.ArrayValue.decode(reader, reader.uint32()); - break; - case 14: - message.meaning = reader.int32(); - break; - case 19: - message.excludeFromIndexes = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -13894,322 +9444,99 @@ }; /** - * Decodes a Value message from the specified reader or buffer, length delimited. + * Decodes a ReserveIdsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.ReserveIdsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Value} Value + * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse * @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) { + ReserveIdsResponse.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.datastore.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.nullValue != null && message.hasOwnProperty("nullValue")) { - properties.valueType = 1; - switch (message.nullValue) { - default: - return "nullValue: enum value expected"; - case 0: - break; - } - } - if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (typeof message.booleanValue !== "boolean") - return "booleanValue: boolean expected"; - } - if (message.integerValue != null && message.hasOwnProperty("integerValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (!$util.isInteger(message.integerValue) && !(message.integerValue && $util.isInteger(message.integerValue.low) && $util.isInteger(message.integerValue.high))) - return "integerValue: integer|Long 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.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.keyValue != null && message.hasOwnProperty("keyValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.datastore.v1.Key.verify(message.keyValue); - if (error) - return "keyValue." + error; - } - } - 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.blobValue != null && message.hasOwnProperty("blobValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - if (!(message.blobValue && typeof message.blobValue.length === "number" || $util.isString(message.blobValue))) - return "blobValue: buffer expected"; - } - if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.type.LatLng.verify(message.geoPointValue); - if (error) - return "geoPointValue." + error; - } - } - if (message.entityValue != null && message.hasOwnProperty("entityValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.datastore.v1.Entity.verify(message.entityValue); - if (error) - return "entityValue." + error; - } - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - if (properties.valueType === 1) - return "valueType: multiple values"; - properties.valueType = 1; - { - var error = $root.google.datastore.v1.ArrayValue.verify(message.arrayValue); - if (error) - return "arrayValue." + error; - } - } - if (message.meaning != null && message.hasOwnProperty("meaning")) - if (!$util.isInteger(message.meaning)) - return "meaning: integer expected"; - if (message.excludeFromIndexes != null && message.hasOwnProperty("excludeFromIndexes")) - if (typeof message.excludeFromIndexes !== "boolean") - return "excludeFromIndexes: boolean expected"; - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.Value - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.Value} Value - */ - Value.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Value) - return object; - var message = new $root.google.datastore.v1.Value(); - switch (object.nullValue) { - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.booleanValue != null) - message.booleanValue = Boolean(object.booleanValue); - if (object.integerValue != null) - if ($util.Long) - (message.integerValue = $util.Long.fromValue(object.integerValue)).unsigned = false; - else if (typeof object.integerValue === "string") - message.integerValue = parseInt(object.integerValue, 10); - else if (typeof object.integerValue === "number") - message.integerValue = object.integerValue; - else if (typeof object.integerValue === "object") - message.integerValue = new $util.LongBits(object.integerValue.low >>> 0, object.integerValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.timestampValue != null) { - if (typeof object.timestampValue !== "object") - throw TypeError(".google.datastore.v1.Value.timestampValue: object expected"); - message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); - } - if (object.keyValue != null) { - if (typeof object.keyValue !== "object") - throw TypeError(".google.datastore.v1.Value.keyValue: object expected"); - message.keyValue = $root.google.datastore.v1.Key.fromObject(object.keyValue); - } - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.blobValue != null) - if (typeof object.blobValue === "string") - $util.base64.decode(object.blobValue, message.blobValue = $util.newBuffer($util.base64.length(object.blobValue)), 0); - else if (object.blobValue.length) - message.blobValue = object.blobValue; - if (object.geoPointValue != null) { - if (typeof object.geoPointValue !== "object") - throw TypeError(".google.datastore.v1.Value.geoPointValue: object expected"); - message.geoPointValue = $root.google.type.LatLng.fromObject(object.geoPointValue); - } - if (object.entityValue != null) { - if (typeof object.entityValue !== "object") - throw TypeError(".google.datastore.v1.Value.entityValue: object expected"); - message.entityValue = $root.google.datastore.v1.Entity.fromObject(object.entityValue); - } - if (object.arrayValue != null) { - if (typeof object.arrayValue !== "object") - throw TypeError(".google.datastore.v1.Value.arrayValue: object expected"); - message.arrayValue = $root.google.datastore.v1.ArrayValue.fromObject(object.arrayValue); - } - if (object.meaning != null) - message.meaning = object.meaning | 0; - if (object.excludeFromIndexes != null) - message.excludeFromIndexes = Boolean(object.excludeFromIndexes); - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. + * Verifies a ReserveIdsResponse message. + * @function verify + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReserveIdsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ReserveIdsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.ReserveIdsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse + */ + ReserveIdsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.ReserveIdsResponse) + return object; + return new $root.google.datastore.v1.ReserveIdsResponse(); + }; + + /** + * Creates a plain object from a ReserveIdsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.ReserveIdsResponse * @static - * @param {google.datastore.v1.Value} message Value + * @param {google.datastore.v1.ReserveIdsResponse} message ReserveIdsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.meaning = 0; - object.excludeFromIndexes = false; - } - if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { - object.booleanValue = message.booleanValue; - if (options.oneofs) - object.valueType = "booleanValue"; - } - if (message.integerValue != null && message.hasOwnProperty("integerValue")) { - if (typeof message.integerValue === "number") - object.integerValue = options.longs === String ? String(message.integerValue) : message.integerValue; - else - object.integerValue = options.longs === String ? $util.Long.prototype.toString.call(message.integerValue) : options.longs === Number ? new $util.LongBits(message.integerValue.low >>> 0, message.integerValue.high >>> 0).toNumber() : message.integerValue; - if (options.oneofs) - object.valueType = "integerValue"; - } - 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.keyValue != null && message.hasOwnProperty("keyValue")) { - object.keyValue = $root.google.datastore.v1.Key.toObject(message.keyValue, options); - if (options.oneofs) - object.valueType = "keyValue"; - } - if (message.entityValue != null && message.hasOwnProperty("entityValue")) { - object.entityValue = $root.google.datastore.v1.Entity.toObject(message.entityValue, options); - if (options.oneofs) - object.valueType = "entityValue"; - } - if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { - object.geoPointValue = $root.google.type.LatLng.toObject(message.geoPointValue, options); - if (options.oneofs) - object.valueType = "geoPointValue"; - } - if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { - object.arrayValue = $root.google.datastore.v1.ArrayValue.toObject(message.arrayValue, options); - if (options.oneofs) - object.valueType = "arrayValue"; - } - 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.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.valueType = "nullValue"; - } - if (message.meaning != null && message.hasOwnProperty("meaning")) - object.meaning = message.meaning; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.valueType = "stringValue"; - } - if (message.blobValue != null && message.hasOwnProperty("blobValue")) { - object.blobValue = options.bytes === String ? $util.base64.encode(message.blobValue, 0, message.blobValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.blobValue) : message.blobValue; - if (options.oneofs) - object.valueType = "blobValue"; - } - if (message.excludeFromIndexes != null && message.hasOwnProperty("excludeFromIndexes")) - object.excludeFromIndexes = message.excludeFromIndexes; - return object; + ReserveIdsResponse.toObject = function toObject() { + return {}; }; /** - * Converts this Value to JSON. + * Converts this ReserveIdsResponse to JSON. * @function toJSON - * @memberof google.datastore.v1.Value + * @memberof google.datastore.v1.ReserveIdsResponse * @instance * @returns {Object.} JSON object */ - Value.prototype.toJSON = function toJSON() { + ReserveIdsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Value; + return ReserveIdsResponse; })(); - v1.Entity = (function() { + v1.Mutation = (function() { /** - * Properties of an Entity. + * Properties of a Mutation. * @memberof google.datastore.v1 - * @interface IEntity - * @property {google.datastore.v1.IKey|null} [key] Entity key - * @property {Object.|null} [properties] Entity properties + * @interface IMutation + * @property {google.datastore.v1.IEntity|null} [insert] Mutation insert + * @property {google.datastore.v1.IEntity|null} [update] Mutation update + * @property {google.datastore.v1.IEntity|null} [upsert] Mutation upsert + * @property {google.datastore.v1.IKey|null} ["delete"] Mutation delete + * @property {number|Long|null} [baseVersion] Mutation baseVersion + * @property {google.protobuf.ITimestamp|null} [updateTime] Mutation updateTime */ /** - * Constructs a new Entity. + * Constructs a new Mutation. * @memberof google.datastore.v1 - * @classdesc Represents an Entity. - * @implements IEntity + * @classdesc Represents a Mutation. + * @implements IMutation * @constructor - * @param {google.datastore.v1.IEntity=} [properties] Properties to set + * @param {google.datastore.v1.IMutation=} [properties] Properties to set */ - function Entity(properties) { - this.properties = {}; + function Mutation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14217,110 +9544,165 @@ } /** - * Entity key. - * @member {google.datastore.v1.IKey|null|undefined} key - * @memberof google.datastore.v1.Entity + * Mutation insert. + * @member {google.datastore.v1.IEntity|null|undefined} insert + * @memberof google.datastore.v1.Mutation * @instance */ - Entity.prototype.key = null; + Mutation.prototype.insert = null; /** - * Entity properties. - * @member {Object.} properties - * @memberof google.datastore.v1.Entity + * Mutation update. + * @member {google.datastore.v1.IEntity|null|undefined} update + * @memberof google.datastore.v1.Mutation * @instance */ - Entity.prototype.properties = $util.emptyObject; + Mutation.prototype.update = null; /** - * Creates a new Entity instance using the specified properties. + * Mutation upsert. + * @member {google.datastore.v1.IEntity|null|undefined} upsert + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype.upsert = null; + + /** + * Mutation delete. + * @member {google.datastore.v1.IKey|null|undefined} delete + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype["delete"] = null; + + /** + * Mutation baseVersion. + * @member {number|Long|null|undefined} baseVersion + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype.baseVersion = null; + + /** + * Mutation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.datastore.v1.Mutation + * @instance + */ + Mutation.prototype.updateTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Mutation operation. + * @member {"insert"|"update"|"upsert"|"delete"|undefined} operation + * @memberof google.datastore.v1.Mutation + * @instance + */ + Object.defineProperty(Mutation.prototype, "operation", { + get: $util.oneOfGetter($oneOfFields = ["insert", "update", "upsert", "delete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Mutation conflictDetectionStrategy. + * @member {"baseVersion"|"updateTime"|undefined} conflictDetectionStrategy + * @memberof google.datastore.v1.Mutation + * @instance + */ + Object.defineProperty(Mutation.prototype, "conflictDetectionStrategy", { + get: $util.oneOfGetter($oneOfFields = ["baseVersion", "updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Mutation instance using the specified properties. * @function create - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.Mutation * @static - * @param {google.datastore.v1.IEntity=} [properties] Properties to set - * @returns {google.datastore.v1.Entity} Entity instance + * @param {google.datastore.v1.IMutation=} [properties] Properties to set + * @returns {google.datastore.v1.Mutation} Mutation instance */ - Entity.create = function create(properties) { - return new Entity(properties); + Mutation.create = function create(properties) { + return new Mutation(properties); }; /** - * Encodes the specified Entity message. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. + * Encodes the specified Mutation message. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.Mutation * @static - * @param {google.datastore.v1.IEntity} message Entity message or plain object to encode + * @param {google.datastore.v1.IMutation} message Mutation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Entity.encode = function encode(message, writer) { + Mutation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.datastore.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) - for (var keys = Object.keys(message.properties), 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.datastore.v1.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.insert != null && Object.hasOwnProperty.call(message, "insert")) + $root.google.datastore.v1.Entity.encode(message.insert, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.update != null && Object.hasOwnProperty.call(message, "update")) + $root.google.datastore.v1.Entity.encode(message.update, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.upsert != null && Object.hasOwnProperty.call(message, "upsert")) + $root.google.datastore.v1.Entity.encode(message.upsert, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + $root.google.datastore.v1.Key.encode(message["delete"], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.baseVersion != null && Object.hasOwnProperty.call(message, "baseVersion")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.baseVersion); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. + * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.Mutation * @static - * @param {google.datastore.v1.IEntity} message Entity message or plain object to encode + * @param {google.datastore.v1.IMutation} message Mutation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Entity.encodeDelimited = function encodeDelimited(message, writer) { + Mutation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Entity message from the specified reader or buffer. + * Decodes a Mutation message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.Mutation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Entity} Entity + * @returns {google.datastore.v1.Mutation} Mutation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Entity.decode = function decode(reader, length) { + Mutation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Entity(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Mutation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); + case 4: + message.insert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); break; - case 3: - if (message.properties === $util.emptyObject) - message.properties = {}; - 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.datastore.v1.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.properties[key] = value; + case 5: + message.update = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + break; + case 6: + message.upsert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + break; + case 7: + message["delete"] = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); + break; + case 8: + message.baseVersion = reader.int64(); + break; + case 11: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -14331,143 +9713,222 @@ }; /** - * Decodes an Entity message from the specified reader or buffer, length delimited. + * Decodes a Mutation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.Mutation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Entity} Entity + * @returns {google.datastore.v1.Mutation} Mutation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Entity.decodeDelimited = function decodeDelimited(reader) { + Mutation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Entity message. + * Verifies a Mutation message. * @function verify - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.Mutation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Entity.verify = function verify(message) { + Mutation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.datastore.v1.Key.verify(message.key); - if (error) - return "key." + error; + var properties = {}; + if (message.insert != null && message.hasOwnProperty("insert")) { + properties.operation = 1; + { + var error = $root.google.datastore.v1.Entity.verify(message.insert); + if (error) + return "insert." + error; + } } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!$util.isObject(message.properties)) - return "properties: object expected"; - var key = Object.keys(message.properties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.datastore.v1.Value.verify(message.properties[key[i]]); + if (message.update != null && message.hasOwnProperty("update")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.datastore.v1.Entity.verify(message.update); if (error) - return "properties." + error; + return "update." + error; + } + } + if (message.upsert != null && message.hasOwnProperty("upsert")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.datastore.v1.Entity.verify(message.upsert); + if (error) + return "upsert." + error; + } + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.operation === 1) + return "operation: multiple values"; + properties.operation = 1; + { + var error = $root.google.datastore.v1.Key.verify(message["delete"]); + if (error) + return "delete." + error; + } + } + if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) { + properties.conflictDetectionStrategy = 1; + if (!$util.isInteger(message.baseVersion) && !(message.baseVersion && $util.isInteger(message.baseVersion.low) && $util.isInteger(message.baseVersion.high))) + return "baseVersion: integer|Long expected"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + if (properties.conflictDetectionStrategy === 1) + return "conflictDetectionStrategy: multiple values"; + properties.conflictDetectionStrategy = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; } } return null; }; /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * Creates a Mutation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.Mutation * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.Entity} Entity + * @returns {google.datastore.v1.Mutation} Mutation */ - Entity.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Entity) + Mutation.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Mutation) return object; - var message = new $root.google.datastore.v1.Entity(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.datastore.v1.Entity.key: object expected"); - message.key = $root.google.datastore.v1.Key.fromObject(object.key); + var message = new $root.google.datastore.v1.Mutation(); + if (object.insert != null) { + if (typeof object.insert !== "object") + throw TypeError(".google.datastore.v1.Mutation.insert: object expected"); + message.insert = $root.google.datastore.v1.Entity.fromObject(object.insert); } - if (object.properties) { - if (typeof object.properties !== "object") - throw TypeError(".google.datastore.v1.Entity.properties: object expected"); - message.properties = {}; - for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { - if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.datastore.v1.Entity.properties: object expected"); - message.properties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.properties[keys[i]]); - } + if (object.update != null) { + if (typeof object.update !== "object") + throw TypeError(".google.datastore.v1.Mutation.update: object expected"); + message.update = $root.google.datastore.v1.Entity.fromObject(object.update); + } + if (object.upsert != null) { + if (typeof object.upsert !== "object") + throw TypeError(".google.datastore.v1.Mutation.upsert: object expected"); + message.upsert = $root.google.datastore.v1.Entity.fromObject(object.upsert); + } + if (object["delete"] != null) { + if (typeof object["delete"] !== "object") + throw TypeError(".google.datastore.v1.Mutation.delete: object expected"); + message["delete"] = $root.google.datastore.v1.Key.fromObject(object["delete"]); + } + if (object.baseVersion != null) + if ($util.Long) + (message.baseVersion = $util.Long.fromValue(object.baseVersion)).unsigned = false; + else if (typeof object.baseVersion === "string") + message.baseVersion = parseInt(object.baseVersion, 10); + else if (typeof object.baseVersion === "number") + message.baseVersion = object.baseVersion; + else if (typeof object.baseVersion === "object") + message.baseVersion = new $util.LongBits(object.baseVersion.low >>> 0, object.baseVersion.high >>> 0).toNumber(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.datastore.v1.Mutation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } return message; }; /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. + * Creates a plain object from a Mutation message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.Mutation * @static - * @param {google.datastore.v1.Entity} message Entity + * @param {google.datastore.v1.Mutation} message Mutation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Entity.toObject = function toObject(message, options) { + Mutation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.properties = {}; - if (options.defaults) - object.key = null; - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.datastore.v1.Key.toObject(message.key, options); - var keys2; - if (message.properties && (keys2 = Object.keys(message.properties)).length) { - object.properties = {}; - for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.properties[keys2[j]], options); + if (message.insert != null && message.hasOwnProperty("insert")) { + object.insert = $root.google.datastore.v1.Entity.toObject(message.insert, options); + if (options.oneofs) + object.operation = "insert"; + } + if (message.update != null && message.hasOwnProperty("update")) { + object.update = $root.google.datastore.v1.Entity.toObject(message.update, options); + if (options.oneofs) + object.operation = "update"; + } + if (message.upsert != null && message.hasOwnProperty("upsert")) { + object.upsert = $root.google.datastore.v1.Entity.toObject(message.upsert, options); + if (options.oneofs) + object.operation = "upsert"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = $root.google.datastore.v1.Key.toObject(message["delete"], options); + if (options.oneofs) + object.operation = "delete"; + } + if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) { + if (typeof message.baseVersion === "number") + object.baseVersion = options.longs === String ? String(message.baseVersion) : message.baseVersion; + else + object.baseVersion = options.longs === String ? $util.Long.prototype.toString.call(message.baseVersion) : options.longs === Number ? new $util.LongBits(message.baseVersion.low >>> 0, message.baseVersion.high >>> 0).toNumber() : message.baseVersion; + if (options.oneofs) + object.conflictDetectionStrategy = "baseVersion"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object.conflictDetectionStrategy = "updateTime"; } return object; }; /** - * Converts this Entity to JSON. + * Converts this Mutation to JSON. * @function toJSON - * @memberof google.datastore.v1.Entity + * @memberof google.datastore.v1.Mutation * @instance * @returns {Object.} JSON object */ - Entity.prototype.toJSON = function toJSON() { + Mutation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Entity; + return Mutation; })(); - v1.EntityResult = (function() { + v1.MutationResult = (function() { /** - * Properties of an EntityResult. + * Properties of a MutationResult. * @memberof google.datastore.v1 - * @interface IEntityResult - * @property {google.datastore.v1.IEntity|null} [entity] EntityResult entity - * @property {number|Long|null} [version] EntityResult version - * @property {google.protobuf.ITimestamp|null} [updateTime] EntityResult updateTime - * @property {Uint8Array|null} [cursor] EntityResult cursor + * @interface IMutationResult + * @property {google.datastore.v1.IKey|null} [key] MutationResult key + * @property {number|Long|null} [version] MutationResult version + * @property {google.protobuf.ITimestamp|null} [updateTime] MutationResult updateTime + * @property {boolean|null} [conflictDetected] MutationResult conflictDetected */ /** - * Constructs a new EntityResult. + * Constructs a new MutationResult. * @memberof google.datastore.v1 - * @classdesc Represents an EntityResult. - * @implements IEntityResult + * @classdesc Represents a MutationResult. + * @implements IMutationResult * @constructor - * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set + * @param {google.datastore.v1.IMutationResult=} [properties] Properties to set */ - function EntityResult(properties) { + function MutationResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14475,114 +9936,114 @@ } /** - * EntityResult entity. - * @member {google.datastore.v1.IEntity|null|undefined} entity - * @memberof google.datastore.v1.EntityResult + * MutationResult key. + * @member {google.datastore.v1.IKey|null|undefined} key + * @memberof google.datastore.v1.MutationResult * @instance */ - EntityResult.prototype.entity = null; + MutationResult.prototype.key = null; /** - * EntityResult version. + * MutationResult version. * @member {number|Long} version - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @instance */ - EntityResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + MutationResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * EntityResult updateTime. + * MutationResult updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @instance */ - EntityResult.prototype.updateTime = null; + MutationResult.prototype.updateTime = null; /** - * EntityResult cursor. - * @member {Uint8Array} cursor - * @memberof google.datastore.v1.EntityResult + * MutationResult conflictDetected. + * @member {boolean} conflictDetected + * @memberof google.datastore.v1.MutationResult * @instance */ - EntityResult.prototype.cursor = $util.newBuffer([]); + MutationResult.prototype.conflictDetected = false; /** - * Creates a new EntityResult instance using the specified properties. + * Creates a new MutationResult instance using the specified properties. * @function create - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @static - * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set - * @returns {google.datastore.v1.EntityResult} EntityResult instance + * @param {google.datastore.v1.IMutationResult=} [properties] Properties to set + * @returns {google.datastore.v1.MutationResult} MutationResult instance */ - EntityResult.create = function create(properties) { - return new EntityResult(properties); + MutationResult.create = function create(properties) { + return new MutationResult(properties); }; /** - * Encodes the specified EntityResult message. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. + * Encodes the specified MutationResult message. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @static - * @param {google.datastore.v1.IEntityResult} message EntityResult message or plain object to encode + * @param {google.datastore.v1.IMutationResult} message MutationResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityResult.encode = function encode(message, writer) { + MutationResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) - $root.google.datastore.v1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.cursor != null && Object.hasOwnProperty.call(message, "cursor")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.cursor); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.datastore.v1.Key.encode(message.key, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.version != null && Object.hasOwnProperty.call(message, "version")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.version); + if (message.conflictDetected != null && Object.hasOwnProperty.call(message, "conflictDetected")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.conflictDetected); if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified EntityResult message, length delimited. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. + * Encodes the specified MutationResult message, length delimited. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @static - * @param {google.datastore.v1.IEntityResult} message EntityResult message or plain object to encode + * @param {google.datastore.v1.IMutationResult} message MutationResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityResult.encodeDelimited = function encodeDelimited(message, writer) { + MutationResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EntityResult message from the specified reader or buffer. + * Decodes a MutationResult message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.EntityResult} EntityResult + * @returns {google.datastore.v1.MutationResult} MutationResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityResult.decode = function decode(reader, length) { + MutationResult.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.EntityResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.MutationResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.entity = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + case 3: + message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); break; case 4: message.version = reader.int64(); break; - case 5: + case 6: message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; - case 3: - message.cursor = reader.bytes(); + case 5: + message.conflictDetected = reader.bool(); break; default: reader.skipType(tag & 7); @@ -14593,36 +10054,36 @@ }; /** - * Decodes an EntityResult message from the specified reader or buffer, length delimited. + * Decodes a MutationResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.EntityResult} EntityResult + * @returns {google.datastore.v1.MutationResult} MutationResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityResult.decodeDelimited = function decodeDelimited(reader) { + MutationResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EntityResult message. + * Verifies a MutationResult message. * @function verify - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EntityResult.verify = function verify(message) { + MutationResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entity != null && message.hasOwnProperty("entity")) { - var error = $root.google.datastore.v1.Entity.verify(message.entity); + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.datastore.v1.Key.verify(message.key); if (error) - return "entity." + error; + return "key." + error; } if (message.version != null && message.hasOwnProperty("version")) if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) @@ -14632,28 +10093,28 @@ if (error) return "updateTime." + error; } - if (message.cursor != null && message.hasOwnProperty("cursor")) - if (!(message.cursor && typeof message.cursor.length === "number" || $util.isString(message.cursor))) - return "cursor: buffer expected"; + if (message.conflictDetected != null && message.hasOwnProperty("conflictDetected")) + if (typeof message.conflictDetected !== "boolean") + return "conflictDetected: boolean expected"; return null; }; /** - * Creates an EntityResult message from a plain object. Also converts values to their respective internal types. + * Creates a MutationResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.EntityResult} EntityResult + * @returns {google.datastore.v1.MutationResult} MutationResult */ - EntityResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.EntityResult) + MutationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.MutationResult) return object; - var message = new $root.google.datastore.v1.EntityResult(); - if (object.entity != null) { - if (typeof object.entity !== "object") - throw TypeError(".google.datastore.v1.EntityResult.entity: object expected"); - message.entity = $root.google.datastore.v1.Entity.fromObject(object.entity); + var message = new $root.google.datastore.v1.MutationResult(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.datastore.v1.MutationResult.key: object expected"); + message.key = $root.google.datastore.v1.Key.fromObject(object.key); } if (object.version != null) if ($util.Long) @@ -14666,314 +10127,201 @@ message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); if (object.updateTime != null) { if (typeof object.updateTime !== "object") - throw TypeError(".google.datastore.v1.EntityResult.updateTime: object expected"); + throw TypeError(".google.datastore.v1.MutationResult.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } - if (object.cursor != null) - if (typeof object.cursor === "string") - $util.base64.decode(object.cursor, message.cursor = $util.newBuffer($util.base64.length(object.cursor)), 0); - else if (object.cursor.length) - message.cursor = object.cursor; + if (object.conflictDetected != null) + message.conflictDetected = Boolean(object.conflictDetected); return message; }; /** - * Creates a plain object from an EntityResult message. Also converts values to other types if specified. + * Creates a plain object from a MutationResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @static - * @param {google.datastore.v1.EntityResult} message EntityResult + * @param {google.datastore.v1.MutationResult} message MutationResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EntityResult.toObject = function toObject(message, options) { + MutationResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.entity = null; - if (options.bytes === String) - object.cursor = ""; - else { - object.cursor = []; - if (options.bytes !== Array) - object.cursor = $util.newBuffer(object.cursor); - } + object.key = null; if ($util.Long) { var long = new $util.Long(0, 0, false); object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.version = options.longs === String ? "0" : 0; + object.conflictDetected = false; object.updateTime = null; } - if (message.entity != null && message.hasOwnProperty("entity")) - object.entity = $root.google.datastore.v1.Entity.toObject(message.entity, options); - if (message.cursor != null && message.hasOwnProperty("cursor")) - object.cursor = options.bytes === String ? $util.base64.encode(message.cursor, 0, message.cursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.cursor) : message.cursor; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.datastore.v1.Key.toObject(message.key, options); if (message.version != null && message.hasOwnProperty("version")) if (typeof message.version === "number") object.version = options.longs === String ? String(message.version) : message.version; else object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; + if (message.conflictDetected != null && message.hasOwnProperty("conflictDetected")) + object.conflictDetected = message.conflictDetected; if (message.updateTime != null && message.hasOwnProperty("updateTime")) object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this EntityResult to JSON. + * Converts this MutationResult to JSON. * @function toJSON - * @memberof google.datastore.v1.EntityResult + * @memberof google.datastore.v1.MutationResult * @instance * @returns {Object.} JSON object */ - EntityResult.prototype.toJSON = function toJSON() { + MutationResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ResultType enum. - * @name google.datastore.v1.EntityResult.ResultType - * @enum {number} - * @property {number} RESULT_TYPE_UNSPECIFIED=0 RESULT_TYPE_UNSPECIFIED value - * @property {number} FULL=1 FULL value - * @property {number} PROJECTION=2 PROJECTION value - * @property {number} KEY_ONLY=3 KEY_ONLY value - */ - EntityResult.ResultType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESULT_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FULL"] = 1; - values[valuesById[2] = "PROJECTION"] = 2; - values[valuesById[3] = "KEY_ONLY"] = 3; - return values; - })(); - - return EntityResult; + return MutationResult; })(); - v1.Query = (function() { - - /** - * Properties of a Query. - * @memberof google.datastore.v1 - * @interface IQuery - * @property {Array.|null} [projection] Query projection - * @property {Array.|null} [kind] Query kind - * @property {google.datastore.v1.IFilter|null} [filter] Query filter - * @property {Array.|null} [order] Query order - * @property {Array.|null} [distinctOn] Query distinctOn - * @property {Uint8Array|null} [startCursor] Query startCursor - * @property {Uint8Array|null} [endCursor] Query endCursor - * @property {number|null} [offset] Query offset - * @property {google.protobuf.IInt32Value|null} [limit] Query limit - */ - - /** - * Constructs a new Query. - * @memberof google.datastore.v1 - * @classdesc Represents a Query. - * @implements IQuery - * @constructor - * @param {google.datastore.v1.IQuery=} [properties] Properties to set - */ - function Query(properties) { - this.projection = []; - this.kind = []; - this.order = []; - this.distinctOn = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Query projection. - * @member {Array.} projection - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.projection = $util.emptyArray; - - /** - * Query kind. - * @member {Array.} kind - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.kind = $util.emptyArray; + v1.ReadOptions = (function() { /** - * Query filter. - * @member {google.datastore.v1.IFilter|null|undefined} filter - * @memberof google.datastore.v1.Query - * @instance + * Properties of a ReadOptions. + * @memberof google.datastore.v1 + * @interface IReadOptions + * @property {google.datastore.v1.ReadOptions.ReadConsistency|null} [readConsistency] ReadOptions readConsistency + * @property {Uint8Array|null} [transaction] ReadOptions transaction + * @property {google.protobuf.ITimestamp|null} [readTime] ReadOptions readTime */ - Query.prototype.filter = null; /** - * Query order. - * @member {Array.} order - * @memberof google.datastore.v1.Query - * @instance + * Constructs a new ReadOptions. + * @memberof google.datastore.v1 + * @classdesc Represents a ReadOptions. + * @implements IReadOptions + * @constructor + * @param {google.datastore.v1.IReadOptions=} [properties] Properties to set */ - Query.prototype.order = $util.emptyArray; + function ReadOptions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Query distinctOn. - * @member {Array.} distinctOn - * @memberof google.datastore.v1.Query + * ReadOptions readConsistency. + * @member {google.datastore.v1.ReadOptions.ReadConsistency|null|undefined} readConsistency + * @memberof google.datastore.v1.ReadOptions * @instance */ - Query.prototype.distinctOn = $util.emptyArray; + ReadOptions.prototype.readConsistency = null; /** - * Query startCursor. - * @member {Uint8Array} startCursor - * @memberof google.datastore.v1.Query + * ReadOptions transaction. + * @member {Uint8Array|null|undefined} transaction + * @memberof google.datastore.v1.ReadOptions * @instance */ - Query.prototype.startCursor = $util.newBuffer([]); + ReadOptions.prototype.transaction = null; /** - * Query endCursor. - * @member {Uint8Array} endCursor - * @memberof google.datastore.v1.Query + * ReadOptions readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.ReadOptions * @instance */ - Query.prototype.endCursor = $util.newBuffer([]); + ReadOptions.prototype.readTime = null; - /** - * Query offset. - * @member {number} offset - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.offset = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Query limit. - * @member {google.protobuf.IInt32Value|null|undefined} limit - * @memberof google.datastore.v1.Query + * ReadOptions consistencyType. + * @member {"readConsistency"|"transaction"|"readTime"|undefined} consistencyType + * @memberof google.datastore.v1.ReadOptions * @instance */ - Query.prototype.limit = null; + Object.defineProperty(ReadOptions.prototype, "consistencyType", { + get: $util.oneOfGetter($oneOfFields = ["readConsistency", "transaction", "readTime"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Query instance using the specified properties. + * Creates a new ReadOptions instance using the specified properties. * @function create - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.ReadOptions * @static - * @param {google.datastore.v1.IQuery=} [properties] Properties to set - * @returns {google.datastore.v1.Query} Query instance + * @param {google.datastore.v1.IReadOptions=} [properties] Properties to set + * @returns {google.datastore.v1.ReadOptions} ReadOptions instance */ - Query.create = function create(properties) { - return new Query(properties); + ReadOptions.create = function create(properties) { + return new ReadOptions(properties); }; /** - * Encodes the specified Query message. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. + * Encodes the specified ReadOptions message. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.ReadOptions * @static - * @param {google.datastore.v1.IQuery} message Query message or plain object to encode + * @param {google.datastore.v1.IReadOptions} message ReadOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Query.encode = function encode(message, writer) { + ReadOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projection != null && message.projection.length) - for (var i = 0; i < message.projection.length; ++i) - $root.google.datastore.v1.Projection.encode(message.projection[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.kind != null && message.kind.length) - for (var i = 0; i < message.kind.length; ++i) - $root.google.datastore.v1.KindExpression.encode(message.kind[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - $root.google.datastore.v1.Filter.encode(message.filter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.order != null && message.order.length) - for (var i = 0; i < message.order.length; ++i) - $root.google.datastore.v1.PropertyOrder.encode(message.order[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.distinctOn != null && message.distinctOn.length) - for (var i = 0; i < message.distinctOn.length; ++i) - $root.google.datastore.v1.PropertyReference.encode(message.distinctOn[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.startCursor != null && Object.hasOwnProperty.call(message, "startCursor")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startCursor); - if (message.endCursor != null && Object.hasOwnProperty.call(message, "endCursor")) - writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.endCursor); - if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.offset); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.protobuf.Int32Value.encode(message.limit, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.readConsistency != null && Object.hasOwnProperty.call(message, "readConsistency")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.readConsistency); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transaction); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Query message, length delimited. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. + * Encodes the specified ReadOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.ReadOptions * @static - * @param {google.datastore.v1.IQuery} message Query message or plain object to encode + * @param {google.datastore.v1.IReadOptions} message ReadOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Query.encodeDelimited = function encodeDelimited(message, writer) { + ReadOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Query message from the specified reader or buffer. + * Decodes a ReadOptions message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.ReadOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Query} Query + * @returns {google.datastore.v1.ReadOptions} ReadOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Query.decode = function decode(reader, length) { + ReadOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Query(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReadOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 2: - if (!(message.projection && message.projection.length)) - message.projection = []; - message.projection.push($root.google.datastore.v1.Projection.decode(reader, reader.uint32())); + case 1: + message.readConsistency = reader.int32(); break; - case 3: - if (!(message.kind && message.kind.length)) - message.kind = []; - message.kind.push($root.google.datastore.v1.KindExpression.decode(reader, reader.uint32())); + case 2: + message.transaction = reader.bytes(); break; case 4: - message.filter = $root.google.datastore.v1.Filter.decode(reader, reader.uint32()); - break; - case 5: - if (!(message.order && message.order.length)) - message.order = []; - message.order.push($root.google.datastore.v1.PropertyOrder.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.distinctOn && message.distinctOn.length)) - message.distinctOn = []; - message.distinctOn.push($root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32())); - break; - case 7: - message.startCursor = reader.bytes(); - break; - case 8: - message.endCursor = reader.bytes(); - break; - case 10: - message.offset = reader.int32(); - break; - case 12: - message.limit = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -14984,272 +10332,183 @@ }; /** - * Decodes a Query message from the specified reader or buffer, length delimited. + * Decodes a ReadOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.ReadOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Query} Query + * @returns {google.datastore.v1.ReadOptions} ReadOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Query.decodeDelimited = function decodeDelimited(reader) { + ReadOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Query message. + * Verifies a ReadOptions message. * @function verify - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.ReadOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Query.verify = function verify(message) { + ReadOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.projection != null && message.hasOwnProperty("projection")) { - if (!Array.isArray(message.projection)) - return "projection: array expected"; - for (var i = 0; i < message.projection.length; ++i) { - var error = $root.google.datastore.v1.Projection.verify(message.projection[i]); - if (error) - return "projection." + error; - } - } - if (message.kind != null && message.hasOwnProperty("kind")) { - if (!Array.isArray(message.kind)) - return "kind: array expected"; - for (var i = 0; i < message.kind.length; ++i) { - var error = $root.google.datastore.v1.KindExpression.verify(message.kind[i]); - if (error) - return "kind." + error; - } - } - if (message.filter != null && message.hasOwnProperty("filter")) { - var error = $root.google.datastore.v1.Filter.verify(message.filter); - if (error) - return "filter." + error; - } - if (message.order != null && message.hasOwnProperty("order")) { - if (!Array.isArray(message.order)) - return "order: array expected"; - for (var i = 0; i < message.order.length; ++i) { - var error = $root.google.datastore.v1.PropertyOrder.verify(message.order[i]); - if (error) - return "order." + error; - } - } - if (message.distinctOn != null && message.hasOwnProperty("distinctOn")) { - if (!Array.isArray(message.distinctOn)) - return "distinctOn: array expected"; - for (var i = 0; i < message.distinctOn.length; ++i) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.distinctOn[i]); - if (error) - return "distinctOn." + error; + var properties = {}; + if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { + properties.consistencyType = 1; + switch (message.readConsistency) { + default: + return "readConsistency: enum value expected"; + case 0: + case 1: + case 2: + break; } } - if (message.startCursor != null && message.hasOwnProperty("startCursor")) - if (!(message.startCursor && typeof message.startCursor.length === "number" || $util.isString(message.startCursor))) - return "startCursor: buffer expected"; - if (message.endCursor != null && message.hasOwnProperty("endCursor")) - if (!(message.endCursor && typeof message.endCursor.length === "number" || $util.isString(message.endCursor))) - return "endCursor: buffer expected"; - if (message.offset != null && message.hasOwnProperty("offset")) - if (!$util.isInteger(message.offset)) - return "offset: integer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.protobuf.Int32Value.verify(message.limit); - if (error) - return "limit." + error; + if (message.transaction != null && message.hasOwnProperty("transaction")) { + if (properties.consistencyType === 1) + return "consistencyType: multiple values"; + properties.consistencyType = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + if (properties.consistencyType === 1) + return "consistencyType: multiple values"; + properties.consistencyType = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } } return null; }; /** - * Creates a Query message from a plain object. Also converts values to their respective internal types. + * Creates a ReadOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.ReadOptions * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.Query} Query + * @returns {google.datastore.v1.ReadOptions} ReadOptions */ - Query.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Query) + ReadOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.ReadOptions) return object; - var message = new $root.google.datastore.v1.Query(); - if (object.projection) { - if (!Array.isArray(object.projection)) - throw TypeError(".google.datastore.v1.Query.projection: array expected"); - message.projection = []; - for (var i = 0; i < object.projection.length; ++i) { - if (typeof object.projection[i] !== "object") - throw TypeError(".google.datastore.v1.Query.projection: object expected"); - message.projection[i] = $root.google.datastore.v1.Projection.fromObject(object.projection[i]); - } - } - if (object.kind) { - if (!Array.isArray(object.kind)) - throw TypeError(".google.datastore.v1.Query.kind: array expected"); - message.kind = []; - for (var i = 0; i < object.kind.length; ++i) { - if (typeof object.kind[i] !== "object") - throw TypeError(".google.datastore.v1.Query.kind: object expected"); - message.kind[i] = $root.google.datastore.v1.KindExpression.fromObject(object.kind[i]); - } - } - if (object.filter != null) { - if (typeof object.filter !== "object") - throw TypeError(".google.datastore.v1.Query.filter: object expected"); - message.filter = $root.google.datastore.v1.Filter.fromObject(object.filter); - } - if (object.order) { - if (!Array.isArray(object.order)) - throw TypeError(".google.datastore.v1.Query.order: array expected"); - message.order = []; - for (var i = 0; i < object.order.length; ++i) { - if (typeof object.order[i] !== "object") - throw TypeError(".google.datastore.v1.Query.order: object expected"); - message.order[i] = $root.google.datastore.v1.PropertyOrder.fromObject(object.order[i]); - } - } - if (object.distinctOn) { - if (!Array.isArray(object.distinctOn)) - throw TypeError(".google.datastore.v1.Query.distinctOn: array expected"); - message.distinctOn = []; - for (var i = 0; i < object.distinctOn.length; ++i) { - if (typeof object.distinctOn[i] !== "object") - throw TypeError(".google.datastore.v1.Query.distinctOn: object expected"); - message.distinctOn[i] = $root.google.datastore.v1.PropertyReference.fromObject(object.distinctOn[i]); - } + var message = new $root.google.datastore.v1.ReadOptions(); + switch (object.readConsistency) { + case "READ_CONSISTENCY_UNSPECIFIED": + case 0: + message.readConsistency = 0; + break; + case "STRONG": + case 1: + message.readConsistency = 1; + break; + case "EVENTUAL": + case 2: + message.readConsistency = 2; + break; } - if (object.startCursor != null) - if (typeof object.startCursor === "string") - $util.base64.decode(object.startCursor, message.startCursor = $util.newBuffer($util.base64.length(object.startCursor)), 0); - else if (object.startCursor.length) - message.startCursor = object.startCursor; - if (object.endCursor != null) - if (typeof object.endCursor === "string") - $util.base64.decode(object.endCursor, message.endCursor = $util.newBuffer($util.base64.length(object.endCursor)), 0); - else if (object.endCursor.length) - message.endCursor = object.endCursor; - if (object.offset != null) - message.offset = object.offset | 0; - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".google.datastore.v1.Query.limit: object expected"); - message.limit = $root.google.protobuf.Int32Value.fromObject(object.limit); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length) + message.transaction = object.transaction; + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.ReadOptions.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } return message; }; /** - * Creates a plain object from a Query message. Also converts values to other types if specified. + * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.ReadOptions * @static - * @param {google.datastore.v1.Query} message Query + * @param {google.datastore.v1.ReadOptions} message ReadOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Query.toObject = function toObject(message, options) { + ReadOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.projection = []; - object.kind = []; - object.order = []; - object.distinctOn = []; - } - if (options.defaults) { - object.filter = null; - if (options.bytes === String) - object.startCursor = ""; - else { - object.startCursor = []; - if (options.bytes !== Array) - object.startCursor = $util.newBuffer(object.startCursor); - } - if (options.bytes === String) - object.endCursor = ""; - else { - object.endCursor = []; - if (options.bytes !== Array) - object.endCursor = $util.newBuffer(object.endCursor); - } - object.offset = 0; - object.limit = null; - } - if (message.projection && message.projection.length) { - object.projection = []; - for (var j = 0; j < message.projection.length; ++j) - object.projection[j] = $root.google.datastore.v1.Projection.toObject(message.projection[j], options); - } - if (message.kind && message.kind.length) { - object.kind = []; - for (var j = 0; j < message.kind.length; ++j) - object.kind[j] = $root.google.datastore.v1.KindExpression.toObject(message.kind[j], options); + if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { + object.readConsistency = options.enums === String ? $root.google.datastore.v1.ReadOptions.ReadConsistency[message.readConsistency] : message.readConsistency; + if (options.oneofs) + object.consistencyType = "readConsistency"; } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = $root.google.datastore.v1.Filter.toObject(message.filter, options); - if (message.order && message.order.length) { - object.order = []; - for (var j = 0; j < message.order.length; ++j) - object.order[j] = $root.google.datastore.v1.PropertyOrder.toObject(message.order[j], options); + if (message.transaction != null && message.hasOwnProperty("transaction")) { + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (options.oneofs) + object.consistencyType = "transaction"; } - if (message.distinctOn && message.distinctOn.length) { - object.distinctOn = []; - for (var j = 0; j < message.distinctOn.length; ++j) - object.distinctOn[j] = $root.google.datastore.v1.PropertyReference.toObject(message.distinctOn[j], options); + if (message.readTime != null && message.hasOwnProperty("readTime")) { + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (options.oneofs) + object.consistencyType = "readTime"; } - if (message.startCursor != null && message.hasOwnProperty("startCursor")) - object.startCursor = options.bytes === String ? $util.base64.encode(message.startCursor, 0, message.startCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.startCursor) : message.startCursor; - if (message.endCursor != null && message.hasOwnProperty("endCursor")) - object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; - if (message.offset != null && message.hasOwnProperty("offset")) - object.offset = message.offset; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.protobuf.Int32Value.toObject(message.limit, options); return object; }; /** - * Converts this Query to JSON. + * Converts this ReadOptions to JSON. * @function toJSON - * @memberof google.datastore.v1.Query + * @memberof google.datastore.v1.ReadOptions * @instance * @returns {Object.} JSON object */ - Query.prototype.toJSON = function toJSON() { + ReadOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Query; + /** + * ReadConsistency enum. + * @name google.datastore.v1.ReadOptions.ReadConsistency + * @enum {number} + * @property {number} READ_CONSISTENCY_UNSPECIFIED=0 READ_CONSISTENCY_UNSPECIFIED value + * @property {number} STRONG=1 STRONG value + * @property {number} EVENTUAL=2 EVENTUAL value + */ + ReadOptions.ReadConsistency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "READ_CONSISTENCY_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRONG"] = 1; + values[valuesById[2] = "EVENTUAL"] = 2; + return values; + })(); + + return ReadOptions; })(); - v1.AggregationQuery = (function() { + v1.TransactionOptions = (function() { /** - * Properties of an AggregationQuery. + * Properties of a TransactionOptions. * @memberof google.datastore.v1 - * @interface IAggregationQuery - * @property {google.datastore.v1.IQuery|null} [nestedQuery] AggregationQuery nestedQuery - * @property {Array.|null} [aggregations] AggregationQuery aggregations + * @interface ITransactionOptions + * @property {google.datastore.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite + * @property {google.datastore.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly */ /** - * Constructs a new AggregationQuery. + * Constructs a new TransactionOptions. * @memberof google.datastore.v1 - * @classdesc Represents an AggregationQuery. - * @implements IAggregationQuery + * @classdesc Represents a TransactionOptions. + * @implements ITransactionOptions * @constructor - * @param {google.datastore.v1.IAggregationQuery=} [properties] Properties to set + * @param {google.datastore.v1.ITransactionOptions=} [properties] Properties to set */ - function AggregationQuery(properties) { - this.aggregations = []; + function TransactionOptions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15257,105 +10516,102 @@ } /** - * AggregationQuery nestedQuery. - * @member {google.datastore.v1.IQuery|null|undefined} nestedQuery - * @memberof google.datastore.v1.AggregationQuery + * TransactionOptions readWrite. + * @member {google.datastore.v1.TransactionOptions.IReadWrite|null|undefined} readWrite + * @memberof google.datastore.v1.TransactionOptions * @instance */ - AggregationQuery.prototype.nestedQuery = null; + TransactionOptions.prototype.readWrite = null; /** - * AggregationQuery aggregations. - * @member {Array.} aggregations - * @memberof google.datastore.v1.AggregationQuery + * TransactionOptions readOnly. + * @member {google.datastore.v1.TransactionOptions.IReadOnly|null|undefined} readOnly + * @memberof google.datastore.v1.TransactionOptions * @instance */ - AggregationQuery.prototype.aggregations = $util.emptyArray; + TransactionOptions.prototype.readOnly = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * AggregationQuery queryType. - * @member {"nestedQuery"|undefined} queryType - * @memberof google.datastore.v1.AggregationQuery + * TransactionOptions mode. + * @member {"readWrite"|"readOnly"|undefined} mode + * @memberof google.datastore.v1.TransactionOptions * @instance */ - Object.defineProperty(AggregationQuery.prototype, "queryType", { - get: $util.oneOfGetter($oneOfFields = ["nestedQuery"]), + Object.defineProperty(TransactionOptions.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["readWrite", "readOnly"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new AggregationQuery instance using the specified properties. + * Creates a new TransactionOptions instance using the specified properties. * @function create - * @memberof google.datastore.v1.AggregationQuery + * @memberof google.datastore.v1.TransactionOptions * @static - * @param {google.datastore.v1.IAggregationQuery=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationQuery} AggregationQuery instance + * @param {google.datastore.v1.ITransactionOptions=} [properties] Properties to set + * @returns {google.datastore.v1.TransactionOptions} TransactionOptions instance */ - AggregationQuery.create = function create(properties) { - return new AggregationQuery(properties); + TransactionOptions.create = function create(properties) { + return new TransactionOptions(properties); }; /** - * Encodes the specified AggregationQuery message. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.AggregationQuery + * @memberof google.datastore.v1.TransactionOptions * @static - * @param {google.datastore.v1.IAggregationQuery} message AggregationQuery message or plain object to encode + * @param {google.datastore.v1.ITransactionOptions} message TransactionOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AggregationQuery.encode = function encode(message, writer) { + TransactionOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.nestedQuery != null && Object.hasOwnProperty.call(message, "nestedQuery")) - $root.google.datastore.v1.Query.encode(message.nestedQuery, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.aggregations != null && message.aggregations.length) - for (var i = 0; i < message.aggregations.length; ++i) - $root.google.datastore.v1.AggregationQuery.Aggregation.encode(message.aggregations[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readWrite != null && Object.hasOwnProperty.call(message, "readWrite")) + $root.google.datastore.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.datastore.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified AggregationQuery message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.AggregationQuery + * @memberof google.datastore.v1.TransactionOptions * @static - * @param {google.datastore.v1.IAggregationQuery} message AggregationQuery message or plain object to encode + * @param {google.datastore.v1.ITransactionOptions} message TransactionOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AggregationQuery.encodeDelimited = function encodeDelimited(message, writer) { + TransactionOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AggregationQuery message from the specified reader or buffer. + * Decodes a TransactionOptions message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.AggregationQuery + * @memberof google.datastore.v1.TransactionOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AggregationQuery} AggregationQuery + * @returns {google.datastore.v1.TransactionOptions} TransactionOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AggregationQuery.decode = function decode(reader, length) { + TransactionOptions.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.nestedQuery = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); + message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); break; - case 3: - if (!(message.aggregations && message.aggregations.length)) - message.aggregations = []; - message.aggregations.push($root.google.datastore.v1.AggregationQuery.Aggregation.decode(reader, reader.uint32())); + case 2: + message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -15366,141 +10622,134 @@ }; /** - * Decodes an AggregationQuery message from the specified reader or buffer, length delimited. + * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.AggregationQuery + * @memberof google.datastore.v1.TransactionOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationQuery} AggregationQuery + * @returns {google.datastore.v1.TransactionOptions} TransactionOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AggregationQuery.decodeDelimited = function decodeDelimited(reader) { + TransactionOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AggregationQuery message. + * Verifies a TransactionOptions message. * @function verify - * @memberof google.datastore.v1.AggregationQuery + * @memberof google.datastore.v1.TransactionOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AggregationQuery.verify = function verify(message) { + TransactionOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.nestedQuery != null && message.hasOwnProperty("nestedQuery")) { - properties.queryType = 1; + if (message.readWrite != null && message.hasOwnProperty("readWrite")) { + properties.mode = 1; { - var error = $root.google.datastore.v1.Query.verify(message.nestedQuery); + var error = $root.google.datastore.v1.TransactionOptions.ReadWrite.verify(message.readWrite); if (error) - return "nestedQuery." + error; + return "readWrite." + error; } } - if (message.aggregations != null && message.hasOwnProperty("aggregations")) { - if (!Array.isArray(message.aggregations)) - return "aggregations: array expected"; - for (var i = 0; i < message.aggregations.length; ++i) { - var error = $root.google.datastore.v1.AggregationQuery.Aggregation.verify(message.aggregations[i]); + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.datastore.v1.TransactionOptions.ReadOnly.verify(message.readOnly); if (error) - return "aggregations." + error; + return "readOnly." + error; } } return null; }; /** - * Creates an AggregationQuery message from a plain object. Also converts values to their respective internal types. + * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.AggregationQuery + * @memberof google.datastore.v1.TransactionOptions * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationQuery} AggregationQuery + * @returns {google.datastore.v1.TransactionOptions} TransactionOptions */ - AggregationQuery.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AggregationQuery) + TransactionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.TransactionOptions) return object; - var message = new $root.google.datastore.v1.AggregationQuery(); - if (object.nestedQuery != null) { - if (typeof object.nestedQuery !== "object") - throw TypeError(".google.datastore.v1.AggregationQuery.nestedQuery: object expected"); - message.nestedQuery = $root.google.datastore.v1.Query.fromObject(object.nestedQuery); - } - if (object.aggregations) { - if (!Array.isArray(object.aggregations)) - throw TypeError(".google.datastore.v1.AggregationQuery.aggregations: array expected"); - message.aggregations = []; - for (var i = 0; i < object.aggregations.length; ++i) { - if (typeof object.aggregations[i] !== "object") - throw TypeError(".google.datastore.v1.AggregationQuery.aggregations: object expected"); - message.aggregations[i] = $root.google.datastore.v1.AggregationQuery.Aggregation.fromObject(object.aggregations[i]); - } + var message = new $root.google.datastore.v1.TransactionOptions(); + if (object.readWrite != null) { + if (typeof object.readWrite !== "object") + throw TypeError(".google.datastore.v1.TransactionOptions.readWrite: object expected"); + message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); + } + if (object.readOnly != null) { + if (typeof object.readOnly !== "object") + throw TypeError(".google.datastore.v1.TransactionOptions.readOnly: object expected"); + message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); } return message; }; /** - * Creates a plain object from an AggregationQuery message. Also converts values to other types if specified. + * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.AggregationQuery + * @memberof google.datastore.v1.TransactionOptions * @static - * @param {google.datastore.v1.AggregationQuery} message AggregationQuery + * @param {google.datastore.v1.TransactionOptions} message TransactionOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AggregationQuery.toObject = function toObject(message, options) { + TransactionOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.aggregations = []; - if (message.nestedQuery != null && message.hasOwnProperty("nestedQuery")) { - object.nestedQuery = $root.google.datastore.v1.Query.toObject(message.nestedQuery, options); + if (message.readWrite != null && message.hasOwnProperty("readWrite")) { + object.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); if (options.oneofs) - object.queryType = "nestedQuery"; + object.mode = "readWrite"; } - if (message.aggregations && message.aggregations.length) { - object.aggregations = []; - for (var j = 0; j < message.aggregations.length; ++j) - object.aggregations[j] = $root.google.datastore.v1.AggregationQuery.Aggregation.toObject(message.aggregations[j], options); + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + object.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); + if (options.oneofs) + object.mode = "readOnly"; } return object; }; /** - * Converts this AggregationQuery to JSON. + * Converts this TransactionOptions to JSON. * @function toJSON - * @memberof google.datastore.v1.AggregationQuery + * @memberof google.datastore.v1.TransactionOptions * @instance * @returns {Object.} JSON object */ - AggregationQuery.prototype.toJSON = function toJSON() { + TransactionOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - AggregationQuery.Aggregation = (function() { + TransactionOptions.ReadWrite = (function() { /** - * Properties of an Aggregation. - * @memberof google.datastore.v1.AggregationQuery - * @interface IAggregation - * @property {google.datastore.v1.AggregationQuery.Aggregation.ICount|null} [count] Aggregation count - * @property {string|null} [alias] Aggregation alias + * Properties of a ReadWrite. + * @memberof google.datastore.v1.TransactionOptions + * @interface IReadWrite + * @property {Uint8Array|null} [previousTransaction] ReadWrite previousTransaction */ /** - * Constructs a new Aggregation. - * @memberof google.datastore.v1.AggregationQuery - * @classdesc Represents an Aggregation. - * @implements IAggregation + * Constructs a new ReadWrite. + * @memberof google.datastore.v1.TransactionOptions + * @classdesc Represents a ReadWrite. + * @implements IReadWrite * @constructor - * @param {google.datastore.v1.AggregationQuery.IAggregation=} [properties] Properties to set + * @param {google.datastore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set */ - function Aggregation(properties) { + function ReadWrite(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15508,102 +10757,271 @@ } /** - * Aggregation count. - * @member {google.datastore.v1.AggregationQuery.Aggregation.ICount|null|undefined} count - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * ReadWrite previousTransaction. + * @member {Uint8Array} previousTransaction + * @memberof google.datastore.v1.TransactionOptions.ReadWrite * @instance */ - Aggregation.prototype.count = null; + ReadWrite.prototype.previousTransaction = $util.newBuffer([]); + + /** + * Creates a new ReadWrite instance using the specified properties. + * @function create + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set + * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite instance + */ + ReadWrite.create = function create(properties) { + return new ReadWrite(properties); + }; + + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.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.previousTransaction != null && Object.hasOwnProperty.call(message, "previousTransaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.previousTransaction); + return writer; + }; + + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.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.datastore.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.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.previousTransaction = 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.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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.datastore.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.previousTransaction != null && message.hasOwnProperty("previousTransaction")) + if (!(message.previousTransaction && typeof message.previousTransaction.length === "number" || $util.isString(message.previousTransaction))) + return "previousTransaction: buffer expected"; + return null; + }; + + /** + * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite + */ + ReadWrite.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadWrite) + return object; + var message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); + if (object.previousTransaction != null) + if (typeof object.previousTransaction === "string") + $util.base64.decode(object.previousTransaction, message.previousTransaction = $util.newBuffer($util.base64.length(object.previousTransaction)), 0); + else if (object.previousTransaction.length) + message.previousTransaction = object.previousTransaction; + return message; + }; + + /** + * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.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) + if (options.bytes === String) + object.previousTransaction = ""; + else { + object.previousTransaction = []; + if (options.bytes !== Array) + object.previousTransaction = $util.newBuffer(object.previousTransaction); + } + if (message.previousTransaction != null && message.hasOwnProperty("previousTransaction")) + object.previousTransaction = options.bytes === String ? $util.base64.encode(message.previousTransaction, 0, message.previousTransaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.previousTransaction) : message.previousTransaction; + return object; + }; /** - * Aggregation alias. - * @member {string} alias - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * Converts this ReadWrite to JSON. + * @function toJSON + * @memberof google.datastore.v1.TransactionOptions.ReadWrite * @instance + * @returns {Object.} JSON object */ - Aggregation.prototype.alias = ""; + ReadWrite.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + return ReadWrite; + })(); + + TransactionOptions.ReadOnly = (function() { + + /** + * Properties of a ReadOnly. + * @memberof google.datastore.v1.TransactionOptions + * @interface IReadOnly + * @property {google.protobuf.ITimestamp|null} [readTime] ReadOnly readTime + */ + + /** + * Constructs a new ReadOnly. + * @memberof google.datastore.v1.TransactionOptions + * @classdesc Represents a ReadOnly. + * @implements IReadOnly + * @constructor + * @param {google.datastore.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]]; + } /** - * Aggregation operator. - * @member {"count"|undefined} operator - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * ReadOnly readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.TransactionOptions.ReadOnly * @instance */ - Object.defineProperty(Aggregation.prototype, "operator", { - get: $util.oneOfGetter($oneOfFields = ["count"]), - set: $util.oneOfSetter($oneOfFields) - }); + ReadOnly.prototype.readTime = null; /** - * Creates a new Aggregation instance using the specified properties. + * Creates a new ReadOnly instance using the specified properties. * @function create - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @memberof google.datastore.v1.TransactionOptions.ReadOnly * @static - * @param {google.datastore.v1.AggregationQuery.IAggregation=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationQuery.Aggregation} Aggregation instance + * @param {google.datastore.v1.TransactionOptions.IReadOnly=} [properties] Properties to set + * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly instance */ - Aggregation.create = function create(properties) { - return new Aggregation(properties); + ReadOnly.create = function create(properties) { + return new ReadOnly(properties); }; /** - * Encodes the specified Aggregation message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.verify|verify} messages. + * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @memberof google.datastore.v1.TransactionOptions.ReadOnly * @static - * @param {google.datastore.v1.AggregationQuery.IAggregation} message Aggregation message or plain object to encode + * @param {google.datastore.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Aggregation.encode = function encode(message, writer) { + ReadOnly.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.count != null && Object.hasOwnProperty.call(message, "count")) - $root.google.datastore.v1.AggregationQuery.Aggregation.Count.encode(message.count, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.alias); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Aggregation message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.verify|verify} messages. + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @memberof google.datastore.v1.TransactionOptions.ReadOnly * @static - * @param {google.datastore.v1.AggregationQuery.IAggregation} message Aggregation message or plain object to encode + * @param {google.datastore.v1.TransactionOptions.IReadOnly} message ReadOnly message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Aggregation.encodeDelimited = function encodeDelimited(message, writer) { + ReadOnly.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Aggregation message from the specified reader or buffer. + * Decodes a ReadOnly message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @memberof google.datastore.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.datastore.v1.AggregationQuery.Aggregation} Aggregation + * @returns {google.datastore.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 */ - Aggregation.decode = function decode(reader, length) { + ReadOnly.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery.Aggregation(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.count = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.decode(reader, reader.uint32()); - break; - case 7: - message.alias = reader.string(); + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -15614,316 +11032,327 @@ }; /** - * Decodes an Aggregation message from the specified reader or buffer, length delimited. + * Decodes a ReadOnly message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @memberof google.datastore.v1.TransactionOptions.ReadOnly * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationQuery.Aggregation} Aggregation + * @returns {google.datastore.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 */ - Aggregation.decodeDelimited = function decodeDelimited(reader) { + ReadOnly.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Aggregation message. + * Verifies a ReadOnly message. * @function verify - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @memberof google.datastore.v1.TransactionOptions.ReadOnly * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Aggregation.verify = function verify(message) { + ReadOnly.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.count != null && message.hasOwnProperty("count")) { - properties.operator = 1; - { - var error = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.verify(message.count); - if (error) - return "count." + error; - } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; } - if (message.alias != null && message.hasOwnProperty("alias")) - if (!$util.isString(message.alias)) - return "alias: string expected"; return null; }; /** - * Creates an Aggregation message from a plain object. Also converts values to their respective internal types. + * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @memberof google.datastore.v1.TransactionOptions.ReadOnly * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationQuery.Aggregation} Aggregation + * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly */ - Aggregation.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation) + ReadOnly.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadOnly) return object; - var message = new $root.google.datastore.v1.AggregationQuery.Aggregation(); - if (object.count != null) { - if (typeof object.count !== "object") - throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.count: object expected"); - message.count = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.fromObject(object.count); + var message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.TransactionOptions.ReadOnly.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - if (object.alias != null) - message.alias = String(object.alias); return message; }; /** - * Creates a plain object from an Aggregation message. Also converts values to other types if specified. + * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @memberof google.datastore.v1.TransactionOptions.ReadOnly * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation} message Aggregation + * @param {google.datastore.v1.TransactionOptions.ReadOnly} message ReadOnly * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Aggregation.toObject = function toObject(message, options) { + ReadOnly.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.alias = ""; - if (message.count != null && message.hasOwnProperty("count")) { - object.count = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.toObject(message.count, options); - if (options.oneofs) - object.operator = "count"; - } - if (message.alias != null && message.hasOwnProperty("alias")) - object.alias = message.alias; + object.readTime = null; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); return object; }; /** - * Converts this Aggregation to JSON. + * Converts this ReadOnly to JSON. * @function toJSON - * @memberof google.datastore.v1.AggregationQuery.Aggregation + * @memberof google.datastore.v1.TransactionOptions.ReadOnly * @instance * @returns {Object.} JSON object */ - Aggregation.prototype.toJSON = function toJSON() { + ReadOnly.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Aggregation.Count = (function() { + return ReadOnly; + })(); - /** - * Properties of a Count. - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @interface ICount - * @property {number|null} [upTo] Count upTo - */ + return TransactionOptions; + })(); - /** - * Constructs a new Count. - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @classdesc Represents a Count. - * @implements ICount - * @constructor - * @param {google.datastore.v1.AggregationQuery.Aggregation.ICount=} [properties] Properties to set - */ - function Count(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v1.PartitionId = (function() { - /** - * Count upTo. - * @member {number} upTo - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @instance - */ - Count.prototype.upTo = 0; + /** + * Properties of a PartitionId. + * @memberof google.datastore.v1 + * @interface IPartitionId + * @property {string|null} [projectId] PartitionId projectId + * @property {string|null} [namespaceId] PartitionId namespaceId + */ - /** - * Creates a new Count instance using the specified properties. - * @function create - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.ICount=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Count} Count instance - */ - Count.create = function create(properties) { - return new Count(properties); - }; + /** + * Constructs a new PartitionId. + * @memberof google.datastore.v1 + * @classdesc Represents a PartitionId. + * @implements IPartitionId + * @constructor + * @param {google.datastore.v1.IPartitionId=} [properties] Properties to set + */ + function PartitionId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified Count message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Count.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.ICount} message Count message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Count.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.upTo != null && Object.hasOwnProperty.call(message, "upTo")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.upTo); - return writer; - }; + /** + * PartitionId projectId. + * @member {string} projectId + * @memberof google.datastore.v1.PartitionId + * @instance + */ + PartitionId.prototype.projectId = ""; - /** - * Encodes the specified Count message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Count.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.ICount} message Count message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Count.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * PartitionId namespaceId. + * @member {string} namespaceId + * @memberof google.datastore.v1.PartitionId + * @instance + */ + PartitionId.prototype.namespaceId = ""; - /** - * Decodes a Count message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Count} Count - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Count.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Count(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.upTo = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new PartitionId instance using the specified properties. + * @function create + * @memberof google.datastore.v1.PartitionId + * @static + * @param {google.datastore.v1.IPartitionId=} [properties] Properties to set + * @returns {google.datastore.v1.PartitionId} PartitionId instance + */ + PartitionId.create = function create(properties) { + return new PartitionId(properties); + }; - /** - * Decodes a Count message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Count} Count - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Count.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified PartitionId message. Does not implicitly {@link google.datastore.v1.PartitionId.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.PartitionId + * @static + * @param {google.datastore.v1.IPartitionId} message PartitionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.namespaceId != null && Object.hasOwnProperty.call(message, "namespaceId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.namespaceId); + return writer; + }; - /** - * Verifies a Count message. - * @function verify - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Count.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.upTo != null && message.hasOwnProperty("upTo")) - if (!$util.isInteger(message.upTo)) - return "upTo: integer expected"; - return null; - }; + /** + * Encodes the specified PartitionId message, length delimited. Does not implicitly {@link google.datastore.v1.PartitionId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.PartitionId + * @static + * @param {google.datastore.v1.IPartitionId} message PartitionId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PartitionId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a Count message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Count} Count - */ - Count.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation.Count) - return object; - var message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Count(); - if (object.upTo != null) - message.upTo = object.upTo | 0; - return message; - }; + /** + * Decodes a PartitionId message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.PartitionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.PartitionId} PartitionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionId.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PartitionId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.projectId = reader.string(); + break; + case 4: + message.namespaceId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PartitionId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.PartitionId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.PartitionId} PartitionId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PartitionId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a Count message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.Count} message Count - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Count.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.upTo = 0; - if (message.upTo != null && message.hasOwnProperty("upTo")) - object.upTo = message.upTo; - return object; - }; + /** + * Verifies a PartitionId message. + * @function verify + * @memberof google.datastore.v1.PartitionId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PartitionId.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.namespaceId != null && message.hasOwnProperty("namespaceId")) + if (!$util.isString(message.namespaceId)) + return "namespaceId: string expected"; + return null; + }; - /** - * Converts this Count to JSON. - * @function toJSON - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @instance - * @returns {Object.} JSON object - */ - Count.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a PartitionId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.PartitionId + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.PartitionId} PartitionId + */ + PartitionId.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.PartitionId) + return object; + var message = new $root.google.datastore.v1.PartitionId(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.namespaceId != null) + message.namespaceId = String(object.namespaceId); + return message; + }; - return Count; - })(); + /** + * Creates a plain object from a PartitionId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.PartitionId + * @static + * @param {google.datastore.v1.PartitionId} message PartitionId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PartitionId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.projectId = ""; + object.namespaceId = ""; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.namespaceId != null && message.hasOwnProperty("namespaceId")) + object.namespaceId = message.namespaceId; + return object; + }; - return Aggregation; - })(); + /** + * Converts this PartitionId to JSON. + * @function toJSON + * @memberof google.datastore.v1.PartitionId + * @instance + * @returns {Object.} JSON object + */ + PartitionId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AggregationQuery; + return PartitionId; })(); - v1.KindExpression = (function() { + v1.Key = (function() { /** - * Properties of a KindExpression. + * Properties of a Key. * @memberof google.datastore.v1 - * @interface IKindExpression - * @property {string|null} [name] KindExpression name + * @interface IKey + * @property {google.datastore.v1.IPartitionId|null} [partitionId] Key partitionId + * @property {Array.|null} [path] Key path */ /** - * Constructs a new KindExpression. + * Constructs a new Key. * @memberof google.datastore.v1 - * @classdesc Represents a KindExpression. - * @implements IKindExpression + * @classdesc Represents a Key. + * @implements IKey * @constructor - * @param {google.datastore.v1.IKindExpression=} [properties] Properties to set + * @param {google.datastore.v1.IKey=} [properties] Properties to set */ - function KindExpression(properties) { + function Key(properties) { + this.path = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15931,75 +11360,91 @@ } /** - * KindExpression name. - * @member {string} name - * @memberof google.datastore.v1.KindExpression + * Key partitionId. + * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId + * @memberof google.datastore.v1.Key * @instance */ - KindExpression.prototype.name = ""; + Key.prototype.partitionId = null; /** - * Creates a new KindExpression instance using the specified properties. + * Key path. + * @member {Array.} path + * @memberof google.datastore.v1.Key + * @instance + */ + Key.prototype.path = $util.emptyArray; + + /** + * Creates a new Key instance using the specified properties. * @function create - * @memberof google.datastore.v1.KindExpression + * @memberof google.datastore.v1.Key * @static - * @param {google.datastore.v1.IKindExpression=} [properties] Properties to set - * @returns {google.datastore.v1.KindExpression} KindExpression instance + * @param {google.datastore.v1.IKey=} [properties] Properties to set + * @returns {google.datastore.v1.Key} Key instance */ - KindExpression.create = function create(properties) { - return new KindExpression(properties); + Key.create = function create(properties) { + return new Key(properties); }; /** - * Encodes the specified KindExpression message. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. + * Encodes the specified Key message. Does not implicitly {@link google.datastore.v1.Key.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.KindExpression + * @memberof google.datastore.v1.Key * @static - * @param {google.datastore.v1.IKindExpression} message KindExpression message or plain object to encode + * @param {google.datastore.v1.IKey} message Key message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KindExpression.encode = function encode(message, writer) { + Key.encode = function encode(message, writer) { 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.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.path != null && message.path.length) + for (var i = 0; i < message.path.length; ++i) + $root.google.datastore.v1.Key.PathElement.encode(message.path[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified KindExpression message, length delimited. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. + * Encodes the specified Key message, length delimited. Does not implicitly {@link google.datastore.v1.Key.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.KindExpression + * @memberof google.datastore.v1.Key * @static - * @param {google.datastore.v1.IKindExpression} message KindExpression message or plain object to encode + * @param {google.datastore.v1.IKey} message Key message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KindExpression.encodeDelimited = function encodeDelimited(message, writer) { + Key.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a KindExpression message from the specified reader or buffer. + * Decodes a Key message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.KindExpression + * @memberof google.datastore.v1.Key * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.KindExpression} KindExpression + * @returns {google.datastore.v1.Key} Key * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KindExpression.decode = function decode(reader, length) { + Key.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.KindExpression(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Key(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.path && message.path.length)) + message.path = []; + message.path.push($root.google.datastore.v1.Key.PathElement.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -16010,294 +11455,405 @@ }; /** - * Decodes a KindExpression message from the specified reader or buffer, length delimited. + * Decodes a Key message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.KindExpression + * @memberof google.datastore.v1.Key * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.KindExpression} KindExpression + * @returns {google.datastore.v1.Key} Key * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KindExpression.decodeDelimited = function decodeDelimited(reader) { + Key.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a KindExpression message. + * Verifies a Key message. * @function verify - * @memberof google.datastore.v1.KindExpression + * @memberof google.datastore.v1.Key * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - KindExpression.verify = function verify(message) { + Key.verify = function verify(message) { if (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.partitionId != null && message.hasOwnProperty("partitionId")) { + var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); + if (error) + return "partitionId." + error; + } + 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) { + var error = $root.google.datastore.v1.Key.PathElement.verify(message.path[i]); + if (error) + return "path." + error; + } + } return null; }; /** - * Creates a KindExpression message from a plain object. Also converts values to their respective internal types. + * Creates a Key message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.KindExpression + * @memberof google.datastore.v1.Key * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.KindExpression} KindExpression + * @returns {google.datastore.v1.Key} Key */ - KindExpression.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.KindExpression) + Key.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Key) return object; - var message = new $root.google.datastore.v1.KindExpression(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.datastore.v1.Key(); + if (object.partitionId != null) { + if (typeof object.partitionId !== "object") + throw TypeError(".google.datastore.v1.Key.partitionId: object expected"); + message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); + } + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.datastore.v1.Key.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) { + if (typeof object.path[i] !== "object") + throw TypeError(".google.datastore.v1.Key.path: object expected"); + message.path[i] = $root.google.datastore.v1.Key.PathElement.fromObject(object.path[i]); + } + } return message; }; /** - * Creates a plain object from a KindExpression message. Also converts values to other types if specified. + * Creates a plain object from a Key message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.KindExpression + * @memberof google.datastore.v1.Key * @static - * @param {google.datastore.v1.KindExpression} message KindExpression + * @param {google.datastore.v1.Key} message Key * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - KindExpression.toObject = function toObject(message, options) { + Key.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.path = []; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.partitionId = null; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = $root.google.datastore.v1.Key.PathElement.toObject(message.path[j], options); + } return object; }; /** - * Converts this KindExpression to JSON. + * Converts this Key to JSON. * @function toJSON - * @memberof google.datastore.v1.KindExpression + * @memberof google.datastore.v1.Key * @instance * @returns {Object.} JSON object */ - KindExpression.prototype.toJSON = function toJSON() { + Key.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return KindExpression; - })(); + Key.PathElement = (function() { - v1.PropertyReference = (function() { + /** + * Properties of a PathElement. + * @memberof google.datastore.v1.Key + * @interface IPathElement + * @property {string|null} [kind] PathElement kind + * @property {number|Long|null} [id] PathElement id + * @property {string|null} [name] PathElement name + */ - /** - * Properties of a PropertyReference. - * @memberof google.datastore.v1 - * @interface IPropertyReference - * @property {string|null} [name] PropertyReference name - */ + /** + * Constructs a new PathElement. + * @memberof google.datastore.v1.Key + * @classdesc Represents a PathElement. + * @implements IPathElement + * @constructor + * @param {google.datastore.v1.Key.IPathElement=} [properties] Properties to set + */ + function PathElement(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new PropertyReference. - * @memberof google.datastore.v1 - * @classdesc Represents a PropertyReference. - * @implements IPropertyReference - * @constructor - * @param {google.datastore.v1.IPropertyReference=} [properties] Properties to set - */ - function PropertyReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * PathElement kind. + * @member {string} kind + * @memberof google.datastore.v1.Key.PathElement + * @instance + */ + PathElement.prototype.kind = ""; - /** - * PropertyReference name. - * @member {string} name - * @memberof google.datastore.v1.PropertyReference - * @instance - */ - PropertyReference.prototype.name = ""; + /** + * PathElement id. + * @member {number|Long|null|undefined} id + * @memberof google.datastore.v1.Key.PathElement + * @instance + */ + PathElement.prototype.id = null; - /** - * Creates a new PropertyReference instance using the specified properties. - * @function create - * @memberof google.datastore.v1.PropertyReference - * @static - * @param {google.datastore.v1.IPropertyReference=} [properties] Properties to set - * @returns {google.datastore.v1.PropertyReference} PropertyReference instance - */ - PropertyReference.create = function create(properties) { - return new PropertyReference(properties); - }; + /** + * PathElement name. + * @member {string|null|undefined} name + * @memberof google.datastore.v1.Key.PathElement + * @instance + */ + PathElement.prototype.name = null; - /** - * Encodes the specified PropertyReference message. Does not implicitly {@link google.datastore.v1.PropertyReference.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.PropertyReference - * @static - * @param {google.datastore.v1.IPropertyReference} message PropertyReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - return writer; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified PropertyReference message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.PropertyReference - * @static - * @param {google.datastore.v1.IPropertyReference} message PropertyReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * PathElement idType. + * @member {"id"|"name"|undefined} idType + * @memberof google.datastore.v1.Key.PathElement + * @instance + */ + Object.defineProperty(PathElement.prototype, "idType", { + get: $util.oneOfGetter($oneOfFields = ["id", "name"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Decodes a PropertyReference message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.PropertyReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.PropertyReference} PropertyReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyReference.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Creates a new PathElement instance using the specified properties. + * @function create + * @memberof google.datastore.v1.Key.PathElement + * @static + * @param {google.datastore.v1.Key.IPathElement=} [properties] Properties to set + * @returns {google.datastore.v1.Key.PathElement} PathElement instance + */ + PathElement.create = function create(properties) { + return new PathElement(properties); + }; + + /** + * Encodes the specified PathElement message. Does not implicitly {@link google.datastore.v1.Key.PathElement.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.Key.PathElement + * @static + * @param {google.datastore.v1.Key.IPathElement} message PathElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathElement.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.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.id); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + return writer; + }; + + /** + * Encodes the specified PathElement message, length delimited. Does not implicitly {@link google.datastore.v1.Key.PathElement.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.Key.PathElement + * @static + * @param {google.datastore.v1.Key.IPathElement} message PathElement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PathElement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PathElement message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.Key.PathElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.Key.PathElement} PathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathElement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Key.PathElement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.id = reader.int64(); + break; + case 3: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a PropertyReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.PropertyReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.PropertyReference} PropertyReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a PathElement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.Key.PathElement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.Key.PathElement} PathElement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PathElement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a PropertyReference message. - * @function verify - * @memberof google.datastore.v1.PropertyReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PropertyReference.verify = function verify(message) { - if (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; - }; + /** + * Verifies a PathElement message. + * @function verify + * @memberof google.datastore.v1.Key.PathElement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PathElement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.id != null && message.hasOwnProperty("id")) { + properties.idType = 1; + if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) + return "id: integer|Long expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + if (properties.idType === 1) + return "idType: multiple values"; + properties.idType = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + return null; + }; - /** - * Creates a PropertyReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.PropertyReference - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.PropertyReference} PropertyReference - */ - PropertyReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.PropertyReference) + /** + * Creates a PathElement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.Key.PathElement + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.Key.PathElement} PathElement + */ + PathElement.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Key.PathElement) + return object; + var message = new $root.google.datastore.v1.Key.PathElement(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.id != null) + if ($util.Long) + (message.id = $util.Long.fromValue(object.id)).unsigned = false; + else if (typeof object.id === "string") + message.id = parseInt(object.id, 10); + else if (typeof object.id === "number") + message.id = object.id; + else if (typeof object.id === "object") + message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PathElement message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.Key.PathElement + * @static + * @param {google.datastore.v1.Key.PathElement} message PathElement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PathElement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.kind = ""; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.id != null && message.hasOwnProperty("id")) { + if (typeof message.id === "number") + object.id = options.longs === String ? String(message.id) : message.id; + else + object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; + if (options.oneofs) + object.idType = "id"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object.idType = "name"; + } return object; - var message = new $root.google.datastore.v1.PropertyReference(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + }; - /** - * Creates a plain object from a PropertyReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.PropertyReference - * @static - * @param {google.datastore.v1.PropertyReference} message PropertyReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PropertyReference.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 PathElement to JSON. + * @function toJSON + * @memberof google.datastore.v1.Key.PathElement + * @instance + * @returns {Object.} JSON object + */ + PathElement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this PropertyReference to JSON. - * @function toJSON - * @memberof google.datastore.v1.PropertyReference - * @instance - * @returns {Object.} JSON object - */ - PropertyReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return PathElement; + })(); - return PropertyReference; + return Key; })(); - v1.Projection = (function() { + v1.ArrayValue = (function() { /** - * Properties of a Projection. + * Properties of an ArrayValue. * @memberof google.datastore.v1 - * @interface IProjection - * @property {google.datastore.v1.IPropertyReference|null} [property] Projection property + * @interface IArrayValue + * @property {Array.|null} [values] ArrayValue values */ /** - * Constructs a new Projection. + * Constructs a new ArrayValue. * @memberof google.datastore.v1 - * @classdesc Represents a Projection. - * @implements IProjection + * @classdesc Represents an ArrayValue. + * @implements IArrayValue * @constructor - * @param {google.datastore.v1.IProjection=} [properties] Properties to set + * @param {google.datastore.v1.IArrayValue=} [properties] Properties to set */ - function Projection(properties) { + function ArrayValue(properties) { + this.values = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16305,75 +11861,78 @@ } /** - * Projection property. - * @member {google.datastore.v1.IPropertyReference|null|undefined} property - * @memberof google.datastore.v1.Projection + * ArrayValue values. + * @member {Array.} values + * @memberof google.datastore.v1.ArrayValue * @instance */ - Projection.prototype.property = null; + ArrayValue.prototype.values = $util.emptyArray; /** - * Creates a new Projection instance using the specified properties. + * Creates a new ArrayValue instance using the specified properties. * @function create - * @memberof google.datastore.v1.Projection + * @memberof google.datastore.v1.ArrayValue * @static - * @param {google.datastore.v1.IProjection=} [properties] Properties to set - * @returns {google.datastore.v1.Projection} Projection instance + * @param {google.datastore.v1.IArrayValue=} [properties] Properties to set + * @returns {google.datastore.v1.ArrayValue} ArrayValue instance */ - Projection.create = function create(properties) { - return new Projection(properties); + ArrayValue.create = function create(properties) { + return new ArrayValue(properties); }; /** - * Encodes the specified Projection message. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. + * Encodes the specified ArrayValue message. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.Projection + * @memberof google.datastore.v1.ArrayValue * @static - * @param {google.datastore.v1.IProjection} message Projection message or plain object to encode + * @param {google.datastore.v1.IArrayValue} message ArrayValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Projection.encode = function encode(message, writer) { + ArrayValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - $root.google.datastore.v1.PropertyReference.encode(message.property, 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.datastore.v1.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Projection message, length delimited. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. + * Encodes the specified ArrayValue message, length delimited. Does not implicitly {@link google.datastore.v1.ArrayValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.Projection + * @memberof google.datastore.v1.ArrayValue * @static - * @param {google.datastore.v1.IProjection} message Projection message or plain object to encode + * @param {google.datastore.v1.IArrayValue} message ArrayValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Projection.encodeDelimited = function encodeDelimited(message, writer) { + ArrayValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Projection message from the specified reader or buffer. + * Decodes an ArrayValue message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.Projection + * @memberof google.datastore.v1.ArrayValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Projection} Projection + * @returns {google.datastore.v1.ArrayValue} ArrayValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Projection.decode = function decode(reader, length) { + ArrayValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Projection(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ArrayValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32()); + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.datastore.v1.Value.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -16384,113 +11943,136 @@ }; /** - * Decodes a Projection message from the specified reader or buffer, length delimited. + * Decodes an ArrayValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.Projection + * @memberof google.datastore.v1.ArrayValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Projection} Projection + * @returns {google.datastore.v1.ArrayValue} ArrayValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Projection.decodeDelimited = function decodeDelimited(reader) { + ArrayValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Projection message. + * Verifies an ArrayValue message. * @function verify - * @memberof google.datastore.v1.Projection + * @memberof google.datastore.v1.ArrayValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Projection.verify = function verify(message) { + ArrayValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.property); - if (error) - return "property." + 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.datastore.v1.Value.verify(message.values[i]); + if (error) + return "values." + error; + } } return null; }; /** - * Creates a Projection message from a plain object. Also converts values to their respective internal types. + * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.Projection + * @memberof google.datastore.v1.ArrayValue * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.Projection} Projection + * @returns {google.datastore.v1.ArrayValue} ArrayValue */ - Projection.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Projection) + ArrayValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.ArrayValue) return object; - var message = new $root.google.datastore.v1.Projection(); - if (object.property != null) { - if (typeof object.property !== "object") - throw TypeError(".google.datastore.v1.Projection.property: object expected"); - message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); + var message = new $root.google.datastore.v1.ArrayValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.datastore.v1.ArrayValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.datastore.v1.ArrayValue.values: object expected"); + message.values[i] = $root.google.datastore.v1.Value.fromObject(object.values[i]); + } } return message; }; /** - * Creates a plain object from a Projection message. Also converts values to other types if specified. + * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.Projection + * @memberof google.datastore.v1.ArrayValue * @static - * @param {google.datastore.v1.Projection} message Projection + * @param {google.datastore.v1.ArrayValue} message ArrayValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Projection.toObject = function toObject(message, options) { + ArrayValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.property = null; - if (message.property != null && message.hasOwnProperty("property")) - object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); + 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.datastore.v1.Value.toObject(message.values[j], options); + } return object; }; /** - * Converts this Projection to JSON. + * Converts this ArrayValue to JSON. * @function toJSON - * @memberof google.datastore.v1.Projection + * @memberof google.datastore.v1.ArrayValue * @instance * @returns {Object.} JSON object */ - Projection.prototype.toJSON = function toJSON() { + ArrayValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Projection; + return ArrayValue; })(); - v1.PropertyOrder = (function() { + v1.Value = (function() { /** - * Properties of a PropertyOrder. + * Properties of a Value. * @memberof google.datastore.v1 - * @interface IPropertyOrder - * @property {google.datastore.v1.IPropertyReference|null} [property] PropertyOrder property - * @property {google.datastore.v1.PropertyOrder.Direction|null} [direction] PropertyOrder direction + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {boolean|null} [booleanValue] Value booleanValue + * @property {number|Long|null} [integerValue] Value integerValue + * @property {number|null} [doubleValue] Value doubleValue + * @property {google.protobuf.ITimestamp|null} [timestampValue] Value timestampValue + * @property {google.datastore.v1.IKey|null} [keyValue] Value keyValue + * @property {string|null} [stringValue] Value stringValue + * @property {Uint8Array|null} [blobValue] Value blobValue + * @property {google.type.ILatLng|null} [geoPointValue] Value geoPointValue + * @property {google.datastore.v1.IEntity|null} [entityValue] Value entityValue + * @property {google.datastore.v1.IArrayValue|null} [arrayValue] Value arrayValue + * @property {number|null} [meaning] Value meaning + * @property {boolean|null} [excludeFromIndexes] Value excludeFromIndexes */ /** - * Constructs a new PropertyOrder. + * Constructs a new Value. * @memberof google.datastore.v1 - * @classdesc Represents a PropertyOrder. - * @implements IPropertyOrder + * @classdesc Represents a Value. + * @implements IValue * @constructor - * @param {google.datastore.v1.IPropertyOrder=} [properties] Properties to set + * @param {google.datastore.v1.IValue=} [properties] Properties to set */ - function PropertyOrder(properties) { + function Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16498,88 +12080,245 @@ } /** - * PropertyOrder property. - * @member {google.datastore.v1.IPropertyReference|null|undefined} property - * @memberof google.datastore.v1.PropertyOrder + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.datastore.v1.Value * @instance */ - PropertyOrder.prototype.property = null; + Value.prototype.nullValue = null; /** - * PropertyOrder direction. - * @member {google.datastore.v1.PropertyOrder.Direction} direction - * @memberof google.datastore.v1.PropertyOrder + * Value booleanValue. + * @member {boolean|null|undefined} booleanValue + * @memberof google.datastore.v1.Value * @instance */ - PropertyOrder.prototype.direction = 0; + Value.prototype.booleanValue = null; /** - * Creates a new PropertyOrder instance using the specified properties. + * Value integerValue. + * @member {number|Long|null|undefined} integerValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.integerValue = null; + + /** + * Value doubleValue. + * @member {number|null|undefined} doubleValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.doubleValue = null; + + /** + * Value timestampValue. + * @member {google.protobuf.ITimestamp|null|undefined} timestampValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.timestampValue = null; + + /** + * Value keyValue. + * @member {google.datastore.v1.IKey|null|undefined} keyValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.keyValue = null; + + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.stringValue = null; + + /** + * Value blobValue. + * @member {Uint8Array|null|undefined} blobValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.blobValue = null; + + /** + * Value geoPointValue. + * @member {google.type.ILatLng|null|undefined} geoPointValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.geoPointValue = null; + + /** + * Value entityValue. + * @member {google.datastore.v1.IEntity|null|undefined} entityValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.entityValue = null; + + /** + * Value arrayValue. + * @member {google.datastore.v1.IArrayValue|null|undefined} arrayValue + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.arrayValue = null; + + /** + * Value meaning. + * @member {number} meaning + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.meaning = 0; + + /** + * Value excludeFromIndexes. + * @member {boolean} excludeFromIndexes + * @memberof google.datastore.v1.Value + * @instance + */ + Value.prototype.excludeFromIndexes = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value valueType. + * @member {"nullValue"|"booleanValue"|"integerValue"|"doubleValue"|"timestampValue"|"keyValue"|"stringValue"|"blobValue"|"geoPointValue"|"entityValue"|"arrayValue"|undefined} valueType + * @memberof google.datastore.v1.Value + * @instance + */ + Object.defineProperty(Value.prototype, "valueType", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "booleanValue", "integerValue", "doubleValue", "timestampValue", "keyValue", "stringValue", "blobValue", "geoPointValue", "entityValue", "arrayValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. * @function create - * @memberof google.datastore.v1.PropertyOrder + * @memberof google.datastore.v1.Value * @static - * @param {google.datastore.v1.IPropertyOrder=} [properties] Properties to set - * @returns {google.datastore.v1.PropertyOrder} PropertyOrder instance + * @param {google.datastore.v1.IValue=} [properties] Properties to set + * @returns {google.datastore.v1.Value} Value instance */ - PropertyOrder.create = function create(properties) { - return new PropertyOrder(properties); + Value.create = function create(properties) { + return new Value(properties); }; /** - * Encodes the specified PropertyOrder message. Does not implicitly {@link google.datastore.v1.PropertyOrder.verify|verify} messages. + * Encodes the specified Value message. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.PropertyOrder + * @memberof google.datastore.v1.Value * @static - * @param {google.datastore.v1.IPropertyOrder} message PropertyOrder message or plain object to encode + * @param {google.datastore.v1.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PropertyOrder.encode = function encode(message, writer) { + Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - $root.google.datastore.v1.PropertyReference.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); + if (message.booleanValue != null && Object.hasOwnProperty.call(message, "booleanValue")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.booleanValue); + if (message.integerValue != null && Object.hasOwnProperty.call(message, "integerValue")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.integerValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue); + if (message.keyValue != null && Object.hasOwnProperty.call(message, "keyValue")) + $root.google.datastore.v1.Key.encode(message.keyValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.entityValue != null && Object.hasOwnProperty.call(message, "entityValue")) + $root.google.datastore.v1.Entity.encode(message.entityValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.geoPointValue != null && Object.hasOwnProperty.call(message, "geoPointValue")) + $root.google.type.LatLng.encode(message.geoPointValue, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.arrayValue != null && Object.hasOwnProperty.call(message, "arrayValue")) + $root.google.datastore.v1.ArrayValue.encode(message.arrayValue, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.timestampValue != null && Object.hasOwnProperty.call(message, "timestampValue")) + $root.google.protobuf.Timestamp.encode(message.timestampValue, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.nullValue); + if (message.meaning != null && Object.hasOwnProperty.call(message, "meaning")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.meaning); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.stringValue); + if (message.blobValue != null && Object.hasOwnProperty.call(message, "blobValue")) + writer.uint32(/* id 18, wireType 2 =*/146).bytes(message.blobValue); + if (message.excludeFromIndexes != null && Object.hasOwnProperty.call(message, "excludeFromIndexes")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.excludeFromIndexes); return writer; }; /** - * Encodes the specified PropertyOrder message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyOrder.verify|verify} messages. + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.PropertyOrder + * @memberof google.datastore.v1.Value * @static - * @param {google.datastore.v1.IPropertyOrder} message PropertyOrder message or plain object to encode + * @param {google.datastore.v1.IValue} message Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PropertyOrder.encodeDelimited = function encodeDelimited(message, writer) { + Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PropertyOrder message from the specified reader or buffer. + * Decodes a Value message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.PropertyOrder + * @memberof google.datastore.v1.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.PropertyOrder} PropertyOrder + * @returns {google.datastore.v1.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PropertyOrder.decode = function decode(reader, length) { + Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyOrder(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 11: + message.nullValue = reader.int32(); + break; case 1: - message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32()); + message.booleanValue = reader.bool(); break; case 2: - message.direction = reader.int32(); + message.integerValue = reader.int64(); + break; + case 3: + message.doubleValue = reader.double(); + break; + case 10: + message.timestampValue = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + message.keyValue = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); + break; + case 17: + message.stringValue = reader.string(); + break; + case 18: + message.blobValue = reader.bytes(); + break; + case 8: + message.geoPointValue = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + case 6: + message.entityValue = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); + break; + case 9: + message.arrayValue = $root.google.datastore.v1.ArrayValue.decode(reader, reader.uint32()); + break; + case 14: + message.meaning = reader.int32(); + break; + case 19: + message.excludeFromIndexes = reader.bool(); break; default: reader.skipType(tag & 7); @@ -16590,156 +12329,322 @@ }; /** - * Decodes a PropertyOrder message from the specified reader or buffer, length delimited. + * Decodes a Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.PropertyOrder + * @memberof google.datastore.v1.Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.PropertyOrder} PropertyOrder + * @returns {google.datastore.v1.Value} Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PropertyOrder.decodeDelimited = function decodeDelimited(reader) { + Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PropertyOrder message. + * Verifies a Value message. * @function verify - * @memberof google.datastore.v1.PropertyOrder + * @memberof google.datastore.v1.Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PropertyOrder.verify = function verify(message) { + Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.property); - if (error) - return "property." + error; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.valueType = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (typeof message.booleanValue !== "boolean") + return "booleanValue: boolean expected"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!$util.isInteger(message.integerValue) && !(message.integerValue && $util.isInteger(message.integerValue.low) && $util.isInteger(message.integerValue.high))) + return "integerValue: integer|Long 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.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.keyValue != null && message.hasOwnProperty("keyValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.datastore.v1.Key.verify(message.keyValue); + if (error) + return "keyValue." + error; + } + } + 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.blobValue != null && message.hasOwnProperty("blobValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + if (!(message.blobValue && typeof message.blobValue.length === "number" || $util.isString(message.blobValue))) + return "blobValue: buffer expected"; + } + if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.type.LatLng.verify(message.geoPointValue); + if (error) + return "geoPointValue." + error; + } + } + if (message.entityValue != null && message.hasOwnProperty("entityValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.datastore.v1.Entity.verify(message.entityValue); + if (error) + return "entityValue." + error; + } + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + if (properties.valueType === 1) + return "valueType: multiple values"; + properties.valueType = 1; + { + var error = $root.google.datastore.v1.ArrayValue.verify(message.arrayValue); + if (error) + return "arrayValue." + error; + } + } + if (message.meaning != null && message.hasOwnProperty("meaning")) + if (!$util.isInteger(message.meaning)) + return "meaning: integer expected"; + if (message.excludeFromIndexes != null && message.hasOwnProperty("excludeFromIndexes")) + if (typeof message.excludeFromIndexes !== "boolean") + return "excludeFromIndexes: boolean expected"; + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.Value + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Value) + return object; + var message = new $root.google.datastore.v1.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.booleanValue != null) + message.booleanValue = Boolean(object.booleanValue); + if (object.integerValue != null) + if ($util.Long) + (message.integerValue = $util.Long.fromValue(object.integerValue)).unsigned = false; + else if (typeof object.integerValue === "string") + message.integerValue = parseInt(object.integerValue, 10); + else if (typeof object.integerValue === "number") + message.integerValue = object.integerValue; + else if (typeof object.integerValue === "object") + message.integerValue = new $util.LongBits(object.integerValue.low >>> 0, object.integerValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.timestampValue != null) { + if (typeof object.timestampValue !== "object") + throw TypeError(".google.datastore.v1.Value.timestampValue: object expected"); + message.timestampValue = $root.google.protobuf.Timestamp.fromObject(object.timestampValue); + } + if (object.keyValue != null) { + if (typeof object.keyValue !== "object") + throw TypeError(".google.datastore.v1.Value.keyValue: object expected"); + message.keyValue = $root.google.datastore.v1.Key.fromObject(object.keyValue); + } + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.blobValue != null) + if (typeof object.blobValue === "string") + $util.base64.decode(object.blobValue, message.blobValue = $util.newBuffer($util.base64.length(object.blobValue)), 0); + else if (object.blobValue.length) + message.blobValue = object.blobValue; + if (object.geoPointValue != null) { + if (typeof object.geoPointValue !== "object") + throw TypeError(".google.datastore.v1.Value.geoPointValue: object expected"); + message.geoPointValue = $root.google.type.LatLng.fromObject(object.geoPointValue); } - if (message.direction != null && message.hasOwnProperty("direction")) - switch (message.direction) { - default: - return "direction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a PropertyOrder message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.PropertyOrder - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.PropertyOrder} PropertyOrder - */ - PropertyOrder.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.PropertyOrder) - return object; - var message = new $root.google.datastore.v1.PropertyOrder(); - if (object.property != null) { - if (typeof object.property !== "object") - throw TypeError(".google.datastore.v1.PropertyOrder.property: object expected"); - message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); + if (object.entityValue != null) { + if (typeof object.entityValue !== "object") + throw TypeError(".google.datastore.v1.Value.entityValue: object expected"); + message.entityValue = $root.google.datastore.v1.Entity.fromObject(object.entityValue); } - switch (object.direction) { - case "DIRECTION_UNSPECIFIED": - case 0: - message.direction = 0; - break; - case "ASCENDING": - case 1: - message.direction = 1; - break; - case "DESCENDING": - case 2: - message.direction = 2; - break; + if (object.arrayValue != null) { + if (typeof object.arrayValue !== "object") + throw TypeError(".google.datastore.v1.Value.arrayValue: object expected"); + message.arrayValue = $root.google.datastore.v1.ArrayValue.fromObject(object.arrayValue); } + if (object.meaning != null) + message.meaning = object.meaning | 0; + if (object.excludeFromIndexes != null) + message.excludeFromIndexes = Boolean(object.excludeFromIndexes); return message; }; /** - * Creates a plain object from a PropertyOrder message. Also converts values to other types if specified. + * Creates a plain object from a Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.PropertyOrder + * @memberof google.datastore.v1.Value * @static - * @param {google.datastore.v1.PropertyOrder} message PropertyOrder + * @param {google.datastore.v1.Value} message Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PropertyOrder.toObject = function toObject(message, options) { + Value.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.property = null; - object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + object.meaning = 0; + object.excludeFromIndexes = false; } - if (message.property != null && message.hasOwnProperty("property")) - object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); - if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.datastore.v1.PropertyOrder.Direction[message.direction] : message.direction; + if (message.booleanValue != null && message.hasOwnProperty("booleanValue")) { + object.booleanValue = message.booleanValue; + if (options.oneofs) + object.valueType = "booleanValue"; + } + if (message.integerValue != null && message.hasOwnProperty("integerValue")) { + if (typeof message.integerValue === "number") + object.integerValue = options.longs === String ? String(message.integerValue) : message.integerValue; + else + object.integerValue = options.longs === String ? $util.Long.prototype.toString.call(message.integerValue) : options.longs === Number ? new $util.LongBits(message.integerValue.low >>> 0, message.integerValue.high >>> 0).toNumber() : message.integerValue; + if (options.oneofs) + object.valueType = "integerValue"; + } + 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.keyValue != null && message.hasOwnProperty("keyValue")) { + object.keyValue = $root.google.datastore.v1.Key.toObject(message.keyValue, options); + if (options.oneofs) + object.valueType = "keyValue"; + } + if (message.entityValue != null && message.hasOwnProperty("entityValue")) { + object.entityValue = $root.google.datastore.v1.Entity.toObject(message.entityValue, options); + if (options.oneofs) + object.valueType = "entityValue"; + } + if (message.geoPointValue != null && message.hasOwnProperty("geoPointValue")) { + object.geoPointValue = $root.google.type.LatLng.toObject(message.geoPointValue, options); + if (options.oneofs) + object.valueType = "geoPointValue"; + } + if (message.arrayValue != null && message.hasOwnProperty("arrayValue")) { + object.arrayValue = $root.google.datastore.v1.ArrayValue.toObject(message.arrayValue, options); + if (options.oneofs) + object.valueType = "arrayValue"; + } + 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.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.valueType = "nullValue"; + } + if (message.meaning != null && message.hasOwnProperty("meaning")) + object.meaning = message.meaning; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.valueType = "stringValue"; + } + if (message.blobValue != null && message.hasOwnProperty("blobValue")) { + object.blobValue = options.bytes === String ? $util.base64.encode(message.blobValue, 0, message.blobValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.blobValue) : message.blobValue; + if (options.oneofs) + object.valueType = "blobValue"; + } + if (message.excludeFromIndexes != null && message.hasOwnProperty("excludeFromIndexes")) + object.excludeFromIndexes = message.excludeFromIndexes; return object; }; /** - * Converts this PropertyOrder to JSON. + * Converts this Value to JSON. * @function toJSON - * @memberof google.datastore.v1.PropertyOrder + * @memberof google.datastore.v1.Value * @instance * @returns {Object.} JSON object */ - PropertyOrder.prototype.toJSON = function toJSON() { + Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Direction enum. - * @name google.datastore.v1.PropertyOrder.Direction - * @enum {number} - * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value - * @property {number} ASCENDING=1 ASCENDING value - * @property {number} DESCENDING=2 DESCENDING value - */ - PropertyOrder.Direction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ASCENDING"] = 1; - values[valuesById[2] = "DESCENDING"] = 2; - return values; - })(); - - return PropertyOrder; + return Value; })(); - v1.Filter = (function() { + v1.Entity = (function() { /** - * Properties of a Filter. + * Properties of an Entity. * @memberof google.datastore.v1 - * @interface IFilter - * @property {google.datastore.v1.ICompositeFilter|null} [compositeFilter] Filter compositeFilter - * @property {google.datastore.v1.IPropertyFilter|null} [propertyFilter] Filter propertyFilter + * @interface IEntity + * @property {google.datastore.v1.IKey|null} [key] Entity key + * @property {Object.|null} [properties] Entity properties */ /** - * Constructs a new Filter. + * Constructs a new Entity. * @memberof google.datastore.v1 - * @classdesc Represents a Filter. - * @implements IFilter + * @classdesc Represents an Entity. + * @implements IEntity * @constructor - * @param {google.datastore.v1.IFilter=} [properties] Properties to set + * @param {google.datastore.v1.IEntity=} [properties] Properties to set */ - function Filter(properties) { + function Entity(properties) { + this.properties = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16747,102 +12652,110 @@ } /** - * Filter compositeFilter. - * @member {google.datastore.v1.ICompositeFilter|null|undefined} compositeFilter - * @memberof google.datastore.v1.Filter - * @instance - */ - Filter.prototype.compositeFilter = null; - - /** - * Filter propertyFilter. - * @member {google.datastore.v1.IPropertyFilter|null|undefined} propertyFilter - * @memberof google.datastore.v1.Filter + * Entity key. + * @member {google.datastore.v1.IKey|null|undefined} key + * @memberof google.datastore.v1.Entity * @instance */ - Filter.prototype.propertyFilter = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Entity.prototype.key = null; /** - * Filter filterType. - * @member {"compositeFilter"|"propertyFilter"|undefined} filterType - * @memberof google.datastore.v1.Filter + * Entity properties. + * @member {Object.} properties + * @memberof google.datastore.v1.Entity * @instance */ - Object.defineProperty(Filter.prototype, "filterType", { - get: $util.oneOfGetter($oneOfFields = ["compositeFilter", "propertyFilter"]), - set: $util.oneOfSetter($oneOfFields) - }); + Entity.prototype.properties = $util.emptyObject; /** - * Creates a new Filter instance using the specified properties. + * Creates a new Entity instance using the specified properties. * @function create - * @memberof google.datastore.v1.Filter + * @memberof google.datastore.v1.Entity * @static - * @param {google.datastore.v1.IFilter=} [properties] Properties to set - * @returns {google.datastore.v1.Filter} Filter instance + * @param {google.datastore.v1.IEntity=} [properties] Properties to set + * @returns {google.datastore.v1.Entity} Entity instance */ - Filter.create = function create(properties) { - return new Filter(properties); + Entity.create = function create(properties) { + return new Entity(properties); }; /** - * Encodes the specified Filter message. Does not implicitly {@link google.datastore.v1.Filter.verify|verify} messages. + * Encodes the specified Entity message. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.Filter + * @memberof google.datastore.v1.Entity * @static - * @param {google.datastore.v1.IFilter} message Filter message or plain object to encode + * @param {google.datastore.v1.IEntity} message Entity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Filter.encode = function encode(message, writer) { + Entity.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.compositeFilter != null && Object.hasOwnProperty.call(message, "compositeFilter")) - $root.google.datastore.v1.CompositeFilter.encode(message.compositeFilter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.propertyFilter != null && Object.hasOwnProperty.call(message, "propertyFilter")) - $root.google.datastore.v1.PropertyFilter.encode(message.propertyFilter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + $root.google.datastore.v1.Key.encode(message.key, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), 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.datastore.v1.Value.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.datastore.v1.Filter.verify|verify} messages. + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.Filter + * @memberof google.datastore.v1.Entity * @static - * @param {google.datastore.v1.IFilter} message Filter message or plain object to encode + * @param {google.datastore.v1.IEntity} message Entity message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Filter.encodeDelimited = function encodeDelimited(message, writer) { + Entity.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Filter message from the specified reader or buffer. + * Decodes an Entity message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.Filter + * @memberof google.datastore.v1.Entity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.Filter} Filter + * @returns {google.datastore.v1.Entity} Entity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Filter.decode = function decode(reader, length) { + Entity.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Filter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Entity(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.compositeFilter = $root.google.datastore.v1.CompositeFilter.decode(reader, reader.uint32()); + message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); break; - case 2: - message.propertyFilter = $root.google.datastore.v1.PropertyFilter.decode(reader, reader.uint32()); + case 3: + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.datastore.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; break; default: reader.skipType(tag & 7); @@ -16853,139 +12766,143 @@ }; /** - * Decodes a Filter message from the specified reader or buffer, length delimited. + * Decodes an Entity message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.Filter + * @memberof google.datastore.v1.Entity * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.Filter} Filter + * @returns {google.datastore.v1.Entity} Entity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Filter.decodeDelimited = function decodeDelimited(reader) { + Entity.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Filter message. + * Verifies an Entity message. * @function verify - * @memberof google.datastore.v1.Filter + * @memberof google.datastore.v1.Entity * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Filter.verify = function verify(message) { + Entity.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.compositeFilter != null && message.hasOwnProperty("compositeFilter")) { - properties.filterType = 1; - { - var error = $root.google.datastore.v1.CompositeFilter.verify(message.compositeFilter); - if (error) - return "compositeFilter." + error; - } + if (message.key != null && message.hasOwnProperty("key")) { + var error = $root.google.datastore.v1.Key.verify(message.key); + if (error) + return "key." + error; } - if (message.propertyFilter != null && message.hasOwnProperty("propertyFilter")) { - if (properties.filterType === 1) - return "filterType: multiple values"; - properties.filterType = 1; - { - var error = $root.google.datastore.v1.PropertyFilter.verify(message.propertyFilter); + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.datastore.v1.Value.verify(message.properties[key[i]]); if (error) - return "propertyFilter." + error; + return "properties." + error; } } return null; }; /** - * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * Creates an Entity message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.Filter + * @memberof google.datastore.v1.Entity * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.Filter} Filter + * @returns {google.datastore.v1.Entity} Entity */ - Filter.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Filter) + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Entity) return object; - var message = new $root.google.datastore.v1.Filter(); - if (object.compositeFilter != null) { - if (typeof object.compositeFilter !== "object") - throw TypeError(".google.datastore.v1.Filter.compositeFilter: object expected"); - message.compositeFilter = $root.google.datastore.v1.CompositeFilter.fromObject(object.compositeFilter); + var message = new $root.google.datastore.v1.Entity(); + if (object.key != null) { + if (typeof object.key !== "object") + throw TypeError(".google.datastore.v1.Entity.key: object expected"); + message.key = $root.google.datastore.v1.Key.fromObject(object.key); } - if (object.propertyFilter != null) { - if (typeof object.propertyFilter !== "object") - throw TypeError(".google.datastore.v1.Filter.propertyFilter: object expected"); - message.propertyFilter = $root.google.datastore.v1.PropertyFilter.fromObject(object.propertyFilter); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.datastore.v1.Entity.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.datastore.v1.Entity.properties: object expected"); + message.properties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.properties[keys[i]]); + } } return message; }; /** - * Creates a plain object from a Filter message. Also converts values to other types if specified. + * Creates a plain object from an Entity message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.Filter + * @memberof google.datastore.v1.Entity * @static - * @param {google.datastore.v1.Filter} message Filter + * @param {google.datastore.v1.Entity} message Entity * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Filter.toObject = function toObject(message, options) { + Entity.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.compositeFilter != null && message.hasOwnProperty("compositeFilter")) { - object.compositeFilter = $root.google.datastore.v1.CompositeFilter.toObject(message.compositeFilter, options); - if (options.oneofs) - object.filterType = "compositeFilter"; - } - if (message.propertyFilter != null && message.hasOwnProperty("propertyFilter")) { - object.propertyFilter = $root.google.datastore.v1.PropertyFilter.toObject(message.propertyFilter, options); - if (options.oneofs) - object.filterType = "propertyFilter"; + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) + object.key = null; + if (message.key != null && message.hasOwnProperty("key")) + object.key = $root.google.datastore.v1.Key.toObject(message.key, options); + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.properties[keys2[j]], options); } return object; }; /** - * Converts this Filter to JSON. + * Converts this Entity to JSON. * @function toJSON - * @memberof google.datastore.v1.Filter + * @memberof google.datastore.v1.Entity * @instance * @returns {Object.} JSON object */ - Filter.prototype.toJSON = function toJSON() { + Entity.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Filter; + return Entity; })(); - v1.CompositeFilter = (function() { + v1.EntityResult = (function() { /** - * Properties of a CompositeFilter. + * Properties of an EntityResult. * @memberof google.datastore.v1 - * @interface ICompositeFilter - * @property {google.datastore.v1.CompositeFilter.Operator|null} [op] CompositeFilter op - * @property {Array.|null} [filters] CompositeFilter filters + * @interface IEntityResult + * @property {google.datastore.v1.IEntity|null} [entity] EntityResult entity + * @property {number|Long|null} [version] EntityResult version + * @property {google.protobuf.ITimestamp|null} [updateTime] EntityResult updateTime + * @property {Uint8Array|null} [cursor] EntityResult cursor */ /** - * Constructs a new CompositeFilter. + * Constructs a new EntityResult. * @memberof google.datastore.v1 - * @classdesc Represents a CompositeFilter. - * @implements ICompositeFilter + * @classdesc Represents an EntityResult. + * @implements IEntityResult * @constructor - * @param {google.datastore.v1.ICompositeFilter=} [properties] Properties to set + * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set */ - function CompositeFilter(properties) { - this.filters = []; + function EntityResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -16993,91 +12910,114 @@ } /** - * CompositeFilter op. - * @member {google.datastore.v1.CompositeFilter.Operator} op - * @memberof google.datastore.v1.CompositeFilter + * EntityResult entity. + * @member {google.datastore.v1.IEntity|null|undefined} entity + * @memberof google.datastore.v1.EntityResult * @instance */ - CompositeFilter.prototype.op = 0; + EntityResult.prototype.entity = null; /** - * CompositeFilter filters. - * @member {Array.} filters - * @memberof google.datastore.v1.CompositeFilter + * EntityResult version. + * @member {number|Long} version + * @memberof google.datastore.v1.EntityResult * @instance */ - CompositeFilter.prototype.filters = $util.emptyArray; + EntityResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new CompositeFilter instance using the specified properties. + * EntityResult updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.datastore.v1.EntityResult + * @instance + */ + EntityResult.prototype.updateTime = null; + + /** + * EntityResult cursor. + * @member {Uint8Array} cursor + * @memberof google.datastore.v1.EntityResult + * @instance + */ + EntityResult.prototype.cursor = $util.newBuffer([]); + + /** + * Creates a new EntityResult instance using the specified properties. * @function create - * @memberof google.datastore.v1.CompositeFilter + * @memberof google.datastore.v1.EntityResult * @static - * @param {google.datastore.v1.ICompositeFilter=} [properties] Properties to set - * @returns {google.datastore.v1.CompositeFilter} CompositeFilter instance + * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set + * @returns {google.datastore.v1.EntityResult} EntityResult instance */ - CompositeFilter.create = function create(properties) { - return new CompositeFilter(properties); + EntityResult.create = function create(properties) { + return new EntityResult(properties); }; /** - * Encodes the specified CompositeFilter message. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. + * Encodes the specified EntityResult message. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.CompositeFilter + * @memberof google.datastore.v1.EntityResult * @static - * @param {google.datastore.v1.ICompositeFilter} message CompositeFilter message or plain object to encode + * @param {google.datastore.v1.IEntityResult} message EntityResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompositeFilter.encode = function encode(message, writer) { + EntityResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.op != null && Object.hasOwnProperty.call(message, "op")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.op); - if (message.filters != null && message.filters.length) - for (var i = 0; i < message.filters.length; ++i) - $root.google.datastore.v1.Filter.encode(message.filters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.entity != null && Object.hasOwnProperty.call(message, "entity")) + $root.google.datastore.v1.Entity.encode(message.entity, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.cursor != null && Object.hasOwnProperty.call(message, "cursor")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.cursor); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.version); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified CompositeFilter message, length delimited. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. + * Encodes the specified EntityResult message, length delimited. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.CompositeFilter + * @memberof google.datastore.v1.EntityResult * @static - * @param {google.datastore.v1.ICompositeFilter} message CompositeFilter message or plain object to encode + * @param {google.datastore.v1.IEntityResult} message EntityResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompositeFilter.encodeDelimited = function encodeDelimited(message, writer) { + EntityResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompositeFilter message from the specified reader or buffer. + * Decodes an EntityResult message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.CompositeFilter + * @memberof google.datastore.v1.EntityResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.CompositeFilter} CompositeFilter + * @returns {google.datastore.v1.EntityResult} EntityResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompositeFilter.decode = function decode(reader, length) { + EntityResult.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CompositeFilter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.EntityResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.op = reader.int32(); + message.entity = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); break; - case 2: - if (!(message.filters && message.filters.length)) - message.filters = []; - message.filters.push($root.google.datastore.v1.Filter.decode(reader, reader.uint32())); + case 4: + message.version = reader.int64(); + break; + case 5: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.cursor = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -17088,271 +13028,387 @@ }; /** - * Decodes a CompositeFilter message from the specified reader or buffer, length delimited. + * Decodes an EntityResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.CompositeFilter + * @memberof google.datastore.v1.EntityResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.CompositeFilter} CompositeFilter + * @returns {google.datastore.v1.EntityResult} EntityResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompositeFilter.decodeDelimited = function decodeDelimited(reader) { + EntityResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompositeFilter message. + * Verifies an EntityResult message. * @function verify - * @memberof google.datastore.v1.CompositeFilter + * @memberof google.datastore.v1.EntityResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompositeFilter.verify = function verify(message) { + EntityResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.op != null && message.hasOwnProperty("op")) - switch (message.op) { - default: - return "op: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.filters != null && message.hasOwnProperty("filters")) { - if (!Array.isArray(message.filters)) - return "filters: array expected"; - for (var i = 0; i < message.filters.length; ++i) { - var error = $root.google.datastore.v1.Filter.verify(message.filters[i]); - if (error) - return "filters." + error; - } + if (message.entity != null && message.hasOwnProperty("entity")) { + var error = $root.google.datastore.v1.Entity.verify(message.entity); + if (error) + return "entity." + error; + } + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) + return "version: integer|Long expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; } + if (message.cursor != null && message.hasOwnProperty("cursor")) + if (!(message.cursor && typeof message.cursor.length === "number" || $util.isString(message.cursor))) + return "cursor: buffer expected"; return null; }; /** - * Creates a CompositeFilter message from a plain object. Also converts values to their respective internal types. + * Creates an EntityResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.CompositeFilter + * @memberof google.datastore.v1.EntityResult * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.CompositeFilter} CompositeFilter + * @returns {google.datastore.v1.EntityResult} EntityResult */ - CompositeFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.CompositeFilter) + EntityResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.EntityResult) return object; - var message = new $root.google.datastore.v1.CompositeFilter(); - switch (object.op) { - case "OPERATOR_UNSPECIFIED": - case 0: - message.op = 0; - break; - case "AND": - case 1: - message.op = 1; - break; - case "OR": - case 2: - message.op = 2; - break; + var message = new $root.google.datastore.v1.EntityResult(); + if (object.entity != null) { + if (typeof object.entity !== "object") + throw TypeError(".google.datastore.v1.EntityResult.entity: object expected"); + message.entity = $root.google.datastore.v1.Entity.fromObject(object.entity); } - if (object.filters) { - if (!Array.isArray(object.filters)) - throw TypeError(".google.datastore.v1.CompositeFilter.filters: array expected"); - message.filters = []; - for (var i = 0; i < object.filters.length; ++i) { - if (typeof object.filters[i] !== "object") - throw TypeError(".google.datastore.v1.CompositeFilter.filters: object expected"); - message.filters[i] = $root.google.datastore.v1.Filter.fromObject(object.filters[i]); - } + if (object.version != null) + if ($util.Long) + (message.version = $util.Long.fromValue(object.version)).unsigned = false; + else if (typeof object.version === "string") + message.version = parseInt(object.version, 10); + else if (typeof object.version === "number") + message.version = object.version; + else if (typeof object.version === "object") + message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.datastore.v1.EntityResult.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } + if (object.cursor != null) + if (typeof object.cursor === "string") + $util.base64.decode(object.cursor, message.cursor = $util.newBuffer($util.base64.length(object.cursor)), 0); + else if (object.cursor.length) + message.cursor = object.cursor; return message; }; /** - * Creates a plain object from a CompositeFilter message. Also converts values to other types if specified. + * Creates a plain object from an EntityResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.CompositeFilter + * @memberof google.datastore.v1.EntityResult * @static - * @param {google.datastore.v1.CompositeFilter} message CompositeFilter + * @param {google.datastore.v1.EntityResult} message EntityResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompositeFilter.toObject = function toObject(message, options) { + EntityResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.filters = []; - if (options.defaults) - object.op = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; - if (message.op != null && message.hasOwnProperty("op")) - object.op = options.enums === String ? $root.google.datastore.v1.CompositeFilter.Operator[message.op] : message.op; - if (message.filters && message.filters.length) { - object.filters = []; - for (var j = 0; j < message.filters.length; ++j) - object.filters[j] = $root.google.datastore.v1.Filter.toObject(message.filters[j], options); + if (options.defaults) { + object.entity = null; + if (options.bytes === String) + object.cursor = ""; + else { + object.cursor = []; + if (options.bytes !== Array) + object.cursor = $util.newBuffer(object.cursor); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.version = options.longs === String ? "0" : 0; + object.updateTime = null; } + if (message.entity != null && message.hasOwnProperty("entity")) + object.entity = $root.google.datastore.v1.Entity.toObject(message.entity, options); + if (message.cursor != null && message.hasOwnProperty("cursor")) + object.cursor = options.bytes === String ? $util.base64.encode(message.cursor, 0, message.cursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.cursor) : message.cursor; + if (message.version != null && message.hasOwnProperty("version")) + if (typeof message.version === "number") + object.version = options.longs === String ? String(message.version) : message.version; + else + object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this CompositeFilter to JSON. + * Converts this EntityResult to JSON. * @function toJSON - * @memberof google.datastore.v1.CompositeFilter + * @memberof google.datastore.v1.EntityResult * @instance * @returns {Object.} JSON object */ - CompositeFilter.prototype.toJSON = function toJSON() { + EntityResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Operator enum. - * @name google.datastore.v1.CompositeFilter.Operator + * ResultType enum. + * @name google.datastore.v1.EntityResult.ResultType * @enum {number} - * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value - * @property {number} AND=1 AND value - * @property {number} OR=2 OR value + * @property {number} RESULT_TYPE_UNSPECIFIED=0 RESULT_TYPE_UNSPECIFIED value + * @property {number} FULL=1 FULL value + * @property {number} PROJECTION=2 PROJECTION value + * @property {number} KEY_ONLY=3 KEY_ONLY value */ - CompositeFilter.Operator = (function() { + EntityResult.ResultType = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "AND"] = 1; - values[valuesById[2] = "OR"] = 2; + values[valuesById[0] = "RESULT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FULL"] = 1; + values[valuesById[2] = "PROJECTION"] = 2; + values[valuesById[3] = "KEY_ONLY"] = 3; return values; })(); - return CompositeFilter; + return EntityResult; })(); - v1.PropertyFilter = (function() { + v1.Query = (function() { /** - * Properties of a PropertyFilter. + * Properties of a Query. * @memberof google.datastore.v1 - * @interface IPropertyFilter - * @property {google.datastore.v1.IPropertyReference|null} [property] PropertyFilter property - * @property {google.datastore.v1.PropertyFilter.Operator|null} [op] PropertyFilter op - * @property {google.datastore.v1.IValue|null} [value] PropertyFilter value + * @interface IQuery + * @property {Array.|null} [projection] Query projection + * @property {Array.|null} [kind] Query kind + * @property {google.datastore.v1.IFilter|null} [filter] Query filter + * @property {Array.|null} [order] Query order + * @property {Array.|null} [distinctOn] Query distinctOn + * @property {Uint8Array|null} [startCursor] Query startCursor + * @property {Uint8Array|null} [endCursor] Query endCursor + * @property {number|null} [offset] Query offset + * @property {google.protobuf.IInt32Value|null} [limit] Query limit */ /** - * Constructs a new PropertyFilter. + * Constructs a new Query. * @memberof google.datastore.v1 - * @classdesc Represents a PropertyFilter. - * @implements IPropertyFilter + * @classdesc Represents a Query. + * @implements IQuery * @constructor - * @param {google.datastore.v1.IPropertyFilter=} [properties] Properties to set + * @param {google.datastore.v1.IQuery=} [properties] Properties to set + */ + function Query(properties) { + this.projection = []; + this.kind = []; + this.order = []; + this.distinctOn = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Query projection. + * @member {Array.} projection + * @memberof google.datastore.v1.Query + * @instance + */ + Query.prototype.projection = $util.emptyArray; + + /** + * Query kind. + * @member {Array.} kind + * @memberof google.datastore.v1.Query + * @instance + */ + Query.prototype.kind = $util.emptyArray; + + /** + * Query filter. + * @member {google.datastore.v1.IFilter|null|undefined} filter + * @memberof google.datastore.v1.Query + * @instance + */ + Query.prototype.filter = null; + + /** + * Query order. + * @member {Array.} order + * @memberof google.datastore.v1.Query + * @instance + */ + Query.prototype.order = $util.emptyArray; + + /** + * Query distinctOn. + * @member {Array.} distinctOn + * @memberof google.datastore.v1.Query + * @instance + */ + Query.prototype.distinctOn = $util.emptyArray; + + /** + * Query startCursor. + * @member {Uint8Array} startCursor + * @memberof google.datastore.v1.Query + * @instance */ - function PropertyFilter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Query.prototype.startCursor = $util.newBuffer([]); /** - * PropertyFilter property. - * @member {google.datastore.v1.IPropertyReference|null|undefined} property - * @memberof google.datastore.v1.PropertyFilter + * Query endCursor. + * @member {Uint8Array} endCursor + * @memberof google.datastore.v1.Query * @instance */ - PropertyFilter.prototype.property = null; + Query.prototype.endCursor = $util.newBuffer([]); /** - * PropertyFilter op. - * @member {google.datastore.v1.PropertyFilter.Operator} op - * @memberof google.datastore.v1.PropertyFilter + * Query offset. + * @member {number} offset + * @memberof google.datastore.v1.Query * @instance */ - PropertyFilter.prototype.op = 0; + Query.prototype.offset = 0; /** - * PropertyFilter value. - * @member {google.datastore.v1.IValue|null|undefined} value - * @memberof google.datastore.v1.PropertyFilter + * Query limit. + * @member {google.protobuf.IInt32Value|null|undefined} limit + * @memberof google.datastore.v1.Query * @instance */ - PropertyFilter.prototype.value = null; + Query.prototype.limit = null; /** - * Creates a new PropertyFilter instance using the specified properties. + * Creates a new Query instance using the specified properties. * @function create - * @memberof google.datastore.v1.PropertyFilter + * @memberof google.datastore.v1.Query * @static - * @param {google.datastore.v1.IPropertyFilter=} [properties] Properties to set - * @returns {google.datastore.v1.PropertyFilter} PropertyFilter instance + * @param {google.datastore.v1.IQuery=} [properties] Properties to set + * @returns {google.datastore.v1.Query} Query instance */ - PropertyFilter.create = function create(properties) { - return new PropertyFilter(properties); + Query.create = function create(properties) { + return new Query(properties); }; /** - * Encodes the specified PropertyFilter message. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. + * Encodes the specified Query message. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.PropertyFilter + * @memberof google.datastore.v1.Query * @static - * @param {google.datastore.v1.IPropertyFilter} message PropertyFilter message or plain object to encode + * @param {google.datastore.v1.IQuery} message Query message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PropertyFilter.encode = function encode(message, writer) { + Query.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - $root.google.datastore.v1.PropertyReference.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.op != null && Object.hasOwnProperty.call(message, "op")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.op); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.datastore.v1.Value.encode(message.value, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.projection != null && message.projection.length) + for (var i = 0; i < message.projection.length; ++i) + $root.google.datastore.v1.Projection.encode(message.projection[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.kind != null && message.kind.length) + for (var i = 0; i < message.kind.length; ++i) + $root.google.datastore.v1.KindExpression.encode(message.kind[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.datastore.v1.Filter.encode(message.filter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.order != null && message.order.length) + for (var i = 0; i < message.order.length; ++i) + $root.google.datastore.v1.PropertyOrder.encode(message.order[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.distinctOn != null && message.distinctOn.length) + for (var i = 0; i < message.distinctOn.length; ++i) + $root.google.datastore.v1.PropertyReference.encode(message.distinctOn[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.startCursor != null && Object.hasOwnProperty.call(message, "startCursor")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startCursor); + if (message.endCursor != null && Object.hasOwnProperty.call(message, "endCursor")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.endCursor); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.offset); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.Int32Value.encode(message.limit, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified PropertyFilter message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. + * Encodes the specified Query message, length delimited. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.PropertyFilter + * @memberof google.datastore.v1.Query * @static - * @param {google.datastore.v1.IPropertyFilter} message PropertyFilter message or plain object to encode + * @param {google.datastore.v1.IQuery} message Query message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PropertyFilter.encodeDelimited = function encodeDelimited(message, writer) { + Query.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PropertyFilter message from the specified reader or buffer. + * Decodes a Query message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.PropertyFilter + * @memberof google.datastore.v1.Query * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.PropertyFilter} PropertyFilter + * @returns {google.datastore.v1.Query} Query * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PropertyFilter.decode = function decode(reader, length) { + Query.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyFilter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Query(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32()); - break; case 2: - message.op = reader.int32(); + if (!(message.projection && message.projection.length)) + message.projection = []; + message.projection.push($root.google.datastore.v1.Projection.decode(reader, reader.uint32())); break; case 3: - message.value = $root.google.datastore.v1.Value.decode(reader, reader.uint32()); + if (!(message.kind && message.kind.length)) + message.kind = []; + message.kind.push($root.google.datastore.v1.KindExpression.decode(reader, reader.uint32())); + break; + case 4: + message.filter = $root.google.datastore.v1.Filter.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.order && message.order.length)) + message.order = []; + message.order.push($root.google.datastore.v1.PropertyOrder.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.distinctOn && message.distinctOn.length)) + message.distinctOn = []; + message.distinctOn.push($root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32())); + break; + case 7: + message.startCursor = reader.bytes(); + break; + case 8: + message.endCursor = reader.bytes(); + break; + case 10: + message.offset = reader.int32(); + break; + case 12: + message.limit = $root.google.protobuf.Int32Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -17363,222 +13419,270 @@ }; /** - * Decodes a PropertyFilter message from the specified reader or buffer, length delimited. + * Decodes a Query message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.PropertyFilter + * @memberof google.datastore.v1.Query * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.PropertyFilter} PropertyFilter + * @returns {google.datastore.v1.Query} Query * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PropertyFilter.decodeDelimited = function decodeDelimited(reader) { + Query.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PropertyFilter message. + * Verifies a Query message. * @function verify - * @memberof google.datastore.v1.PropertyFilter + * @memberof google.datastore.v1.Query * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PropertyFilter.verify = function verify(message) { + Query.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.property != null && message.hasOwnProperty("property")) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.property); + if (message.projection != null && message.hasOwnProperty("projection")) { + if (!Array.isArray(message.projection)) + return "projection: array expected"; + for (var i = 0; i < message.projection.length; ++i) { + var error = $root.google.datastore.v1.Projection.verify(message.projection[i]); + if (error) + return "projection." + error; + } + } + if (message.kind != null && message.hasOwnProperty("kind")) { + if (!Array.isArray(message.kind)) + return "kind: array expected"; + for (var i = 0; i < message.kind.length; ++i) { + var error = $root.google.datastore.v1.KindExpression.verify(message.kind[i]); + if (error) + return "kind." + error; + } + } + if (message.filter != null && message.hasOwnProperty("filter")) { + var error = $root.google.datastore.v1.Filter.verify(message.filter); if (error) - return "property." + error; + return "filter." + error; } - if (message.op != null && message.hasOwnProperty("op")) - switch (message.op) { - default: - return "op: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 9: - case 11: - case 13: - break; + if (message.order != null && message.hasOwnProperty("order")) { + if (!Array.isArray(message.order)) + return "order: array expected"; + for (var i = 0; i < message.order.length; ++i) { + var error = $root.google.datastore.v1.PropertyOrder.verify(message.order[i]); + if (error) + return "order." + error; } - if (message.value != null && message.hasOwnProperty("value")) { - var error = $root.google.datastore.v1.Value.verify(message.value); + } + if (message.distinctOn != null && message.hasOwnProperty("distinctOn")) { + if (!Array.isArray(message.distinctOn)) + return "distinctOn: array expected"; + for (var i = 0; i < message.distinctOn.length; ++i) { + var error = $root.google.datastore.v1.PropertyReference.verify(message.distinctOn[i]); + if (error) + return "distinctOn." + error; + } + } + if (message.startCursor != null && message.hasOwnProperty("startCursor")) + if (!(message.startCursor && typeof message.startCursor.length === "number" || $util.isString(message.startCursor))) + return "startCursor: buffer expected"; + if (message.endCursor != null && message.hasOwnProperty("endCursor")) + if (!(message.endCursor && typeof message.endCursor.length === "number" || $util.isString(message.endCursor))) + return "endCursor: buffer expected"; + if (message.offset != null && message.hasOwnProperty("offset")) + if (!$util.isInteger(message.offset)) + return "offset: integer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.Int32Value.verify(message.limit); if (error) - return "value." + error; + return "limit." + error; } return null; }; /** - * Creates a PropertyFilter message from a plain object. Also converts values to their respective internal types. + * Creates a Query message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.PropertyFilter + * @memberof google.datastore.v1.Query * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.PropertyFilter} PropertyFilter + * @returns {google.datastore.v1.Query} Query */ - PropertyFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.PropertyFilter) + Query.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Query) return object; - var message = new $root.google.datastore.v1.PropertyFilter(); - if (object.property != null) { - if (typeof object.property !== "object") - throw TypeError(".google.datastore.v1.PropertyFilter.property: object expected"); - message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); + var message = new $root.google.datastore.v1.Query(); + if (object.projection) { + if (!Array.isArray(object.projection)) + throw TypeError(".google.datastore.v1.Query.projection: array expected"); + message.projection = []; + for (var i = 0; i < object.projection.length; ++i) { + if (typeof object.projection[i] !== "object") + throw TypeError(".google.datastore.v1.Query.projection: object expected"); + message.projection[i] = $root.google.datastore.v1.Projection.fromObject(object.projection[i]); + } + } + if (object.kind) { + if (!Array.isArray(object.kind)) + throw TypeError(".google.datastore.v1.Query.kind: array expected"); + message.kind = []; + for (var i = 0; i < object.kind.length; ++i) { + if (typeof object.kind[i] !== "object") + throw TypeError(".google.datastore.v1.Query.kind: object expected"); + message.kind[i] = $root.google.datastore.v1.KindExpression.fromObject(object.kind[i]); + } + } + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.datastore.v1.Query.filter: object expected"); + message.filter = $root.google.datastore.v1.Filter.fromObject(object.filter); } - switch (object.op) { - case "OPERATOR_UNSPECIFIED": - case 0: - message.op = 0; - break; - case "LESS_THAN": - case 1: - message.op = 1; - break; - case "LESS_THAN_OR_EQUAL": - case 2: - message.op = 2; - break; - case "GREATER_THAN": - case 3: - message.op = 3; - break; - case "GREATER_THAN_OR_EQUAL": - case 4: - message.op = 4; - break; - case "EQUAL": - case 5: - message.op = 5; - break; - case "IN": - case 6: - message.op = 6; - break; - case "NOT_EQUAL": - case 9: - message.op = 9; - break; - case "HAS_ANCESTOR": - case 11: - message.op = 11; - break; - case "NOT_IN": - case 13: - message.op = 13; - break; + if (object.order) { + if (!Array.isArray(object.order)) + throw TypeError(".google.datastore.v1.Query.order: array expected"); + message.order = []; + for (var i = 0; i < object.order.length; ++i) { + if (typeof object.order[i] !== "object") + throw TypeError(".google.datastore.v1.Query.order: object expected"); + message.order[i] = $root.google.datastore.v1.PropertyOrder.fromObject(object.order[i]); + } } - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.datastore.v1.PropertyFilter.value: object expected"); - message.value = $root.google.datastore.v1.Value.fromObject(object.value); + if (object.distinctOn) { + if (!Array.isArray(object.distinctOn)) + throw TypeError(".google.datastore.v1.Query.distinctOn: array expected"); + message.distinctOn = []; + for (var i = 0; i < object.distinctOn.length; ++i) { + if (typeof object.distinctOn[i] !== "object") + throw TypeError(".google.datastore.v1.Query.distinctOn: object expected"); + message.distinctOn[i] = $root.google.datastore.v1.PropertyReference.fromObject(object.distinctOn[i]); + } + } + if (object.startCursor != null) + if (typeof object.startCursor === "string") + $util.base64.decode(object.startCursor, message.startCursor = $util.newBuffer($util.base64.length(object.startCursor)), 0); + else if (object.startCursor.length) + message.startCursor = object.startCursor; + if (object.endCursor != null) + if (typeof object.endCursor === "string") + $util.base64.decode(object.endCursor, message.endCursor = $util.newBuffer($util.base64.length(object.endCursor)), 0); + else if (object.endCursor.length) + message.endCursor = object.endCursor; + if (object.offset != null) + message.offset = object.offset | 0; + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".google.datastore.v1.Query.limit: object expected"); + message.limit = $root.google.protobuf.Int32Value.fromObject(object.limit); } return message; }; /** - * Creates a plain object from a PropertyFilter message. Also converts values to other types if specified. + * Creates a plain object from a Query message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.PropertyFilter + * @memberof google.datastore.v1.Query * @static - * @param {google.datastore.v1.PropertyFilter} message PropertyFilter + * @param {google.datastore.v1.Query} message Query * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PropertyFilter.toObject = function toObject(message, options) { + Query.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.projection = []; + object.kind = []; + object.order = []; + object.distinctOn = []; + } if (options.defaults) { - object.property = null; - object.op = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; - object.value = null; + object.filter = null; + if (options.bytes === String) + object.startCursor = ""; + else { + object.startCursor = []; + if (options.bytes !== Array) + object.startCursor = $util.newBuffer(object.startCursor); + } + if (options.bytes === String) + object.endCursor = ""; + else { + object.endCursor = []; + if (options.bytes !== Array) + object.endCursor = $util.newBuffer(object.endCursor); + } + object.offset = 0; + object.limit = null; } - if (message.property != null && message.hasOwnProperty("property")) - object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); - if (message.op != null && message.hasOwnProperty("op")) - object.op = options.enums === String ? $root.google.datastore.v1.PropertyFilter.Operator[message.op] : message.op; - if (message.value != null && message.hasOwnProperty("value")) - object.value = $root.google.datastore.v1.Value.toObject(message.value, options); + if (message.projection && message.projection.length) { + object.projection = []; + for (var j = 0; j < message.projection.length; ++j) + object.projection[j] = $root.google.datastore.v1.Projection.toObject(message.projection[j], options); + } + if (message.kind && message.kind.length) { + object.kind = []; + for (var j = 0; j < message.kind.length; ++j) + object.kind[j] = $root.google.datastore.v1.KindExpression.toObject(message.kind[j], options); + } + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = $root.google.datastore.v1.Filter.toObject(message.filter, options); + if (message.order && message.order.length) { + object.order = []; + for (var j = 0; j < message.order.length; ++j) + object.order[j] = $root.google.datastore.v1.PropertyOrder.toObject(message.order[j], options); + } + if (message.distinctOn && message.distinctOn.length) { + object.distinctOn = []; + for (var j = 0; j < message.distinctOn.length; ++j) + object.distinctOn[j] = $root.google.datastore.v1.PropertyReference.toObject(message.distinctOn[j], options); + } + if (message.startCursor != null && message.hasOwnProperty("startCursor")) + object.startCursor = options.bytes === String ? $util.base64.encode(message.startCursor, 0, message.startCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.startCursor) : message.startCursor; + if (message.endCursor != null && message.hasOwnProperty("endCursor")) + object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = message.offset; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.Int32Value.toObject(message.limit, options); return object; }; /** - * Converts this PropertyFilter to JSON. + * Converts this Query to JSON. * @function toJSON - * @memberof google.datastore.v1.PropertyFilter + * @memberof google.datastore.v1.Query * @instance * @returns {Object.} JSON object */ - PropertyFilter.prototype.toJSON = function toJSON() { + Query.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Operator enum. - * @name google.datastore.v1.PropertyFilter.Operator - * @enum {number} - * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value - * @property {number} LESS_THAN=1 LESS_THAN value - * @property {number} LESS_THAN_OR_EQUAL=2 LESS_THAN_OR_EQUAL value - * @property {number} GREATER_THAN=3 GREATER_THAN value - * @property {number} GREATER_THAN_OR_EQUAL=4 GREATER_THAN_OR_EQUAL value - * @property {number} EQUAL=5 EQUAL value - * @property {number} IN=6 IN value - * @property {number} NOT_EQUAL=9 NOT_EQUAL value - * @property {number} HAS_ANCESTOR=11 HAS_ANCESTOR value - * @property {number} NOT_IN=13 NOT_IN value - */ - PropertyFilter.Operator = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "LESS_THAN"] = 1; - values[valuesById[2] = "LESS_THAN_OR_EQUAL"] = 2; - values[valuesById[3] = "GREATER_THAN"] = 3; - values[valuesById[4] = "GREATER_THAN_OR_EQUAL"] = 4; - values[valuesById[5] = "EQUAL"] = 5; - values[valuesById[6] = "IN"] = 6; - values[valuesById[9] = "NOT_EQUAL"] = 9; - values[valuesById[11] = "HAS_ANCESTOR"] = 11; - values[valuesById[13] = "NOT_IN"] = 13; - return values; - })(); - - return PropertyFilter; + return Query; })(); - v1.GqlQuery = (function() { + v1.KindExpression = (function() { /** - * Properties of a GqlQuery. + * Properties of a KindExpression. * @memberof google.datastore.v1 - * @interface IGqlQuery - * @property {string|null} [queryString] GqlQuery queryString - * @property {boolean|null} [allowLiterals] GqlQuery allowLiterals - * @property {Object.|null} [namedBindings] GqlQuery namedBindings - * @property {Array.|null} [positionalBindings] GqlQuery positionalBindings + * @interface IKindExpression + * @property {string|null} [name] KindExpression name */ /** - * Constructs a new GqlQuery. + * Constructs a new KindExpression. * @memberof google.datastore.v1 - * @classdesc Represents a GqlQuery. - * @implements IGqlQuery + * @classdesc Represents a KindExpression. + * @implements IKindExpression * @constructor - * @param {google.datastore.v1.IGqlQuery=} [properties] Properties to set + * @param {google.datastore.v1.IKindExpression=} [properties] Properties to set */ - function GqlQuery(properties) { - this.namedBindings = {}; - this.positionalBindings = []; + function KindExpression(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17586,139 +13690,75 @@ } /** - * GqlQuery queryString. - * @member {string} queryString - * @memberof google.datastore.v1.GqlQuery - * @instance - */ - GqlQuery.prototype.queryString = ""; - - /** - * GqlQuery allowLiterals. - * @member {boolean} allowLiterals - * @memberof google.datastore.v1.GqlQuery - * @instance - */ - GqlQuery.prototype.allowLiterals = false; - - /** - * GqlQuery namedBindings. - * @member {Object.} namedBindings - * @memberof google.datastore.v1.GqlQuery - * @instance - */ - GqlQuery.prototype.namedBindings = $util.emptyObject; - - /** - * GqlQuery positionalBindings. - * @member {Array.} positionalBindings - * @memberof google.datastore.v1.GqlQuery + * KindExpression name. + * @member {string} name + * @memberof google.datastore.v1.KindExpression * @instance */ - GqlQuery.prototype.positionalBindings = $util.emptyArray; + KindExpression.prototype.name = ""; /** - * Creates a new GqlQuery instance using the specified properties. + * Creates a new KindExpression instance using the specified properties. * @function create - * @memberof google.datastore.v1.GqlQuery + * @memberof google.datastore.v1.KindExpression * @static - * @param {google.datastore.v1.IGqlQuery=} [properties] Properties to set - * @returns {google.datastore.v1.GqlQuery} GqlQuery instance + * @param {google.datastore.v1.IKindExpression=} [properties] Properties to set + * @returns {google.datastore.v1.KindExpression} KindExpression instance */ - GqlQuery.create = function create(properties) { - return new GqlQuery(properties); + KindExpression.create = function create(properties) { + return new KindExpression(properties); }; /** - * Encodes the specified GqlQuery message. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. + * Encodes the specified KindExpression message. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.GqlQuery + * @memberof google.datastore.v1.KindExpression * @static - * @param {google.datastore.v1.IGqlQuery} message GqlQuery message or plain object to encode + * @param {google.datastore.v1.IKindExpression} message KindExpression message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GqlQuery.encode = function encode(message, writer) { + KindExpression.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.queryString != null && Object.hasOwnProperty.call(message, "queryString")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryString); - if (message.allowLiterals != null && Object.hasOwnProperty.call(message, "allowLiterals")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowLiterals); - if (message.positionalBindings != null && message.positionalBindings.length) - for (var i = 0; i < message.positionalBindings.length; ++i) - $root.google.datastore.v1.GqlQueryParameter.encode(message.positionalBindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.namedBindings != null && Object.hasOwnProperty.call(message, "namedBindings")) - for (var keys = Object.keys(message.namedBindings), 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.datastore.v1.GqlQueryParameter.encode(message.namedBindings[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified GqlQuery message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. + * Encodes the specified KindExpression message, length delimited. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.GqlQuery + * @memberof google.datastore.v1.KindExpression * @static - * @param {google.datastore.v1.IGqlQuery} message GqlQuery message or plain object to encode + * @param {google.datastore.v1.IKindExpression} message KindExpression message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GqlQuery.encodeDelimited = function encodeDelimited(message, writer) { + KindExpression.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GqlQuery message from the specified reader or buffer. + * Decodes a KindExpression message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.GqlQuery + * @memberof google.datastore.v1.KindExpression * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.GqlQuery} GqlQuery + * @returns {google.datastore.v1.KindExpression} KindExpression * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GqlQuery.decode = function decode(reader, length) { + KindExpression.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.GqlQuery(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.KindExpression(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.queryString = reader.string(); - break; - case 2: - message.allowLiterals = reader.bool(); - break; - case 5: - if (message.namedBindings === $util.emptyObject) - message.namedBindings = {}; - 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.datastore.v1.GqlQueryParameter.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.namedBindings[key] = value; - break; - case 4: - if (!(message.positionalBindings && message.positionalBindings.length)) - message.positionalBindings = []; - message.positionalBindings.push($root.google.datastore.v1.GqlQueryParameter.decode(reader, reader.uint32())); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -17729,171 +13769,107 @@ }; /** - * Decodes a GqlQuery message from the specified reader or buffer, length delimited. + * Decodes a KindExpression message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.GqlQuery + * @memberof google.datastore.v1.KindExpression * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.GqlQuery} GqlQuery + * @returns {google.datastore.v1.KindExpression} KindExpression * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GqlQuery.decodeDelimited = function decodeDelimited(reader) { + KindExpression.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GqlQuery message. + * Verifies a KindExpression message. * @function verify - * @memberof google.datastore.v1.GqlQuery + * @memberof google.datastore.v1.KindExpression * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GqlQuery.verify = function verify(message) { + KindExpression.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.queryString != null && message.hasOwnProperty("queryString")) - if (!$util.isString(message.queryString)) - return "queryString: string expected"; - if (message.allowLiterals != null && message.hasOwnProperty("allowLiterals")) - if (typeof message.allowLiterals !== "boolean") - return "allowLiterals: boolean expected"; - if (message.namedBindings != null && message.hasOwnProperty("namedBindings")) { - if (!$util.isObject(message.namedBindings)) - return "namedBindings: object expected"; - var key = Object.keys(message.namedBindings); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.datastore.v1.GqlQueryParameter.verify(message.namedBindings[key[i]]); - if (error) - return "namedBindings." + error; - } - } - if (message.positionalBindings != null && message.hasOwnProperty("positionalBindings")) { - if (!Array.isArray(message.positionalBindings)) - return "positionalBindings: array expected"; - for (var i = 0; i < message.positionalBindings.length; ++i) { - var error = $root.google.datastore.v1.GqlQueryParameter.verify(message.positionalBindings[i]); - if (error) - return "positionalBindings." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a GqlQuery message from a plain object. Also converts values to their respective internal types. + * Creates a KindExpression message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.GqlQuery + * @memberof google.datastore.v1.KindExpression * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.GqlQuery} GqlQuery + * @returns {google.datastore.v1.KindExpression} KindExpression */ - GqlQuery.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.GqlQuery) + KindExpression.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.KindExpression) return object; - var message = new $root.google.datastore.v1.GqlQuery(); - if (object.queryString != null) - message.queryString = String(object.queryString); - if (object.allowLiterals != null) - message.allowLiterals = Boolean(object.allowLiterals); - if (object.namedBindings) { - if (typeof object.namedBindings !== "object") - throw TypeError(".google.datastore.v1.GqlQuery.namedBindings: object expected"); - message.namedBindings = {}; - for (var keys = Object.keys(object.namedBindings), i = 0; i < keys.length; ++i) { - if (typeof object.namedBindings[keys[i]] !== "object") - throw TypeError(".google.datastore.v1.GqlQuery.namedBindings: object expected"); - message.namedBindings[keys[i]] = $root.google.datastore.v1.GqlQueryParameter.fromObject(object.namedBindings[keys[i]]); - } - } - if (object.positionalBindings) { - if (!Array.isArray(object.positionalBindings)) - throw TypeError(".google.datastore.v1.GqlQuery.positionalBindings: array expected"); - message.positionalBindings = []; - for (var i = 0; i < object.positionalBindings.length; ++i) { - if (typeof object.positionalBindings[i] !== "object") - throw TypeError(".google.datastore.v1.GqlQuery.positionalBindings: object expected"); - message.positionalBindings[i] = $root.google.datastore.v1.GqlQueryParameter.fromObject(object.positionalBindings[i]); - } - } + var message = new $root.google.datastore.v1.KindExpression(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a GqlQuery message. Also converts values to other types if specified. + * Creates a plain object from a KindExpression message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.GqlQuery + * @memberof google.datastore.v1.KindExpression * @static - * @param {google.datastore.v1.GqlQuery} message GqlQuery + * @param {google.datastore.v1.KindExpression} message KindExpression * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GqlQuery.toObject = function toObject(message, options) { + KindExpression.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.positionalBindings = []; - if (options.objects || options.defaults) - object.namedBindings = {}; - if (options.defaults) { - object.queryString = ""; - object.allowLiterals = false; - } - if (message.queryString != null && message.hasOwnProperty("queryString")) - object.queryString = message.queryString; - if (message.allowLiterals != null && message.hasOwnProperty("allowLiterals")) - object.allowLiterals = message.allowLiterals; - if (message.positionalBindings && message.positionalBindings.length) { - object.positionalBindings = []; - for (var j = 0; j < message.positionalBindings.length; ++j) - object.positionalBindings[j] = $root.google.datastore.v1.GqlQueryParameter.toObject(message.positionalBindings[j], options); - } - var keys2; - if (message.namedBindings && (keys2 = Object.keys(message.namedBindings)).length) { - object.namedBindings = {}; - for (var j = 0; j < keys2.length; ++j) - object.namedBindings[keys2[j]] = $root.google.datastore.v1.GqlQueryParameter.toObject(message.namedBindings[keys2[j]], options); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this GqlQuery to JSON. + * Converts this KindExpression to JSON. * @function toJSON - * @memberof google.datastore.v1.GqlQuery + * @memberof google.datastore.v1.KindExpression * @instance * @returns {Object.} JSON object */ - GqlQuery.prototype.toJSON = function toJSON() { + KindExpression.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GqlQuery; + return KindExpression; })(); - v1.GqlQueryParameter = (function() { + v1.PropertyReference = (function() { /** - * Properties of a GqlQueryParameter. + * Properties of a PropertyReference. * @memberof google.datastore.v1 - * @interface IGqlQueryParameter - * @property {google.datastore.v1.IValue|null} [value] GqlQueryParameter value - * @property {Uint8Array|null} [cursor] GqlQueryParameter cursor + * @interface IPropertyReference + * @property {string|null} [name] PropertyReference name */ /** - * Constructs a new GqlQueryParameter. + * Constructs a new PropertyReference. * @memberof google.datastore.v1 - * @classdesc Represents a GqlQueryParameter. - * @implements IGqlQueryParameter + * @classdesc Represents a PropertyReference. + * @implements IPropertyReference * @constructor - * @param {google.datastore.v1.IGqlQueryParameter=} [properties] Properties to set + * @param {google.datastore.v1.IPropertyReference=} [properties] Properties to set */ - function GqlQueryParameter(properties) { + function PropertyReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17901,102 +13877,75 @@ } /** - * GqlQueryParameter value. - * @member {google.datastore.v1.IValue|null|undefined} value - * @memberof google.datastore.v1.GqlQueryParameter - * @instance - */ - GqlQueryParameter.prototype.value = null; - - /** - * GqlQueryParameter cursor. - * @member {Uint8Array|null|undefined} cursor - * @memberof google.datastore.v1.GqlQueryParameter - * @instance - */ - GqlQueryParameter.prototype.cursor = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * GqlQueryParameter parameterType. - * @member {"value"|"cursor"|undefined} parameterType - * @memberof google.datastore.v1.GqlQueryParameter + * PropertyReference name. + * @member {string} name + * @memberof google.datastore.v1.PropertyReference * @instance */ - Object.defineProperty(GqlQueryParameter.prototype, "parameterType", { - get: $util.oneOfGetter($oneOfFields = ["value", "cursor"]), - set: $util.oneOfSetter($oneOfFields) - }); + PropertyReference.prototype.name = ""; /** - * Creates a new GqlQueryParameter instance using the specified properties. + * Creates a new PropertyReference instance using the specified properties. * @function create - * @memberof google.datastore.v1.GqlQueryParameter + * @memberof google.datastore.v1.PropertyReference * @static - * @param {google.datastore.v1.IGqlQueryParameter=} [properties] Properties to set - * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter instance + * @param {google.datastore.v1.IPropertyReference=} [properties] Properties to set + * @returns {google.datastore.v1.PropertyReference} PropertyReference instance */ - GqlQueryParameter.create = function create(properties) { - return new GqlQueryParameter(properties); + PropertyReference.create = function create(properties) { + return new PropertyReference(properties); }; /** - * Encodes the specified GqlQueryParameter message. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. + * Encodes the specified PropertyReference message. Does not implicitly {@link google.datastore.v1.PropertyReference.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.GqlQueryParameter + * @memberof google.datastore.v1.PropertyReference * @static - * @param {google.datastore.v1.IGqlQueryParameter} message GqlQueryParameter message or plain object to encode + * @param {google.datastore.v1.IPropertyReference} message PropertyReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GqlQueryParameter.encode = function encode(message, writer) { + PropertyReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - $root.google.datastore.v1.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cursor != null && Object.hasOwnProperty.call(message, "cursor")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.cursor); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); return writer; }; /** - * Encodes the specified GqlQueryParameter message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. + * Encodes the specified PropertyReference message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.GqlQueryParameter + * @memberof google.datastore.v1.PropertyReference * @static - * @param {google.datastore.v1.IGqlQueryParameter} message GqlQueryParameter message or plain object to encode + * @param {google.datastore.v1.IPropertyReference} message PropertyReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GqlQueryParameter.encodeDelimited = function encodeDelimited(message, writer) { + PropertyReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GqlQueryParameter message from the specified reader or buffer. + * Decodes a PropertyReference message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.GqlQueryParameter + * @memberof google.datastore.v1.PropertyReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter + * @returns {google.datastore.v1.PropertyReference} PropertyReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GqlQueryParameter.decode = function decode(reader, length) { + PropertyReference.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.GqlQueryParameter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyReference(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 2: - message.value = $root.google.datastore.v1.Value.decode(reader, reader.uint32()); - break; - case 3: - message.cursor = reader.bytes(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -18007,142 +13956,107 @@ }; /** - * Decodes a GqlQueryParameter message from the specified reader or buffer, length delimited. + * Decodes a PropertyReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.GqlQueryParameter + * @memberof google.datastore.v1.PropertyReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter + * @returns {google.datastore.v1.PropertyReference} PropertyReference * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GqlQueryParameter.decodeDelimited = function decodeDelimited(reader) { + PropertyReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GqlQueryParameter message. + * Verifies a PropertyReference message. * @function verify - * @memberof google.datastore.v1.GqlQueryParameter + * @memberof google.datastore.v1.PropertyReference * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GqlQueryParameter.verify = function verify(message) { + PropertyReference.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties.parameterType = 1; - { - var error = $root.google.datastore.v1.Value.verify(message.value); - if (error) - return "value." + error; - } - } - if (message.cursor != null && message.hasOwnProperty("cursor")) { - if (properties.parameterType === 1) - return "parameterType: multiple values"; - properties.parameterType = 1; - if (!(message.cursor && typeof message.cursor.length === "number" || $util.isString(message.cursor))) - return "cursor: buffer expected"; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a GqlQueryParameter message from a plain object. Also converts values to their respective internal types. + * Creates a PropertyReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.GqlQueryParameter + * @memberof google.datastore.v1.PropertyReference * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter + * @returns {google.datastore.v1.PropertyReference} PropertyReference */ - GqlQueryParameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.GqlQueryParameter) + PropertyReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.PropertyReference) return object; - var message = new $root.google.datastore.v1.GqlQueryParameter(); - if (object.value != null) { - if (typeof object.value !== "object") - throw TypeError(".google.datastore.v1.GqlQueryParameter.value: object expected"); - message.value = $root.google.datastore.v1.Value.fromObject(object.value); - } - if (object.cursor != null) - if (typeof object.cursor === "string") - $util.base64.decode(object.cursor, message.cursor = $util.newBuffer($util.base64.length(object.cursor)), 0); - else if (object.cursor.length) - message.cursor = object.cursor; + var message = new $root.google.datastore.v1.PropertyReference(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a GqlQueryParameter message. Also converts values to other types if specified. + * Creates a plain object from a PropertyReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.GqlQueryParameter + * @memberof google.datastore.v1.PropertyReference * @static - * @param {google.datastore.v1.GqlQueryParameter} message GqlQueryParameter + * @param {google.datastore.v1.PropertyReference} message PropertyReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GqlQueryParameter.toObject = function toObject(message, options) { + PropertyReference.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.value != null && message.hasOwnProperty("value")) { - object.value = $root.google.datastore.v1.Value.toObject(message.value, options); - if (options.oneofs) - object.parameterType = "value"; - } - if (message.cursor != null && message.hasOwnProperty("cursor")) { - object.cursor = options.bytes === String ? $util.base64.encode(message.cursor, 0, message.cursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.cursor) : message.cursor; - if (options.oneofs) - object.parameterType = "cursor"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this GqlQueryParameter to JSON. + * Converts this PropertyReference to JSON. * @function toJSON - * @memberof google.datastore.v1.GqlQueryParameter + * @memberof google.datastore.v1.PropertyReference * @instance * @returns {Object.} JSON object */ - GqlQueryParameter.prototype.toJSON = function toJSON() { + PropertyReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GqlQueryParameter; + return PropertyReference; })(); - v1.QueryResultBatch = (function() { + v1.Projection = (function() { /** - * Properties of a QueryResultBatch. + * Properties of a Projection. * @memberof google.datastore.v1 - * @interface IQueryResultBatch - * @property {number|null} [skippedResults] QueryResultBatch skippedResults - * @property {Uint8Array|null} [skippedCursor] QueryResultBatch skippedCursor - * @property {google.datastore.v1.EntityResult.ResultType|null} [entityResultType] QueryResultBatch entityResultType - * @property {Array.|null} [entityResults] QueryResultBatch entityResults - * @property {Uint8Array|null} [endCursor] QueryResultBatch endCursor - * @property {google.datastore.v1.QueryResultBatch.MoreResultsType|null} [moreResults] QueryResultBatch moreResults - * @property {number|Long|null} [snapshotVersion] QueryResultBatch snapshotVersion - * @property {google.protobuf.ITimestamp|null} [readTime] QueryResultBatch readTime + * @interface IProjection + * @property {google.datastore.v1.IPropertyReference|null} [property] Projection property */ /** - * Constructs a new QueryResultBatch. + * Constructs a new Projection. * @memberof google.datastore.v1 - * @classdesc Represents a QueryResultBatch. - * @implements IQueryResultBatch + * @classdesc Represents a Projection. + * @implements IProjection * @constructor - * @param {google.datastore.v1.IQueryResultBatch=} [properties] Properties to set + * @param {google.datastore.v1.IProjection=} [properties] Properties to set */ - function QueryResultBatch(properties) { - this.entityResults = []; + function Projection(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18150,169 +14064,75 @@ } /** - * QueryResultBatch skippedResults. - * @member {number} skippedResults - * @memberof google.datastore.v1.QueryResultBatch - * @instance - */ - QueryResultBatch.prototype.skippedResults = 0; - - /** - * QueryResultBatch skippedCursor. - * @member {Uint8Array} skippedCursor - * @memberof google.datastore.v1.QueryResultBatch - * @instance - */ - QueryResultBatch.prototype.skippedCursor = $util.newBuffer([]); - - /** - * QueryResultBatch entityResultType. - * @member {google.datastore.v1.EntityResult.ResultType} entityResultType - * @memberof google.datastore.v1.QueryResultBatch - * @instance - */ - QueryResultBatch.prototype.entityResultType = 0; - - /** - * QueryResultBatch entityResults. - * @member {Array.} entityResults - * @memberof google.datastore.v1.QueryResultBatch - * @instance - */ - QueryResultBatch.prototype.entityResults = $util.emptyArray; - - /** - * QueryResultBatch endCursor. - * @member {Uint8Array} endCursor - * @memberof google.datastore.v1.QueryResultBatch - * @instance - */ - QueryResultBatch.prototype.endCursor = $util.newBuffer([]); - - /** - * QueryResultBatch moreResults. - * @member {google.datastore.v1.QueryResultBatch.MoreResultsType} moreResults - * @memberof google.datastore.v1.QueryResultBatch - * @instance - */ - QueryResultBatch.prototype.moreResults = 0; - - /** - * QueryResultBatch snapshotVersion. - * @member {number|Long} snapshotVersion - * @memberof google.datastore.v1.QueryResultBatch - * @instance - */ - QueryResultBatch.prototype.snapshotVersion = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * QueryResultBatch readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.QueryResultBatch + * Projection property. + * @member {google.datastore.v1.IPropertyReference|null|undefined} property + * @memberof google.datastore.v1.Projection * @instance */ - QueryResultBatch.prototype.readTime = null; + Projection.prototype.property = null; /** - * Creates a new QueryResultBatch instance using the specified properties. + * Creates a new Projection instance using the specified properties. * @function create - * @memberof google.datastore.v1.QueryResultBatch + * @memberof google.datastore.v1.Projection * @static - * @param {google.datastore.v1.IQueryResultBatch=} [properties] Properties to set - * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch instance + * @param {google.datastore.v1.IProjection=} [properties] Properties to set + * @returns {google.datastore.v1.Projection} Projection instance */ - QueryResultBatch.create = function create(properties) { - return new QueryResultBatch(properties); + Projection.create = function create(properties) { + return new Projection(properties); }; /** - * Encodes the specified QueryResultBatch message. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. + * Encodes the specified Projection message. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.QueryResultBatch + * @memberof google.datastore.v1.Projection * @static - * @param {google.datastore.v1.IQueryResultBatch} message QueryResultBatch message or plain object to encode + * @param {google.datastore.v1.IProjection} message Projection message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryResultBatch.encode = function encode(message, writer) { + Projection.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entityResultType != null && Object.hasOwnProperty.call(message, "entityResultType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.entityResultType); - if (message.entityResults != null && message.entityResults.length) - for (var i = 0; i < message.entityResults.length; ++i) - $root.google.datastore.v1.EntityResult.encode(message.entityResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.skippedCursor != null && Object.hasOwnProperty.call(message, "skippedCursor")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.skippedCursor); - if (message.endCursor != null && Object.hasOwnProperty.call(message, "endCursor")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.endCursor); - if (message.moreResults != null && Object.hasOwnProperty.call(message, "moreResults")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.moreResults); - if (message.skippedResults != null && Object.hasOwnProperty.call(message, "skippedResults")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.skippedResults); - if (message.snapshotVersion != null && Object.hasOwnProperty.call(message, "snapshotVersion")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.snapshotVersion); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + $root.google.datastore.v1.PropertyReference.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified QueryResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. + * Encodes the specified Projection message, length delimited. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.QueryResultBatch + * @memberof google.datastore.v1.Projection * @static - * @param {google.datastore.v1.IQueryResultBatch} message QueryResultBatch message or plain object to encode + * @param {google.datastore.v1.IProjection} message Projection message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryResultBatch.encodeDelimited = function encodeDelimited(message, writer) { + Projection.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryResultBatch message from the specified reader or buffer. + * Decodes a Projection message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.QueryResultBatch + * @memberof google.datastore.v1.Projection * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch + * @returns {google.datastore.v1.Projection} Projection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryResultBatch.decode = function decode(reader, length) { + Projection.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.QueryResultBatch(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Projection(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 6: - message.skippedResults = reader.int32(); - break; - case 3: - message.skippedCursor = reader.bytes(); - break; case 1: - message.entityResultType = reader.int32(); - break; - case 2: - if (!(message.entityResults && message.entityResults.length)) - message.entityResults = []; - message.entityResults.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); - break; - case 4: - message.endCursor = reader.bytes(); - break; - case 5: - message.moreResults = reader.int32(); - break; - case 7: - message.snapshotVersion = reader.int64(); - break; - case 8: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -18323,593 +14143,608 @@ }; /** - * Decodes a QueryResultBatch message from the specified reader or buffer, length delimited. + * Decodes a Projection message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.QueryResultBatch + * @memberof google.datastore.v1.Projection * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch + * @returns {google.datastore.v1.Projection} Projection * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryResultBatch.decodeDelimited = function decodeDelimited(reader) { + Projection.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryResultBatch message. + * Verifies a Projection message. * @function verify - * @memberof google.datastore.v1.QueryResultBatch + * @memberof google.datastore.v1.Projection * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryResultBatch.verify = function verify(message) { + Projection.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.skippedResults != null && message.hasOwnProperty("skippedResults")) - if (!$util.isInteger(message.skippedResults)) - return "skippedResults: integer expected"; - if (message.skippedCursor != null && message.hasOwnProperty("skippedCursor")) - if (!(message.skippedCursor && typeof message.skippedCursor.length === "number" || $util.isString(message.skippedCursor))) - return "skippedCursor: buffer expected"; - if (message.entityResultType != null && message.hasOwnProperty("entityResultType")) - switch (message.entityResultType) { - default: - return "entityResultType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.entityResults != null && message.hasOwnProperty("entityResults")) { - if (!Array.isArray(message.entityResults)) - return "entityResults: array expected"; - for (var i = 0; i < message.entityResults.length; ++i) { - var error = $root.google.datastore.v1.EntityResult.verify(message.entityResults[i]); - if (error) - return "entityResults." + error; - } - } - if (message.endCursor != null && message.hasOwnProperty("endCursor")) - if (!(message.endCursor && typeof message.endCursor.length === "number" || $util.isString(message.endCursor))) - return "endCursor: buffer expected"; - if (message.moreResults != null && message.hasOwnProperty("moreResults")) - switch (message.moreResults) { - default: - return "moreResults: enum value expected"; - case 0: - case 1: - case 2: - case 4: - case 3: - break; - } - if (message.snapshotVersion != null && message.hasOwnProperty("snapshotVersion")) - if (!$util.isInteger(message.snapshotVersion) && !(message.snapshotVersion && $util.isInteger(message.snapshotVersion.low) && $util.isInteger(message.snapshotVersion.high))) - return "snapshotVersion: integer|Long expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.datastore.v1.PropertyReference.verify(message.property); if (error) - return "readTime." + error; + return "property." + error; } return null; }; /** - * Creates a QueryResultBatch message from a plain object. Also converts values to their respective internal types. + * Creates a Projection message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.QueryResultBatch + * @memberof google.datastore.v1.Projection * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch + * @returns {google.datastore.v1.Projection} Projection */ - QueryResultBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.QueryResultBatch) + Projection.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Projection) return object; - var message = new $root.google.datastore.v1.QueryResultBatch(); - if (object.skippedResults != null) - message.skippedResults = object.skippedResults | 0; - if (object.skippedCursor != null) - if (typeof object.skippedCursor === "string") - $util.base64.decode(object.skippedCursor, message.skippedCursor = $util.newBuffer($util.base64.length(object.skippedCursor)), 0); - else if (object.skippedCursor.length) - message.skippedCursor = object.skippedCursor; - switch (object.entityResultType) { - case "RESULT_TYPE_UNSPECIFIED": - case 0: - message.entityResultType = 0; - break; - case "FULL": - case 1: - message.entityResultType = 1; - break; - case "PROJECTION": - case 2: - message.entityResultType = 2; - break; - case "KEY_ONLY": - case 3: - message.entityResultType = 3; - break; - } - if (object.entityResults) { - if (!Array.isArray(object.entityResults)) - throw TypeError(".google.datastore.v1.QueryResultBatch.entityResults: array expected"); - message.entityResults = []; - for (var i = 0; i < object.entityResults.length; ++i) { - if (typeof object.entityResults[i] !== "object") - throw TypeError(".google.datastore.v1.QueryResultBatch.entityResults: object expected"); - message.entityResults[i] = $root.google.datastore.v1.EntityResult.fromObject(object.entityResults[i]); - } - } - if (object.endCursor != null) - if (typeof object.endCursor === "string") - $util.base64.decode(object.endCursor, message.endCursor = $util.newBuffer($util.base64.length(object.endCursor)), 0); - else if (object.endCursor.length) - message.endCursor = object.endCursor; - switch (object.moreResults) { - case "MORE_RESULTS_TYPE_UNSPECIFIED": - case 0: - message.moreResults = 0; - break; - case "NOT_FINISHED": - case 1: - message.moreResults = 1; - break; - case "MORE_RESULTS_AFTER_LIMIT": - case 2: - message.moreResults = 2; - break; - case "MORE_RESULTS_AFTER_CURSOR": - case 4: - message.moreResults = 4; - break; - case "NO_MORE_RESULTS": - case 3: - message.moreResults = 3; - break; - } - if (object.snapshotVersion != null) - if ($util.Long) - (message.snapshotVersion = $util.Long.fromValue(object.snapshotVersion)).unsigned = false; - else if (typeof object.snapshotVersion === "string") - message.snapshotVersion = parseInt(object.snapshotVersion, 10); - else if (typeof object.snapshotVersion === "number") - message.snapshotVersion = object.snapshotVersion; - else if (typeof object.snapshotVersion === "object") - message.snapshotVersion = new $util.LongBits(object.snapshotVersion.low >>> 0, object.snapshotVersion.high >>> 0).toNumber(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.QueryResultBatch.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + var message = new $root.google.datastore.v1.Projection(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.datastore.v1.Projection.property: object expected"); + message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); } return message; }; /** - * Creates a plain object from a QueryResultBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.QueryResultBatch - * @static - * @param {google.datastore.v1.QueryResultBatch} message QueryResultBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryResultBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entityResults = []; - if (options.defaults) { - object.entityResultType = options.enums === String ? "RESULT_TYPE_UNSPECIFIED" : 0; - if (options.bytes === String) - object.skippedCursor = ""; - else { - object.skippedCursor = []; - if (options.bytes !== Array) - object.skippedCursor = $util.newBuffer(object.skippedCursor); - } - if (options.bytes === String) - object.endCursor = ""; - else { - object.endCursor = []; - if (options.bytes !== Array) - object.endCursor = $util.newBuffer(object.endCursor); - } - object.moreResults = options.enums === String ? "MORE_RESULTS_TYPE_UNSPECIFIED" : 0; - object.skippedResults = 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.snapshotVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.snapshotVersion = options.longs === String ? "0" : 0; - object.readTime = null; - } - if (message.entityResultType != null && message.hasOwnProperty("entityResultType")) - object.entityResultType = options.enums === String ? $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] : message.entityResultType; - if (message.entityResults && message.entityResults.length) { - object.entityResults = []; - for (var j = 0; j < message.entityResults.length; ++j) - object.entityResults[j] = $root.google.datastore.v1.EntityResult.toObject(message.entityResults[j], options); - } - if (message.skippedCursor != null && message.hasOwnProperty("skippedCursor")) - object.skippedCursor = options.bytes === String ? $util.base64.encode(message.skippedCursor, 0, message.skippedCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.skippedCursor) : message.skippedCursor; - if (message.endCursor != null && message.hasOwnProperty("endCursor")) - object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; - if (message.moreResults != null && message.hasOwnProperty("moreResults")) - object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; - if (message.skippedResults != null && message.hasOwnProperty("skippedResults")) - object.skippedResults = message.skippedResults; - if (message.snapshotVersion != null && message.hasOwnProperty("snapshotVersion")) - if (typeof message.snapshotVersion === "number") - object.snapshotVersion = options.longs === String ? String(message.snapshotVersion) : message.snapshotVersion; - else - object.snapshotVersion = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotVersion) : options.longs === Number ? new $util.LongBits(message.snapshotVersion.low >>> 0, message.snapshotVersion.high >>> 0).toNumber() : message.snapshotVersion; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + * Creates a plain object from a Projection message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.Projection + * @static + * @param {google.datastore.v1.Projection} message Projection + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Projection.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.property = null; + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); return object; }; /** - * Converts this QueryResultBatch to JSON. + * Converts this Projection to JSON. * @function toJSON - * @memberof google.datastore.v1.QueryResultBatch + * @memberof google.datastore.v1.Projection * @instance * @returns {Object.} JSON object */ - QueryResultBatch.prototype.toJSON = function toJSON() { + Projection.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * MoreResultsType enum. - * @name google.datastore.v1.QueryResultBatch.MoreResultsType - * @enum {number} - * @property {number} MORE_RESULTS_TYPE_UNSPECIFIED=0 MORE_RESULTS_TYPE_UNSPECIFIED value - * @property {number} NOT_FINISHED=1 NOT_FINISHED value - * @property {number} MORE_RESULTS_AFTER_LIMIT=2 MORE_RESULTS_AFTER_LIMIT value - * @property {number} MORE_RESULTS_AFTER_CURSOR=4 MORE_RESULTS_AFTER_CURSOR value - * @property {number} NO_MORE_RESULTS=3 NO_MORE_RESULTS value - */ - QueryResultBatch.MoreResultsType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MORE_RESULTS_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NOT_FINISHED"] = 1; - values[valuesById[2] = "MORE_RESULTS_AFTER_LIMIT"] = 2; - values[valuesById[4] = "MORE_RESULTS_AFTER_CURSOR"] = 4; - values[valuesById[3] = "NO_MORE_RESULTS"] = 3; - return values; - })(); - - return QueryResultBatch; + return Projection; })(); - v1.Datastore = (function() { + v1.PropertyOrder = (function() { /** - * Constructs a new Datastore service. + * Properties of a PropertyOrder. * @memberof google.datastore.v1 - * @classdesc Represents a Datastore - * @extends $protobuf.rpc.Service + * @interface IPropertyOrder + * @property {google.datastore.v1.IPropertyReference|null} [property] PropertyOrder property + * @property {google.datastore.v1.PropertyOrder.Direction|null} [direction] PropertyOrder direction + */ + + /** + * Constructs a new PropertyOrder. + * @memberof google.datastore.v1 + * @classdesc Represents a PropertyOrder. + * @implements IPropertyOrder * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.datastore.v1.IPropertyOrder=} [properties] Properties to set */ - function Datastore(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function PropertyOrder(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (Datastore.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Datastore; + /** + * PropertyOrder property. + * @member {google.datastore.v1.IPropertyReference|null|undefined} property + * @memberof google.datastore.v1.PropertyOrder + * @instance + */ + PropertyOrder.prototype.property = null; /** - * Creates new Datastore service using the specified rpc implementation. + * PropertyOrder direction. + * @member {google.datastore.v1.PropertyOrder.Direction} direction + * @memberof google.datastore.v1.PropertyOrder + * @instance + */ + PropertyOrder.prototype.direction = 0; + + /** + * Creates a new PropertyOrder instance using the specified properties. * @function create - * @memberof google.datastore.v1.Datastore + * @memberof google.datastore.v1.PropertyOrder * @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 {Datastore} RPC service. Useful where requests and/or responses are streamed. + * @param {google.datastore.v1.IPropertyOrder=} [properties] Properties to set + * @returns {google.datastore.v1.PropertyOrder} PropertyOrder instance */ - Datastore.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + PropertyOrder.create = function create(properties) { + return new PropertyOrder(properties); }; /** - * Callback as used by {@link google.datastore.v1.Datastore#lookup}. - * @memberof google.datastore.v1.Datastore - * @typedef LookupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.LookupResponse} [response] LookupResponse + * Encodes the specified PropertyOrder message. Does not implicitly {@link google.datastore.v1.PropertyOrder.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.PropertyOrder + * @static + * @param {google.datastore.v1.IPropertyOrder} message PropertyOrder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + PropertyOrder.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + $root.google.datastore.v1.PropertyReference.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.direction != null && Object.hasOwnProperty.call(message, "direction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); + return writer; + }; /** - * Calls Lookup. - * @function lookup - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.ILookupRequest} request LookupRequest message or plain object - * @param {google.datastore.v1.Datastore.LookupCallback} callback Node-style callback called with the error, if any, and LookupResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified PropertyOrder message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyOrder.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.PropertyOrder + * @static + * @param {google.datastore.v1.IPropertyOrder} message PropertyOrder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Datastore.prototype.lookup = function lookup(request, callback) { - return this.rpcCall(lookup, $root.google.datastore.v1.LookupRequest, $root.google.datastore.v1.LookupResponse, request, callback); - }, "name", { value: "Lookup" }); + PropertyOrder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls Lookup. - * @function lookup - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.ILookupRequest} request LookupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a PropertyOrder message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.PropertyOrder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.PropertyOrder} PropertyOrder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyOrder.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyOrder(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32()); + break; + case 2: + message.direction = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PropertyOrder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.PropertyOrder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.PropertyOrder} PropertyOrder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PropertyOrder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PropertyOrder message. + * @function verify + * @memberof google.datastore.v1.PropertyOrder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PropertyOrder.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.datastore.v1.PropertyReference.verify(message.property); + if (error) + return "property." + error; + } + if (message.direction != null && message.hasOwnProperty("direction")) + switch (message.direction) { + default: + return "direction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a PropertyOrder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.PropertyOrder + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.PropertyOrder} PropertyOrder */ + PropertyOrder.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.PropertyOrder) + return object; + var message = new $root.google.datastore.v1.PropertyOrder(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.datastore.v1.PropertyOrder.property: object expected"); + message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); + } + switch (object.direction) { + case "DIRECTION_UNSPECIFIED": + case 0: + message.direction = 0; + break; + case "ASCENDING": + case 1: + message.direction = 1; + break; + case "DESCENDING": + case 2: + message.direction = 2; + break; + } + return message; + }; /** - * Callback as used by {@link google.datastore.v1.Datastore#runQuery}. - * @memberof google.datastore.v1.Datastore - * @typedef RunQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.RunQueryResponse} [response] RunQueryResponse + * Creates a plain object from a PropertyOrder message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.PropertyOrder + * @static + * @param {google.datastore.v1.PropertyOrder} message PropertyOrder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + PropertyOrder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.property = null; + object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; + } + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); + if (message.direction != null && message.hasOwnProperty("direction")) + object.direction = options.enums === String ? $root.google.datastore.v1.PropertyOrder.Direction[message.direction] : message.direction; + return object; + }; /** - * Calls RunQuery. - * @function runQuery - * @memberof google.datastore.v1.Datastore + * Converts this PropertyOrder to JSON. + * @function toJSON + * @memberof google.datastore.v1.PropertyOrder * @instance - * @param {google.datastore.v1.IRunQueryRequest} request RunQueryRequest message or plain object - * @param {google.datastore.v1.Datastore.RunQueryCallback} callback Node-style callback called with the error, if any, and RunQueryResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(Datastore.prototype.runQuery = function runQuery(request, callback) { - return this.rpcCall(runQuery, $root.google.datastore.v1.RunQueryRequest, $root.google.datastore.v1.RunQueryResponse, request, callback); - }, "name", { value: "RunQuery" }); + PropertyOrder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls RunQuery. - * @function runQuery - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IRunQueryRequest} request RunQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Direction enum. + * @name google.datastore.v1.PropertyOrder.Direction + * @enum {number} + * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value + * @property {number} ASCENDING=1 ASCENDING value + * @property {number} DESCENDING=2 DESCENDING value */ + PropertyOrder.Direction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ASCENDING"] = 1; + values[valuesById[2] = "DESCENDING"] = 2; + return values; + })(); - /** - * Callback as used by {@link google.datastore.v1.Datastore#runAggregationQuery}. - * @memberof google.datastore.v1.Datastore - * @typedef RunAggregationQueryCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.RunAggregationQueryResponse} [response] RunAggregationQueryResponse - */ + return PropertyOrder; + })(); - /** - * Calls RunAggregationQuery. - * @function runAggregationQuery - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IRunAggregationQueryRequest} request RunAggregationQueryRequest message or plain object - * @param {google.datastore.v1.Datastore.RunAggregationQueryCallback} callback Node-style callback called with the error, if any, and RunAggregationQueryResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Datastore.prototype.runAggregationQuery = function runAggregationQuery(request, callback) { - return this.rpcCall(runAggregationQuery, $root.google.datastore.v1.RunAggregationQueryRequest, $root.google.datastore.v1.RunAggregationQueryResponse, request, callback); - }, "name", { value: "RunAggregationQuery" }); + v1.Filter = (function() { /** - * Calls RunAggregationQuery. - * @function runAggregationQuery - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IRunAggregationQueryRequest} request RunAggregationQueryRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a Filter. + * @memberof google.datastore.v1 + * @interface IFilter + * @property {google.datastore.v1.ICompositeFilter|null} [compositeFilter] Filter compositeFilter + * @property {google.datastore.v1.IPropertyFilter|null} [propertyFilter] Filter propertyFilter */ /** - * Callback as used by {@link google.datastore.v1.Datastore#beginTransaction}. - * @memberof google.datastore.v1.Datastore - * @typedef BeginTransactionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.BeginTransactionResponse} [response] BeginTransactionResponse + * Constructs a new Filter. + * @memberof google.datastore.v1 + * @classdesc Represents a Filter. + * @implements IFilter + * @constructor + * @param {google.datastore.v1.IFilter=} [properties] Properties to set */ + function Filter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls BeginTransaction. - * @function beginTransaction - * @memberof google.datastore.v1.Datastore + * Filter compositeFilter. + * @member {google.datastore.v1.ICompositeFilter|null|undefined} compositeFilter + * @memberof google.datastore.v1.Filter * @instance - * @param {google.datastore.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object - * @param {google.datastore.v1.Datastore.BeginTransactionCallback} callback Node-style callback called with the error, if any, and BeginTransactionResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Datastore.prototype.beginTransaction = function beginTransaction(request, callback) { - return this.rpcCall(beginTransaction, $root.google.datastore.v1.BeginTransactionRequest, $root.google.datastore.v1.BeginTransactionResponse, request, callback); - }, "name", { value: "BeginTransaction" }); + Filter.prototype.compositeFilter = null; /** - * Calls BeginTransaction. - * @function beginTransaction - * @memberof google.datastore.v1.Datastore + * Filter propertyFilter. + * @member {google.datastore.v1.IPropertyFilter|null|undefined} propertyFilter + * @memberof google.datastore.v1.Filter * @instance - * @param {google.datastore.v1.IBeginTransactionRequest} request BeginTransactionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.datastore.v1.Datastore#commit}. - * @memberof google.datastore.v1.Datastore - * @typedef CommitCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.CommitResponse} [response] CommitResponse */ + Filter.prototype.propertyFilter = null; - /** - * Calls Commit. - * @function commit - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.ICommitRequest} request CommitRequest message or plain object - * @param {google.datastore.v1.Datastore.CommitCallback} callback Node-style callback called with the error, if any, and CommitResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Datastore.prototype.commit = function commit(request, callback) { - return this.rpcCall(commit, $root.google.datastore.v1.CommitRequest, $root.google.datastore.v1.CommitResponse, request, callback); - }, "name", { value: "Commit" }); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls Commit. - * @function commit - * @memberof google.datastore.v1.Datastore + * Filter filterType. + * @member {"compositeFilter"|"propertyFilter"|undefined} filterType + * @memberof google.datastore.v1.Filter * @instance - * @param {google.datastore.v1.ICommitRequest} request CommitRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Object.defineProperty(Filter.prototype, "filterType", { + get: $util.oneOfGetter($oneOfFields = ["compositeFilter", "propertyFilter"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Callback as used by {@link google.datastore.v1.Datastore#rollback}. - * @memberof google.datastore.v1.Datastore - * @typedef RollbackCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.RollbackResponse} [response] RollbackResponse + * Creates a new Filter instance using the specified properties. + * @function create + * @memberof google.datastore.v1.Filter + * @static + * @param {google.datastore.v1.IFilter=} [properties] Properties to set + * @returns {google.datastore.v1.Filter} Filter instance */ + Filter.create = function create(properties) { + return new Filter(properties); + }; /** - * Calls Rollback. - * @function rollback - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IRollbackRequest} request RollbackRequest message or plain object - * @param {google.datastore.v1.Datastore.RollbackCallback} callback Node-style callback called with the error, if any, and RollbackResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified Filter message. Does not implicitly {@link google.datastore.v1.Filter.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.Filter + * @static + * @param {google.datastore.v1.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Datastore.prototype.rollback = function rollback(request, callback) { - return this.rpcCall(rollback, $root.google.datastore.v1.RollbackRequest, $root.google.datastore.v1.RollbackResponse, request, callback); - }, "name", { value: "Rollback" }); + Filter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.compositeFilter != null && Object.hasOwnProperty.call(message, "compositeFilter")) + $root.google.datastore.v1.CompositeFilter.encode(message.compositeFilter, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.propertyFilter != null && Object.hasOwnProperty.call(message, "propertyFilter")) + $root.google.datastore.v1.PropertyFilter.encode(message.propertyFilter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls Rollback. - * @function rollback - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IRollbackRequest} request RollbackRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.datastore.v1.Filter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.Filter + * @static + * @param {google.datastore.v1.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + Filter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.datastore.v1.Datastore#allocateIds}. - * @memberof google.datastore.v1.Datastore - * @typedef AllocateIdsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.AllocateIdsResponse} [response] AllocateIdsResponse + * Decodes a Filter message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + Filter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Filter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.compositeFilter = $root.google.datastore.v1.CompositeFilter.decode(reader, reader.uint32()); + break; + case 2: + message.propertyFilter = $root.google.datastore.v1.PropertyFilter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls AllocateIds. - * @function allocateIds - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IAllocateIdsRequest} request AllocateIdsRequest message or plain object - * @param {google.datastore.v1.Datastore.AllocateIdsCallback} callback Node-style callback called with the error, if any, and AllocateIdsResponse - * @returns {undefined} - * @variation 1 + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(Datastore.prototype.allocateIds = function allocateIds(request, callback) { - return this.rpcCall(allocateIds, $root.google.datastore.v1.AllocateIdsRequest, $root.google.datastore.v1.AllocateIdsResponse, request, callback); - }, "name", { value: "AllocateIds" }); + Filter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls AllocateIds. - * @function allocateIds - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IAllocateIdsRequest} request AllocateIdsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a Filter message. + * @function verify + * @memberof google.datastore.v1.Filter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + Filter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.compositeFilter != null && message.hasOwnProperty("compositeFilter")) { + properties.filterType = 1; + { + var error = $root.google.datastore.v1.CompositeFilter.verify(message.compositeFilter); + if (error) + return "compositeFilter." + error; + } + } + if (message.propertyFilter != null && message.hasOwnProperty("propertyFilter")) { + if (properties.filterType === 1) + return "filterType: multiple values"; + properties.filterType = 1; + { + var error = $root.google.datastore.v1.PropertyFilter.verify(message.propertyFilter); + if (error) + return "propertyFilter." + error; + } + } + return null; + }; /** - * Callback as used by {@link google.datastore.v1.Datastore#reserveIds}. - * @memberof google.datastore.v1.Datastore - * @typedef ReserveIdsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.v1.ReserveIdsResponse} [response] ReserveIdsResponse + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.Filter + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.Filter} Filter */ + Filter.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.Filter) + return object; + var message = new $root.google.datastore.v1.Filter(); + if (object.compositeFilter != null) { + if (typeof object.compositeFilter !== "object") + throw TypeError(".google.datastore.v1.Filter.compositeFilter: object expected"); + message.compositeFilter = $root.google.datastore.v1.CompositeFilter.fromObject(object.compositeFilter); + } + if (object.propertyFilter != null) { + if (typeof object.propertyFilter !== "object") + throw TypeError(".google.datastore.v1.Filter.propertyFilter: object expected"); + message.propertyFilter = $root.google.datastore.v1.PropertyFilter.fromObject(object.propertyFilter); + } + return message; + }; /** - * Calls ReserveIds. - * @function reserveIds - * @memberof google.datastore.v1.Datastore - * @instance - * @param {google.datastore.v1.IReserveIdsRequest} request ReserveIdsRequest message or plain object - * @param {google.datastore.v1.Datastore.ReserveIdsCallback} callback Node-style callback called with the error, if any, and ReserveIdsResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.Filter + * @static + * @param {google.datastore.v1.Filter} message Filter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(Datastore.prototype.reserveIds = function reserveIds(request, callback) { - return this.rpcCall(reserveIds, $root.google.datastore.v1.ReserveIdsRequest, $root.google.datastore.v1.ReserveIdsResponse, request, callback); - }, "name", { value: "ReserveIds" }); + Filter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.compositeFilter != null && message.hasOwnProperty("compositeFilter")) { + object.compositeFilter = $root.google.datastore.v1.CompositeFilter.toObject(message.compositeFilter, options); + if (options.oneofs) + object.filterType = "compositeFilter"; + } + if (message.propertyFilter != null && message.hasOwnProperty("propertyFilter")) { + object.propertyFilter = $root.google.datastore.v1.PropertyFilter.toObject(message.propertyFilter, options); + if (options.oneofs) + object.filterType = "propertyFilter"; + } + return object; + }; /** - * Calls ReserveIds. - * @function reserveIds - * @memberof google.datastore.v1.Datastore + * Converts this Filter to JSON. + * @function toJSON + * @memberof google.datastore.v1.Filter * @instance - * @param {google.datastore.v1.IReserveIdsRequest} request ReserveIdsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + Filter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Datastore; + return Filter; })(); - v1.LookupRequest = (function() { + v1.CompositeFilter = (function() { /** - * Properties of a LookupRequest. + * Properties of a CompositeFilter. * @memberof google.datastore.v1 - * @interface ILookupRequest - * @property {string|null} [projectId] LookupRequest projectId - * @property {string|null} [databaseId] LookupRequest databaseId - * @property {google.datastore.v1.IReadOptions|null} [readOptions] LookupRequest readOptions - * @property {Array.|null} [keys] LookupRequest keys + * @interface ICompositeFilter + * @property {google.datastore.v1.CompositeFilter.Operator|null} [op] CompositeFilter op + * @property {Array.|null} [filters] CompositeFilter filters */ /** - * Constructs a new LookupRequest. + * Constructs a new CompositeFilter. * @memberof google.datastore.v1 - * @classdesc Represents a LookupRequest. - * @implements ILookupRequest + * @classdesc Represents a CompositeFilter. + * @implements ICompositeFilter * @constructor - * @param {google.datastore.v1.ILookupRequest=} [properties] Properties to set + * @param {google.datastore.v1.ICompositeFilter=} [properties] Properties to set */ - function LookupRequest(properties) { - this.keys = []; + function CompositeFilter(properties) { + this.filters = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18917,117 +14752,91 @@ } /** - * LookupRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.LookupRequest - * @instance - */ - LookupRequest.prototype.projectId = ""; - - /** - * LookupRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.LookupRequest - * @instance - */ - LookupRequest.prototype.databaseId = ""; - - /** - * LookupRequest readOptions. - * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions - * @memberof google.datastore.v1.LookupRequest + * CompositeFilter op. + * @member {google.datastore.v1.CompositeFilter.Operator} op + * @memberof google.datastore.v1.CompositeFilter * @instance */ - LookupRequest.prototype.readOptions = null; + CompositeFilter.prototype.op = 0; /** - * LookupRequest keys. - * @member {Array.} keys - * @memberof google.datastore.v1.LookupRequest + * CompositeFilter filters. + * @member {Array.} filters + * @memberof google.datastore.v1.CompositeFilter * @instance */ - LookupRequest.prototype.keys = $util.emptyArray; + CompositeFilter.prototype.filters = $util.emptyArray; /** - * Creates a new LookupRequest instance using the specified properties. + * Creates a new CompositeFilter instance using the specified properties. * @function create - * @memberof google.datastore.v1.LookupRequest + * @memberof google.datastore.v1.CompositeFilter * @static - * @param {google.datastore.v1.ILookupRequest=} [properties] Properties to set - * @returns {google.datastore.v1.LookupRequest} LookupRequest instance + * @param {google.datastore.v1.ICompositeFilter=} [properties] Properties to set + * @returns {google.datastore.v1.CompositeFilter} CompositeFilter instance */ - LookupRequest.create = function create(properties) { - return new LookupRequest(properties); + CompositeFilter.create = function create(properties) { + return new CompositeFilter(properties); }; /** - * Encodes the specified LookupRequest message. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * Encodes the specified CompositeFilter message. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.LookupRequest + * @memberof google.datastore.v1.CompositeFilter * @static - * @param {google.datastore.v1.ILookupRequest} message LookupRequest message or plain object to encode + * @param {google.datastore.v1.ICompositeFilter} message CompositeFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LookupRequest.encode = function encode(message, writer) { + CompositeFilter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) - $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.keys != null && message.keys.length) - for (var i = 0; i < message.keys.length; ++i) - $root.google.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.op); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.datastore.v1.Filter.encode(message.filters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified LookupRequest message, length delimited. Does not implicitly {@link google.datastore.v1.LookupRequest.verify|verify} messages. + * Encodes the specified CompositeFilter message, length delimited. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.LookupRequest + * @memberof google.datastore.v1.CompositeFilter * @static - * @param {google.datastore.v1.ILookupRequest} message LookupRequest message or plain object to encode + * @param {google.datastore.v1.ICompositeFilter} message CompositeFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LookupRequest.encodeDelimited = function encodeDelimited(message, writer) { + CompositeFilter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LookupRequest message from the specified reader or buffer. + * Decodes a CompositeFilter message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.LookupRequest + * @memberof google.datastore.v1.CompositeFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.LookupRequest} LookupRequest + * @returns {google.datastore.v1.CompositeFilter} CompositeFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LookupRequest.decode = function decode(reader, length) { + CompositeFilter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 9: - message.databaseId = reader.string(); - break; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CompositeFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); + message.op = reader.int32(); break; - case 3: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + case 2: + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.datastore.v1.Filter.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -19038,161 +14847,162 @@ }; /** - * Decodes a LookupRequest message from the specified reader or buffer, length delimited. + * Decodes a CompositeFilter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.LookupRequest + * @memberof google.datastore.v1.CompositeFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.LookupRequest} LookupRequest + * @returns {google.datastore.v1.CompositeFilter} CompositeFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LookupRequest.decodeDelimited = function decodeDelimited(reader) { + CompositeFilter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LookupRequest message. + * Verifies a CompositeFilter message. * @function verify - * @memberof google.datastore.v1.LookupRequest + * @memberof google.datastore.v1.CompositeFilter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LookupRequest.verify = function verify(message) { + CompositeFilter.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.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); - if (error) - return "readOptions." + error; - } - 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.datastore.v1.Key.verify(message.keys[i]); + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 1: + break; + } + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.datastore.v1.Filter.verify(message.filters[i]); if (error) - return "keys." + error; + return "filters." + error; } } return null; }; /** - * Creates a LookupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompositeFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.LookupRequest + * @memberof google.datastore.v1.CompositeFilter * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.LookupRequest} LookupRequest + * @returns {google.datastore.v1.CompositeFilter} CompositeFilter */ - LookupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.LookupRequest) + CompositeFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.CompositeFilter) return object; - var message = new $root.google.datastore.v1.LookupRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.readOptions != null) { - if (typeof object.readOptions !== "object") - throw TypeError(".google.datastore.v1.LookupRequest.readOptions: object expected"); - message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); + var message = new $root.google.datastore.v1.CompositeFilter(); + switch (object.op) { + case "OPERATOR_UNSPECIFIED": + case 0: + message.op = 0; + break; + case "AND": + case 1: + message.op = 1; + break; } - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.datastore.v1.LookupRequest.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.datastore.v1.LookupRequest.keys: object expected"); - message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".google.datastore.v1.CompositeFilter.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".google.datastore.v1.CompositeFilter.filters: object expected"); + message.filters[i] = $root.google.datastore.v1.Filter.fromObject(object.filters[i]); } } return message; }; /** - * Creates a plain object from a LookupRequest message. Also converts values to other types if specified. + * Creates a plain object from a CompositeFilter message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.LookupRequest + * @memberof google.datastore.v1.CompositeFilter * @static - * @param {google.datastore.v1.LookupRequest} message LookupRequest + * @param {google.datastore.v1.CompositeFilter} message CompositeFilter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LookupRequest.toObject = function toObject(message, options) { + CompositeFilter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) { - object.readOptions = null; - object.projectId = ""; - object.databaseId = ""; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) - object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + object.filters = []; + if (options.defaults) + object.op = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; + if (message.op != null && message.hasOwnProperty("op")) + object.op = options.enums === String ? $root.google.datastore.v1.CompositeFilter.Operator[message.op] : message.op; + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.google.datastore.v1.Filter.toObject(message.filters[j], options); } - 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 LookupRequest to JSON. + * Converts this CompositeFilter to JSON. * @function toJSON - * @memberof google.datastore.v1.LookupRequest + * @memberof google.datastore.v1.CompositeFilter * @instance * @returns {Object.} JSON object */ - LookupRequest.prototype.toJSON = function toJSON() { + CompositeFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LookupRequest; + /** + * Operator enum. + * @name google.datastore.v1.CompositeFilter.Operator + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} AND=1 AND value + */ + CompositeFilter.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "AND"] = 1; + return values; + })(); + + return CompositeFilter; })(); - v1.LookupResponse = (function() { + v1.PropertyFilter = (function() { /** - * Properties of a LookupResponse. + * Properties of a PropertyFilter. * @memberof google.datastore.v1 - * @interface ILookupResponse - * @property {Array.|null} [found] LookupResponse found - * @property {Array.|null} [missing] LookupResponse missing - * @property {Array.|null} [deferred] LookupResponse deferred - * @property {google.protobuf.ITimestamp|null} [readTime] LookupResponse readTime + * @interface IPropertyFilter + * @property {google.datastore.v1.IPropertyReference|null} [property] PropertyFilter property + * @property {google.datastore.v1.PropertyFilter.Operator|null} [op] PropertyFilter op + * @property {google.datastore.v1.IValue|null} [value] PropertyFilter value */ /** - * Constructs a new LookupResponse. + * Constructs a new PropertyFilter. * @memberof google.datastore.v1 - * @classdesc Represents a LookupResponse. - * @implements ILookupResponse + * @classdesc Represents a PropertyFilter. + * @implements IPropertyFilter * @constructor - * @param {google.datastore.v1.ILookupResponse=} [properties] Properties to set + * @param {google.datastore.v1.IPropertyFilter=} [properties] Properties to set */ - function LookupResponse(properties) { - this.found = []; - this.missing = []; - this.deferred = []; + function PropertyFilter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19200,123 +15010,101 @@ } /** - * LookupResponse found. - * @member {Array.} found - * @memberof google.datastore.v1.LookupResponse - * @instance - */ - LookupResponse.prototype.found = $util.emptyArray; - - /** - * LookupResponse missing. - * @member {Array.} missing - * @memberof google.datastore.v1.LookupResponse + * PropertyFilter property. + * @member {google.datastore.v1.IPropertyReference|null|undefined} property + * @memberof google.datastore.v1.PropertyFilter * @instance */ - LookupResponse.prototype.missing = $util.emptyArray; + PropertyFilter.prototype.property = null; /** - * LookupResponse deferred. - * @member {Array.} deferred - * @memberof google.datastore.v1.LookupResponse + * PropertyFilter op. + * @member {google.datastore.v1.PropertyFilter.Operator} op + * @memberof google.datastore.v1.PropertyFilter * @instance */ - LookupResponse.prototype.deferred = $util.emptyArray; + PropertyFilter.prototype.op = 0; /** - * LookupResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.LookupResponse + * PropertyFilter value. + * @member {google.datastore.v1.IValue|null|undefined} value + * @memberof google.datastore.v1.PropertyFilter * @instance */ - LookupResponse.prototype.readTime = null; + PropertyFilter.prototype.value = null; /** - * Creates a new LookupResponse instance using the specified properties. + * Creates a new PropertyFilter instance using the specified properties. * @function create - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.PropertyFilter * @static - * @param {google.datastore.v1.ILookupResponse=} [properties] Properties to set - * @returns {google.datastore.v1.LookupResponse} LookupResponse instance + * @param {google.datastore.v1.IPropertyFilter=} [properties] Properties to set + * @returns {google.datastore.v1.PropertyFilter} PropertyFilter instance */ - LookupResponse.create = function create(properties) { - return new LookupResponse(properties); + PropertyFilter.create = function create(properties) { + return new PropertyFilter(properties); }; /** - * Encodes the specified LookupResponse message. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * Encodes the specified PropertyFilter message. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.PropertyFilter * @static - * @param {google.datastore.v1.ILookupResponse} message LookupResponse message or plain object to encode + * @param {google.datastore.v1.IPropertyFilter} message PropertyFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LookupResponse.encode = function encode(message, writer) { + PropertyFilter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.found != null && message.found.length) - for (var i = 0; i < message.found.length; ++i) - $root.google.datastore.v1.EntityResult.encode(message.found[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.missing != null && message.missing.length) - for (var i = 0; i < message.missing.length; ++i) - $root.google.datastore.v1.EntityResult.encode(message.missing[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.deferred != null && message.deferred.length) - for (var i = 0; i < message.deferred.length; ++i) - $root.google.datastore.v1.Key.encode(message.deferred[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.property != null && Object.hasOwnProperty.call(message, "property")) + $root.google.datastore.v1.PropertyReference.encode(message.property, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.op != null && Object.hasOwnProperty.call(message, "op")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.op); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.datastore.v1.Value.encode(message.value, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified LookupResponse message, length delimited. Does not implicitly {@link google.datastore.v1.LookupResponse.verify|verify} messages. + * Encodes the specified PropertyFilter message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.PropertyFilter * @static - * @param {google.datastore.v1.ILookupResponse} message LookupResponse message or plain object to encode + * @param {google.datastore.v1.IPropertyFilter} message PropertyFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LookupResponse.encodeDelimited = function encodeDelimited(message, writer) { + PropertyFilter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LookupResponse message from the specified reader or buffer. + * Decodes a PropertyFilter message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.PropertyFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.LookupResponse} LookupResponse + * @returns {google.datastore.v1.PropertyFilter} PropertyFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LookupResponse.decode = function decode(reader, length) { + PropertyFilter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyFilter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.found && message.found.length)) - message.found = []; - message.found.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); + message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32()); break; case 2: - if (!(message.missing && message.missing.length)) - message.missing = []; - message.missing.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); + message.op = reader.int32(); break; case 3: - if (!(message.deferred && message.deferred.length)) - message.deferred = []; - message.deferred.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); - break; - case 7: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.value = $root.google.datastore.v1.Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -19327,194 +15115,222 @@ }; /** - * Decodes a LookupResponse message from the specified reader or buffer, length delimited. + * Decodes a PropertyFilter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.PropertyFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.LookupResponse} LookupResponse + * @returns {google.datastore.v1.PropertyFilter} PropertyFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LookupResponse.decodeDelimited = function decodeDelimited(reader) { + PropertyFilter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LookupResponse message. + * Verifies a PropertyFilter message. * @function verify - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.PropertyFilter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LookupResponse.verify = function verify(message) { + PropertyFilter.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.found != null && message.hasOwnProperty("found")) { - if (!Array.isArray(message.found)) - return "found: array expected"; - for (var i = 0; i < message.found.length; ++i) { - var error = $root.google.datastore.v1.EntityResult.verify(message.found[i]); - if (error) - return "found." + error; - } - } - if (message.missing != null && message.hasOwnProperty("missing")) { - if (!Array.isArray(message.missing)) - return "missing: array expected"; - for (var i = 0; i < message.missing.length; ++i) { - var error = $root.google.datastore.v1.EntityResult.verify(message.missing[i]); - if (error) - return "missing." + error; - } + if (message.property != null && message.hasOwnProperty("property")) { + var error = $root.google.datastore.v1.PropertyReference.verify(message.property); + if (error) + return "property." + error; } - if (message.deferred != null && message.hasOwnProperty("deferred")) { - if (!Array.isArray(message.deferred)) - return "deferred: array expected"; - for (var i = 0; i < message.deferred.length; ++i) { - var error = $root.google.datastore.v1.Key.verify(message.deferred[i]); - if (error) - return "deferred." + error; + if (message.op != null && message.hasOwnProperty("op")) + switch (message.op) { + default: + return "op: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 9: + case 11: + case 13: + break; } - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.google.datastore.v1.Value.verify(message.value); if (error) - return "readTime." + error; + return "value." + error; } return null; }; /** - * Creates a LookupResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PropertyFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.PropertyFilter * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.LookupResponse} LookupResponse + * @returns {google.datastore.v1.PropertyFilter} PropertyFilter */ - LookupResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.LookupResponse) + PropertyFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.PropertyFilter) return object; - var message = new $root.google.datastore.v1.LookupResponse(); - if (object.found) { - if (!Array.isArray(object.found)) - throw TypeError(".google.datastore.v1.LookupResponse.found: array expected"); - message.found = []; - for (var i = 0; i < object.found.length; ++i) { - if (typeof object.found[i] !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.found: object expected"); - message.found[i] = $root.google.datastore.v1.EntityResult.fromObject(object.found[i]); - } - } - if (object.missing) { - if (!Array.isArray(object.missing)) - throw TypeError(".google.datastore.v1.LookupResponse.missing: array expected"); - message.missing = []; - for (var i = 0; i < object.missing.length; ++i) { - if (typeof object.missing[i] !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.missing: object expected"); - message.missing[i] = $root.google.datastore.v1.EntityResult.fromObject(object.missing[i]); - } + var message = new $root.google.datastore.v1.PropertyFilter(); + if (object.property != null) { + if (typeof object.property !== "object") + throw TypeError(".google.datastore.v1.PropertyFilter.property: object expected"); + message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); } - if (object.deferred) { - if (!Array.isArray(object.deferred)) - throw TypeError(".google.datastore.v1.LookupResponse.deferred: array expected"); - message.deferred = []; - for (var i = 0; i < object.deferred.length; ++i) { - if (typeof object.deferred[i] !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.deferred: object expected"); - message.deferred[i] = $root.google.datastore.v1.Key.fromObject(object.deferred[i]); - } + switch (object.op) { + case "OPERATOR_UNSPECIFIED": + case 0: + message.op = 0; + break; + case "LESS_THAN": + case 1: + message.op = 1; + break; + case "LESS_THAN_OR_EQUAL": + case 2: + message.op = 2; + break; + case "GREATER_THAN": + case 3: + message.op = 3; + break; + case "GREATER_THAN_OR_EQUAL": + case 4: + message.op = 4; + break; + case "EQUAL": + case 5: + message.op = 5; + break; + case "IN": + case 6: + message.op = 6; + break; + case "NOT_EQUAL": + case 9: + message.op = 9; + break; + case "HAS_ANCESTOR": + case 11: + message.op = 11; + break; + case "NOT_IN": + case 13: + message.op = 13; + break; } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.datastore.v1.PropertyFilter.value: object expected"); + message.value = $root.google.datastore.v1.Value.fromObject(object.value); } return message; }; /** - * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. + * Creates a plain object from a PropertyFilter message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.PropertyFilter * @static - * @param {google.datastore.v1.LookupResponse} message LookupResponse + * @param {google.datastore.v1.PropertyFilter} message PropertyFilter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LookupResponse.toObject = function toObject(message, options) { + PropertyFilter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.found = []; - object.missing = []; - object.deferred = []; - } - if (options.defaults) - object.readTime = null; - if (message.found && message.found.length) { - object.found = []; - for (var j = 0; j < message.found.length; ++j) - object.found[j] = $root.google.datastore.v1.EntityResult.toObject(message.found[j], options); - } - if (message.missing && message.missing.length) { - object.missing = []; - for (var j = 0; j < message.missing.length; ++j) - object.missing[j] = $root.google.datastore.v1.EntityResult.toObject(message.missing[j], options); - } - if (message.deferred && message.deferred.length) { - object.deferred = []; - for (var j = 0; j < message.deferred.length; ++j) - object.deferred[j] = $root.google.datastore.v1.Key.toObject(message.deferred[j], options); + if (options.defaults) { + object.property = null; + object.op = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; + object.value = null; } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (message.property != null && message.hasOwnProperty("property")) + object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); + if (message.op != null && message.hasOwnProperty("op")) + object.op = options.enums === String ? $root.google.datastore.v1.PropertyFilter.Operator[message.op] : message.op; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.google.datastore.v1.Value.toObject(message.value, options); return object; }; /** - * Converts this LookupResponse to JSON. + * Converts this PropertyFilter to JSON. * @function toJSON - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.PropertyFilter * @instance * @returns {Object.} JSON object */ - LookupResponse.prototype.toJSON = function toJSON() { + PropertyFilter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LookupResponse; + /** + * Operator enum. + * @name google.datastore.v1.PropertyFilter.Operator + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} LESS_THAN=1 LESS_THAN value + * @property {number} LESS_THAN_OR_EQUAL=2 LESS_THAN_OR_EQUAL value + * @property {number} GREATER_THAN=3 GREATER_THAN value + * @property {number} GREATER_THAN_OR_EQUAL=4 GREATER_THAN_OR_EQUAL value + * @property {number} EQUAL=5 EQUAL value + * @property {number} IN=6 IN value + * @property {number} NOT_EQUAL=9 NOT_EQUAL value + * @property {number} HAS_ANCESTOR=11 HAS_ANCESTOR value + * @property {number} NOT_IN=13 NOT_IN value + */ + PropertyFilter.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "LESS_THAN"] = 1; + values[valuesById[2] = "LESS_THAN_OR_EQUAL"] = 2; + values[valuesById[3] = "GREATER_THAN"] = 3; + values[valuesById[4] = "GREATER_THAN_OR_EQUAL"] = 4; + values[valuesById[5] = "EQUAL"] = 5; + values[valuesById[6] = "IN"] = 6; + values[valuesById[9] = "NOT_EQUAL"] = 9; + values[valuesById[11] = "HAS_ANCESTOR"] = 11; + values[valuesById[13] = "NOT_IN"] = 13; + return values; + })(); + + return PropertyFilter; })(); - v1.RunQueryRequest = (function() { + v1.GqlQuery = (function() { /** - * Properties of a RunQueryRequest. + * Properties of a GqlQuery. * @memberof google.datastore.v1 - * @interface IRunQueryRequest - * @property {string|null} [projectId] RunQueryRequest projectId - * @property {string|null} [databaseId] RunQueryRequest databaseId - * @property {google.datastore.v1.IPartitionId|null} [partitionId] RunQueryRequest partitionId - * @property {google.datastore.v1.IReadOptions|null} [readOptions] RunQueryRequest readOptions - * @property {google.datastore.v1.IQuery|null} [query] RunQueryRequest query - * @property {google.datastore.v1.IGqlQuery|null} [gqlQuery] RunQueryRequest gqlQuery + * @interface IGqlQuery + * @property {string|null} [queryString] GqlQuery queryString + * @property {boolean|null} [allowLiterals] GqlQuery allowLiterals + * @property {Object.|null} [namedBindings] GqlQuery namedBindings + * @property {Array.|null} [positionalBindings] GqlQuery positionalBindings */ /** - * Constructs a new RunQueryRequest. + * Constructs a new GqlQuery. * @memberof google.datastore.v1 - * @classdesc Represents a RunQueryRequest. - * @implements IRunQueryRequest + * @classdesc Represents a GqlQuery. + * @implements IGqlQuery * @constructor - * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set + * @param {google.datastore.v1.IGqlQuery=} [properties] Properties to set */ - function RunQueryRequest(properties) { + function GqlQuery(properties) { + this.namedBindings = {}; + this.positionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19522,154 +15338,139 @@ } /** - * RunQueryRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.projectId = ""; - - /** - * RunQueryRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.databaseId = ""; - - /** - * RunQueryRequest partitionId. - * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.partitionId = null; - - /** - * RunQueryRequest readOptions. - * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions - * @memberof google.datastore.v1.RunQueryRequest + * GqlQuery queryString. + * @member {string} queryString + * @memberof google.datastore.v1.GqlQuery * @instance */ - RunQueryRequest.prototype.readOptions = null; + GqlQuery.prototype.queryString = ""; /** - * RunQueryRequest query. - * @member {google.datastore.v1.IQuery|null|undefined} query - * @memberof google.datastore.v1.RunQueryRequest + * GqlQuery allowLiterals. + * @member {boolean} allowLiterals + * @memberof google.datastore.v1.GqlQuery * @instance */ - RunQueryRequest.prototype.query = null; + GqlQuery.prototype.allowLiterals = false; /** - * RunQueryRequest gqlQuery. - * @member {google.datastore.v1.IGqlQuery|null|undefined} gqlQuery - * @memberof google.datastore.v1.RunQueryRequest + * GqlQuery namedBindings. + * @member {Object.} namedBindings + * @memberof google.datastore.v1.GqlQuery * @instance */ - RunQueryRequest.prototype.gqlQuery = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + GqlQuery.prototype.namedBindings = $util.emptyObject; /** - * RunQueryRequest queryType. - * @member {"query"|"gqlQuery"|undefined} queryType - * @memberof google.datastore.v1.RunQueryRequest + * GqlQuery positionalBindings. + * @member {Array.} positionalBindings + * @memberof google.datastore.v1.GqlQuery * @instance */ - Object.defineProperty(RunQueryRequest.prototype, "queryType", { - get: $util.oneOfGetter($oneOfFields = ["query", "gqlQuery"]), - set: $util.oneOfSetter($oneOfFields) - }); + GqlQuery.prototype.positionalBindings = $util.emptyArray; /** - * Creates a new RunQueryRequest instance using the specified properties. + * Creates a new GqlQuery instance using the specified properties. * @function create - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.GqlQuery * @static - * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest instance + * @param {google.datastore.v1.IGqlQuery=} [properties] Properties to set + * @returns {google.datastore.v1.GqlQuery} GqlQuery instance */ - RunQueryRequest.create = function create(properties) { - return new RunQueryRequest(properties); + GqlQuery.create = function create(properties) { + return new GqlQuery(properties); }; /** - * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * Encodes the specified GqlQuery message. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.GqlQuery * @static - * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {google.datastore.v1.IGqlQuery} message GqlQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunQueryRequest.encode = function encode(message, writer) { + GqlQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) - $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) - $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.gqlQuery != null && Object.hasOwnProperty.call(message, "gqlQuery")) - $root.google.datastore.v1.GqlQuery.encode(message.gqlQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + if (message.queryString != null && Object.hasOwnProperty.call(message, "queryString")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryString); + if (message.allowLiterals != null && Object.hasOwnProperty.call(message, "allowLiterals")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowLiterals); + if (message.positionalBindings != null && message.positionalBindings.length) + for (var i = 0; i < message.positionalBindings.length; ++i) + $root.google.datastore.v1.GqlQueryParameter.encode(message.positionalBindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.namedBindings != null && Object.hasOwnProperty.call(message, "namedBindings")) + for (var keys = Object.keys(message.namedBindings), 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.datastore.v1.GqlQueryParameter.encode(message.namedBindings[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * Encodes the specified GqlQuery message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.GqlQuery * @static - * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {google.datastore.v1.IGqlQuery} message GqlQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + GqlQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunQueryRequest message from the specified reader or buffer. + * Decodes a GqlQuery message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.GqlQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + * @returns {google.datastore.v1.GqlQuery} GqlQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunQueryRequest.decode = function decode(reader, length) { + GqlQuery.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.GqlQuery(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 9: - message.databaseId = reader.string(); + case 1: + message.queryString = reader.string(); break; case 2: - message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); - break; - case 1: - message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); + message.allowLiterals = reader.bool(); break; - case 3: - message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); + case 5: + if (message.namedBindings === $util.emptyObject) + message.namedBindings = {}; + 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.datastore.v1.GqlQueryParameter.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.namedBindings[key] = value; break; - case 7: - message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32()); + case 4: + if (!(message.positionalBindings && message.positionalBindings.length)) + message.positionalBindings = []; + message.positionalBindings.push($root.google.datastore.v1.GqlQueryParameter.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -19680,182 +15481,171 @@ }; /** - * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. + * Decodes a GqlQuery message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.GqlQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + * @returns {google.datastore.v1.GqlQuery} GqlQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunQueryRequest.decodeDelimited = function decodeDelimited(reader) { + GqlQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunQueryRequest message. + * Verifies a GqlQuery message. * @function verify - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.GqlQuery * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunQueryRequest.verify = function verify(message) { + GqlQuery.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.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.partitionId != null && message.hasOwnProperty("partitionId")) { - var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); - if (error) - return "partitionId." + error; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); - if (error) - return "readOptions." + error; - } - if (message.query != null && message.hasOwnProperty("query")) { - properties.queryType = 1; - { - var error = $root.google.datastore.v1.Query.verify(message.query); + if (message.queryString != null && message.hasOwnProperty("queryString")) + if (!$util.isString(message.queryString)) + return "queryString: string expected"; + if (message.allowLiterals != null && message.hasOwnProperty("allowLiterals")) + if (typeof message.allowLiterals !== "boolean") + return "allowLiterals: boolean expected"; + if (message.namedBindings != null && message.hasOwnProperty("namedBindings")) { + if (!$util.isObject(message.namedBindings)) + return "namedBindings: object expected"; + var key = Object.keys(message.namedBindings); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.datastore.v1.GqlQueryParameter.verify(message.namedBindings[key[i]]); if (error) - return "query." + error; + return "namedBindings." + error; } } - if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { - if (properties.queryType === 1) - return "queryType: multiple values"; - properties.queryType = 1; - { - var error = $root.google.datastore.v1.GqlQuery.verify(message.gqlQuery); + if (message.positionalBindings != null && message.hasOwnProperty("positionalBindings")) { + if (!Array.isArray(message.positionalBindings)) + return "positionalBindings: array expected"; + for (var i = 0; i < message.positionalBindings.length; ++i) { + var error = $root.google.datastore.v1.GqlQueryParameter.verify(message.positionalBindings[i]); if (error) - return "gqlQuery." + error; + return "positionalBindings." + error; } } return null; }; /** - * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GqlQuery message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.GqlQuery * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + * @returns {google.datastore.v1.GqlQuery} GqlQuery */ - RunQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RunQueryRequest) + GqlQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.GqlQuery) return object; - var message = new $root.google.datastore.v1.RunQueryRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.partitionId != null) { - if (typeof object.partitionId !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.partitionId: object expected"); - message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); - } - if (object.readOptions != null) { - if (typeof object.readOptions !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.readOptions: object expected"); - message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.query: object expected"); - message.query = $root.google.datastore.v1.Query.fromObject(object.query); + var message = new $root.google.datastore.v1.GqlQuery(); + if (object.queryString != null) + message.queryString = String(object.queryString); + if (object.allowLiterals != null) + message.allowLiterals = Boolean(object.allowLiterals); + if (object.namedBindings) { + if (typeof object.namedBindings !== "object") + throw TypeError(".google.datastore.v1.GqlQuery.namedBindings: object expected"); + message.namedBindings = {}; + for (var keys = Object.keys(object.namedBindings), i = 0; i < keys.length; ++i) { + if (typeof object.namedBindings[keys[i]] !== "object") + throw TypeError(".google.datastore.v1.GqlQuery.namedBindings: object expected"); + message.namedBindings[keys[i]] = $root.google.datastore.v1.GqlQueryParameter.fromObject(object.namedBindings[keys[i]]); + } } - if (object.gqlQuery != null) { - if (typeof object.gqlQuery !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.gqlQuery: object expected"); - message.gqlQuery = $root.google.datastore.v1.GqlQuery.fromObject(object.gqlQuery); + if (object.positionalBindings) { + if (!Array.isArray(object.positionalBindings)) + throw TypeError(".google.datastore.v1.GqlQuery.positionalBindings: array expected"); + message.positionalBindings = []; + for (var i = 0; i < object.positionalBindings.length; ++i) { + if (typeof object.positionalBindings[i] !== "object") + throw TypeError(".google.datastore.v1.GqlQuery.positionalBindings: object expected"); + message.positionalBindings[i] = $root.google.datastore.v1.GqlQueryParameter.fromObject(object.positionalBindings[i]); + } } return message; }; /** - * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. + * Creates a plain object from a GqlQuery message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.GqlQuery * @static - * @param {google.datastore.v1.RunQueryRequest} message RunQueryRequest + * @param {google.datastore.v1.GqlQuery} message GqlQuery * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunQueryRequest.toObject = function toObject(message, options) { + GqlQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.positionalBindings = []; + if (options.objects || options.defaults) + object.namedBindings = {}; if (options.defaults) { - object.readOptions = null; - object.partitionId = null; - object.projectId = ""; - object.databaseId = ""; + object.queryString = ""; + object.allowLiterals = false; } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) - object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); - if (message.partitionId != null && message.hasOwnProperty("partitionId")) - object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); - if (message.query != null && message.hasOwnProperty("query")) { - object.query = $root.google.datastore.v1.Query.toObject(message.query, options); - if (options.oneofs) - object.queryType = "query"; + if (message.queryString != null && message.hasOwnProperty("queryString")) + object.queryString = message.queryString; + if (message.allowLiterals != null && message.hasOwnProperty("allowLiterals")) + object.allowLiterals = message.allowLiterals; + if (message.positionalBindings && message.positionalBindings.length) { + object.positionalBindings = []; + for (var j = 0; j < message.positionalBindings.length; ++j) + object.positionalBindings[j] = $root.google.datastore.v1.GqlQueryParameter.toObject(message.positionalBindings[j], options); } - if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { - object.gqlQuery = $root.google.datastore.v1.GqlQuery.toObject(message.gqlQuery, options); - if (options.oneofs) - object.queryType = "gqlQuery"; + var keys2; + if (message.namedBindings && (keys2 = Object.keys(message.namedBindings)).length) { + object.namedBindings = {}; + for (var j = 0; j < keys2.length; ++j) + object.namedBindings[keys2[j]] = $root.google.datastore.v1.GqlQueryParameter.toObject(message.namedBindings[keys2[j]], options); } - 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 RunQueryRequest to JSON. + * Converts this GqlQuery to JSON. * @function toJSON - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.GqlQuery * @instance * @returns {Object.} JSON object */ - RunQueryRequest.prototype.toJSON = function toJSON() { + GqlQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RunQueryRequest; + return GqlQuery; })(); - v1.RunQueryResponse = (function() { + v1.GqlQueryParameter = (function() { /** - * Properties of a RunQueryResponse. + * Properties of a GqlQueryParameter. * @memberof google.datastore.v1 - * @interface IRunQueryResponse - * @property {google.datastore.v1.IQueryResultBatch|null} [batch] RunQueryResponse batch - * @property {google.datastore.v1.IQuery|null} [query] RunQueryResponse query + * @interface IGqlQueryParameter + * @property {google.datastore.v1.IValue|null} [value] GqlQueryParameter value + * @property {Uint8Array|null} [cursor] GqlQueryParameter cursor */ /** - * Constructs a new RunQueryResponse. + * Constructs a new GqlQueryParameter. * @memberof google.datastore.v1 - * @classdesc Represents a RunQueryResponse. - * @implements IRunQueryResponse + * @classdesc Represents a GqlQueryParameter. + * @implements IGqlQueryParameter * @constructor - * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set + * @param {google.datastore.v1.IGqlQueryParameter=} [properties] Properties to set */ - function RunQueryResponse(properties) { + function GqlQueryParameter(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -19863,88 +15653,102 @@ } /** - * RunQueryResponse batch. - * @member {google.datastore.v1.IQueryResultBatch|null|undefined} batch - * @memberof google.datastore.v1.RunQueryResponse + * GqlQueryParameter value. + * @member {google.datastore.v1.IValue|null|undefined} value + * @memberof google.datastore.v1.GqlQueryParameter * @instance */ - RunQueryResponse.prototype.batch = null; + GqlQueryParameter.prototype.value = null; /** - * RunQueryResponse query. - * @member {google.datastore.v1.IQuery|null|undefined} query - * @memberof google.datastore.v1.RunQueryResponse + * GqlQueryParameter cursor. + * @member {Uint8Array|null|undefined} cursor + * @memberof google.datastore.v1.GqlQueryParameter * @instance */ - RunQueryResponse.prototype.query = null; + GqlQueryParameter.prototype.cursor = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new RunQueryResponse instance using the specified properties. + * GqlQueryParameter parameterType. + * @member {"value"|"cursor"|undefined} parameterType + * @memberof google.datastore.v1.GqlQueryParameter + * @instance + */ + Object.defineProperty(GqlQueryParameter.prototype, "parameterType", { + get: $util.oneOfGetter($oneOfFields = ["value", "cursor"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GqlQueryParameter instance using the specified properties. * @function create - * @memberof google.datastore.v1.RunQueryResponse + * @memberof google.datastore.v1.GqlQueryParameter * @static - * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse instance + * @param {google.datastore.v1.IGqlQueryParameter=} [properties] Properties to set + * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter instance */ - RunQueryResponse.create = function create(properties) { - return new RunQueryResponse(properties); + GqlQueryParameter.create = function create(properties) { + return new GqlQueryParameter(properties); }; /** - * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * Encodes the specified GqlQueryParameter message. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.RunQueryResponse + * @memberof google.datastore.v1.GqlQueryParameter * @static - * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {google.datastore.v1.IGqlQueryParameter} message GqlQueryParameter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunQueryResponse.encode = function encode(message, writer) { + GqlQueryParameter.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) - $root.google.datastore.v1.QueryResultBatch.encode(message.batch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.google.datastore.v1.Value.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cursor != null && Object.hasOwnProperty.call(message, "cursor")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.cursor); return writer; }; /** - * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * Encodes the specified GqlQueryParameter message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.RunQueryResponse + * @memberof google.datastore.v1.GqlQueryParameter * @static - * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {google.datastore.v1.IGqlQueryParameter} message GqlQueryParameter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + GqlQueryParameter.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunQueryResponse message from the specified reader or buffer. + * Decodes a GqlQueryParameter message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.RunQueryResponse + * @memberof google.datastore.v1.GqlQueryParameter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunQueryResponse.decode = function decode(reader, length) { + GqlQueryParameter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.GqlQueryParameter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.batch = $root.google.datastore.v1.QueryResultBatch.decode(reader, reader.uint32()); - break; case 2: - message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); + message.value = $root.google.datastore.v1.Value.decode(reader, reader.uint32()); + break; + case 3: + message.cursor = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -19955,131 +15759,142 @@ }; /** - * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. + * Decodes a GqlQueryParameter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.RunQueryResponse + * @memberof google.datastore.v1.GqlQueryParameter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunQueryResponse.decodeDelimited = function decodeDelimited(reader) { + GqlQueryParameter.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunQueryResponse message. + * Verifies a GqlQueryParameter message. * @function verify - * @memberof google.datastore.v1.RunQueryResponse + * @memberof google.datastore.v1.GqlQueryParameter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunQueryResponse.verify = function verify(message) { + GqlQueryParameter.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.batch != null && message.hasOwnProperty("batch")) { - var error = $root.google.datastore.v1.QueryResultBatch.verify(message.batch); - if (error) - return "batch." + error; + var properties = {}; + if (message.value != null && message.hasOwnProperty("value")) { + properties.parameterType = 1; + { + var error = $root.google.datastore.v1.Value.verify(message.value); + if (error) + return "value." + error; + } } - if (message.query != null && message.hasOwnProperty("query")) { - var error = $root.google.datastore.v1.Query.verify(message.query); - if (error) - return "query." + error; + if (message.cursor != null && message.hasOwnProperty("cursor")) { + if (properties.parameterType === 1) + return "parameterType: multiple values"; + properties.parameterType = 1; + if (!(message.cursor && typeof message.cursor.length === "number" || $util.isString(message.cursor))) + return "cursor: buffer expected"; } return null; }; /** - * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GqlQueryParameter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.RunQueryResponse + * @memberof google.datastore.v1.GqlQueryParameter * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter */ - RunQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RunQueryResponse) + GqlQueryParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.GqlQueryParameter) return object; - var message = new $root.google.datastore.v1.RunQueryResponse(); - if (object.batch != null) { - if (typeof object.batch !== "object") - throw TypeError(".google.datastore.v1.RunQueryResponse.batch: object expected"); - message.batch = $root.google.datastore.v1.QueryResultBatch.fromObject(object.batch); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.datastore.v1.RunQueryResponse.query: object expected"); - message.query = $root.google.datastore.v1.Query.fromObject(object.query); + var message = new $root.google.datastore.v1.GqlQueryParameter(); + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".google.datastore.v1.GqlQueryParameter.value: object expected"); + message.value = $root.google.datastore.v1.Value.fromObject(object.value); } + if (object.cursor != null) + if (typeof object.cursor === "string") + $util.base64.decode(object.cursor, message.cursor = $util.newBuffer($util.base64.length(object.cursor)), 0); + else if (object.cursor.length) + message.cursor = object.cursor; return message; }; /** - * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. + * Creates a plain object from a GqlQueryParameter message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.RunQueryResponse + * @memberof google.datastore.v1.GqlQueryParameter * @static - * @param {google.datastore.v1.RunQueryResponse} message RunQueryResponse + * @param {google.datastore.v1.GqlQueryParameter} message GqlQueryParameter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunQueryResponse.toObject = function toObject(message, options) { + GqlQueryParameter.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.batch = null; - object.query = null; + if (message.value != null && message.hasOwnProperty("value")) { + object.value = $root.google.datastore.v1.Value.toObject(message.value, options); + if (options.oneofs) + object.parameterType = "value"; + } + if (message.cursor != null && message.hasOwnProperty("cursor")) { + object.cursor = options.bytes === String ? $util.base64.encode(message.cursor, 0, message.cursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.cursor) : message.cursor; + if (options.oneofs) + object.parameterType = "cursor"; } - if (message.batch != null && message.hasOwnProperty("batch")) - object.batch = $root.google.datastore.v1.QueryResultBatch.toObject(message.batch, options); - if (message.query != null && message.hasOwnProperty("query")) - object.query = $root.google.datastore.v1.Query.toObject(message.query, options); return object; }; /** - * Converts this RunQueryResponse to JSON. + * Converts this GqlQueryParameter to JSON. * @function toJSON - * @memberof google.datastore.v1.RunQueryResponse + * @memberof google.datastore.v1.GqlQueryParameter * @instance * @returns {Object.} JSON object */ - RunQueryResponse.prototype.toJSON = function toJSON() { + GqlQueryParameter.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RunQueryResponse; + return GqlQueryParameter; })(); - v1.RunAggregationQueryRequest = (function() { + v1.QueryResultBatch = (function() { /** - * Properties of a RunAggregationQueryRequest. + * Properties of a QueryResultBatch. * @memberof google.datastore.v1 - * @interface IRunAggregationQueryRequest - * @property {string|null} [projectId] RunAggregationQueryRequest projectId - * @property {string|null} [databaseId] RunAggregationQueryRequest databaseId - * @property {google.datastore.v1.IPartitionId|null} [partitionId] RunAggregationQueryRequest partitionId - * @property {google.datastore.v1.IReadOptions|null} [readOptions] RunAggregationQueryRequest readOptions - * @property {google.datastore.v1.IAggregationQuery|null} [aggregationQuery] RunAggregationQueryRequest aggregationQuery - * @property {google.datastore.v1.IGqlQuery|null} [gqlQuery] RunAggregationQueryRequest gqlQuery + * @interface IQueryResultBatch + * @property {number|null} [skippedResults] QueryResultBatch skippedResults + * @property {Uint8Array|null} [skippedCursor] QueryResultBatch skippedCursor + * @property {google.datastore.v1.EntityResult.ResultType|null} [entityResultType] QueryResultBatch entityResultType + * @property {Array.|null} [entityResults] QueryResultBatch entityResults + * @property {Uint8Array|null} [endCursor] QueryResultBatch endCursor + * @property {google.datastore.v1.QueryResultBatch.MoreResultsType|null} [moreResults] QueryResultBatch moreResults + * @property {number|Long|null} [snapshotVersion] QueryResultBatch snapshotVersion + * @property {google.protobuf.ITimestamp|null} [readTime] QueryResultBatch readTime */ /** - * Constructs a new RunAggregationQueryRequest. + * Constructs a new QueryResultBatch. * @memberof google.datastore.v1 - * @classdesc Represents a RunAggregationQueryRequest. - * @implements IRunAggregationQueryRequest + * @classdesc Represents a QueryResultBatch. + * @implements IQueryResultBatch * @constructor - * @param {google.datastore.v1.IRunAggregationQueryRequest=} [properties] Properties to set + * @param {google.datastore.v1.IQueryResultBatch=} [properties] Properties to set */ - function RunAggregationQueryRequest(properties) { + function QueryResultBatch(properties) { + this.entityResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -20087,154 +15902,169 @@ } /** - * RunAggregationQueryRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.RunAggregationQueryRequest + * QueryResultBatch skippedResults. + * @member {number} skippedResults + * @memberof google.datastore.v1.QueryResultBatch * @instance */ - RunAggregationQueryRequest.prototype.projectId = ""; + QueryResultBatch.prototype.skippedResults = 0; /** - * RunAggregationQueryRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.RunAggregationQueryRequest + * QueryResultBatch skippedCursor. + * @member {Uint8Array} skippedCursor + * @memberof google.datastore.v1.QueryResultBatch * @instance */ - RunAggregationQueryRequest.prototype.databaseId = ""; + QueryResultBatch.prototype.skippedCursor = $util.newBuffer([]); /** - * RunAggregationQueryRequest partitionId. - * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId - * @memberof google.datastore.v1.RunAggregationQueryRequest + * QueryResultBatch entityResultType. + * @member {google.datastore.v1.EntityResult.ResultType} entityResultType + * @memberof google.datastore.v1.QueryResultBatch * @instance */ - RunAggregationQueryRequest.prototype.partitionId = null; + QueryResultBatch.prototype.entityResultType = 0; /** - * RunAggregationQueryRequest readOptions. - * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions - * @memberof google.datastore.v1.RunAggregationQueryRequest + * QueryResultBatch entityResults. + * @member {Array.} entityResults + * @memberof google.datastore.v1.QueryResultBatch * @instance */ - RunAggregationQueryRequest.prototype.readOptions = null; + QueryResultBatch.prototype.entityResults = $util.emptyArray; /** - * RunAggregationQueryRequest aggregationQuery. - * @member {google.datastore.v1.IAggregationQuery|null|undefined} aggregationQuery - * @memberof google.datastore.v1.RunAggregationQueryRequest + * QueryResultBatch endCursor. + * @member {Uint8Array} endCursor + * @memberof google.datastore.v1.QueryResultBatch * @instance */ - RunAggregationQueryRequest.prototype.aggregationQuery = null; + QueryResultBatch.prototype.endCursor = $util.newBuffer([]); /** - * RunAggregationQueryRequest gqlQuery. - * @member {google.datastore.v1.IGqlQuery|null|undefined} gqlQuery - * @memberof google.datastore.v1.RunAggregationQueryRequest + * QueryResultBatch moreResults. + * @member {google.datastore.v1.QueryResultBatch.MoreResultsType} moreResults + * @memberof google.datastore.v1.QueryResultBatch * @instance */ - RunAggregationQueryRequest.prototype.gqlQuery = null; + QueryResultBatch.prototype.moreResults = 0; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * QueryResultBatch snapshotVersion. + * @member {number|Long} snapshotVersion + * @memberof google.datastore.v1.QueryResultBatch + * @instance + */ + QueryResultBatch.prototype.snapshotVersion = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * RunAggregationQueryRequest queryType. - * @member {"aggregationQuery"|"gqlQuery"|undefined} queryType - * @memberof google.datastore.v1.RunAggregationQueryRequest + * QueryResultBatch readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.QueryResultBatch * @instance */ - Object.defineProperty(RunAggregationQueryRequest.prototype, "queryType", { - get: $util.oneOfGetter($oneOfFields = ["aggregationQuery", "gqlQuery"]), - set: $util.oneOfSetter($oneOfFields) - }); + QueryResultBatch.prototype.readTime = null; /** - * Creates a new RunAggregationQueryRequest instance using the specified properties. + * Creates a new QueryResultBatch instance using the specified properties. * @function create - * @memberof google.datastore.v1.RunAggregationQueryRequest + * @memberof google.datastore.v1.QueryResultBatch * @static - * @param {google.datastore.v1.IRunAggregationQueryRequest=} [properties] Properties to set - * @returns {google.datastore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest instance + * @param {google.datastore.v1.IQueryResultBatch=} [properties] Properties to set + * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch instance */ - RunAggregationQueryRequest.create = function create(properties) { - return new RunAggregationQueryRequest(properties); + QueryResultBatch.create = function create(properties) { + return new QueryResultBatch(properties); }; /** - * Encodes the specified RunAggregationQueryRequest message. Does not implicitly {@link google.datastore.v1.RunAggregationQueryRequest.verify|verify} messages. + * Encodes the specified QueryResultBatch message. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.RunAggregationQueryRequest + * @memberof google.datastore.v1.QueryResultBatch * @static - * @param {google.datastore.v1.IRunAggregationQueryRequest} message RunAggregationQueryRequest message or plain object to encode + * @param {google.datastore.v1.IQueryResultBatch} message QueryResultBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAggregationQueryRequest.encode = function encode(message, writer) { + QueryResultBatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) - $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) - $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.aggregationQuery != null && Object.hasOwnProperty.call(message, "aggregationQuery")) - $root.google.datastore.v1.AggregationQuery.encode(message.aggregationQuery, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.gqlQuery != null && Object.hasOwnProperty.call(message, "gqlQuery")) - $root.google.datastore.v1.GqlQuery.encode(message.gqlQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + if (message.entityResultType != null && Object.hasOwnProperty.call(message, "entityResultType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.entityResultType); + if (message.entityResults != null && message.entityResults.length) + for (var i = 0; i < message.entityResults.length; ++i) + $root.google.datastore.v1.EntityResult.encode(message.entityResults[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.skippedCursor != null && Object.hasOwnProperty.call(message, "skippedCursor")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.skippedCursor); + if (message.endCursor != null && Object.hasOwnProperty.call(message, "endCursor")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.endCursor); + if (message.moreResults != null && Object.hasOwnProperty.call(message, "moreResults")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.moreResults); + if (message.skippedResults != null && Object.hasOwnProperty.call(message, "skippedResults")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.skippedResults); + if (message.snapshotVersion != null && Object.hasOwnProperty.call(message, "snapshotVersion")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.snapshotVersion); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified RunAggregationQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunAggregationQueryRequest.verify|verify} messages. + * Encodes the specified QueryResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.RunAggregationQueryRequest + * @memberof google.datastore.v1.QueryResultBatch * @static - * @param {google.datastore.v1.IRunAggregationQueryRequest} message RunAggregationQueryRequest message or plain object to encode + * @param {google.datastore.v1.IQueryResultBatch} message QueryResultBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunAggregationQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { + QueryResultBatch.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunAggregationQueryRequest message from the specified reader or buffer. + * Decodes a QueryResultBatch message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.RunAggregationQueryRequest + * @memberof google.datastore.v1.QueryResultBatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest + * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAggregationQueryRequest.decode = function decode(reader, length) { + QueryResultBatch.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunAggregationQueryRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.QueryResultBatch(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); + case 6: + message.skippedResults = reader.int32(); break; - case 9: - message.databaseId = reader.string(); + case 3: + message.skippedCursor = reader.bytes(); + break; + case 1: + message.entityResultType = reader.int32(); break; case 2: - message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); + if (!(message.entityResults && message.entityResults.length)) + message.entityResults = []; + message.entityResults.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); break; - case 1: - message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); + case 4: + message.endCursor = reader.bytes(); break; - case 3: - message.aggregationQuery = $root.google.datastore.v1.AggregationQuery.decode(reader, reader.uint32()); + case 5: + message.moreResults = reader.int32(); break; case 7: - message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32()); + message.snapshotVersion = reader.int64(); + break; + case 8: + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -20245,2103 +16075,2594 @@ }; /** - * Decodes a RunAggregationQueryRequest message from the specified reader or buffer, length delimited. + * Decodes a QueryResultBatch message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.RunAggregationQueryRequest + * @memberof google.datastore.v1.QueryResultBatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest + * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunAggregationQueryRequest.decodeDelimited = function decodeDelimited(reader) { + QueryResultBatch.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunAggregationQueryRequest message. + * Verifies a QueryResultBatch message. * @function verify - * @memberof google.datastore.v1.RunAggregationQueryRequest + * @memberof google.datastore.v1.QueryResultBatch * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunAggregationQueryRequest.verify = function verify(message) { + QueryResultBatch.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.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.partitionId != null && message.hasOwnProperty("partitionId")) { - var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); - if (error) - return "partitionId." + error; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); - if (error) - return "readOptions." + error; - } - if (message.aggregationQuery != null && message.hasOwnProperty("aggregationQuery")) { - properties.queryType = 1; - { - var error = $root.google.datastore.v1.AggregationQuery.verify(message.aggregationQuery); + if (message.skippedResults != null && message.hasOwnProperty("skippedResults")) + if (!$util.isInteger(message.skippedResults)) + return "skippedResults: integer expected"; + if (message.skippedCursor != null && message.hasOwnProperty("skippedCursor")) + if (!(message.skippedCursor && typeof message.skippedCursor.length === "number" || $util.isString(message.skippedCursor))) + return "skippedCursor: buffer expected"; + if (message.entityResultType != null && message.hasOwnProperty("entityResultType")) + switch (message.entityResultType) { + default: + return "entityResultType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.entityResults != null && message.hasOwnProperty("entityResults")) { + if (!Array.isArray(message.entityResults)) + return "entityResults: array expected"; + for (var i = 0; i < message.entityResults.length; ++i) { + var error = $root.google.datastore.v1.EntityResult.verify(message.entityResults[i]); if (error) - return "aggregationQuery." + error; + return "entityResults." + error; } } - if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { - if (properties.queryType === 1) - return "queryType: multiple values"; - properties.queryType = 1; - { - var error = $root.google.datastore.v1.GqlQuery.verify(message.gqlQuery); - if (error) - return "gqlQuery." + error; + if (message.endCursor != null && message.hasOwnProperty("endCursor")) + if (!(message.endCursor && typeof message.endCursor.length === "number" || $util.isString(message.endCursor))) + return "endCursor: buffer expected"; + if (message.moreResults != null && message.hasOwnProperty("moreResults")) + switch (message.moreResults) { + default: + return "moreResults: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 3: + break; } + if (message.snapshotVersion != null && message.hasOwnProperty("snapshotVersion")) + if (!$util.isInteger(message.snapshotVersion) && !(message.snapshotVersion && $util.isInteger(message.snapshotVersion.low) && $util.isInteger(message.snapshotVersion.high))) + return "snapshotVersion: integer|Long expected"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; } return null; }; /** - * Creates a RunAggregationQueryRequest message from a plain object. Also converts values to their respective internal types. + * Creates a QueryResultBatch message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.RunAggregationQueryRequest + * @memberof google.datastore.v1.QueryResultBatch * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.RunAggregationQueryRequest} RunAggregationQueryRequest + * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch */ - RunAggregationQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RunAggregationQueryRequest) + QueryResultBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.QueryResultBatch) return object; - var message = new $root.google.datastore.v1.RunAggregationQueryRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.partitionId != null) { - if (typeof object.partitionId !== "object") - throw TypeError(".google.datastore.v1.RunAggregationQueryRequest.partitionId: object expected"); - message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); + var message = new $root.google.datastore.v1.QueryResultBatch(); + if (object.skippedResults != null) + message.skippedResults = object.skippedResults | 0; + if (object.skippedCursor != null) + if (typeof object.skippedCursor === "string") + $util.base64.decode(object.skippedCursor, message.skippedCursor = $util.newBuffer($util.base64.length(object.skippedCursor)), 0); + else if (object.skippedCursor.length) + message.skippedCursor = object.skippedCursor; + switch (object.entityResultType) { + case "RESULT_TYPE_UNSPECIFIED": + case 0: + message.entityResultType = 0; + break; + case "FULL": + case 1: + message.entityResultType = 1; + break; + case "PROJECTION": + case 2: + message.entityResultType = 2; + break; + case "KEY_ONLY": + case 3: + message.entityResultType = 3; + break; } - if (object.readOptions != null) { - if (typeof object.readOptions !== "object") - throw TypeError(".google.datastore.v1.RunAggregationQueryRequest.readOptions: object expected"); - message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); + if (object.entityResults) { + if (!Array.isArray(object.entityResults)) + throw TypeError(".google.datastore.v1.QueryResultBatch.entityResults: array expected"); + message.entityResults = []; + for (var i = 0; i < object.entityResults.length; ++i) { + if (typeof object.entityResults[i] !== "object") + throw TypeError(".google.datastore.v1.QueryResultBatch.entityResults: object expected"); + message.entityResults[i] = $root.google.datastore.v1.EntityResult.fromObject(object.entityResults[i]); + } } - if (object.aggregationQuery != null) { - if (typeof object.aggregationQuery !== "object") - throw TypeError(".google.datastore.v1.RunAggregationQueryRequest.aggregationQuery: object expected"); - message.aggregationQuery = $root.google.datastore.v1.AggregationQuery.fromObject(object.aggregationQuery); + if (object.endCursor != null) + if (typeof object.endCursor === "string") + $util.base64.decode(object.endCursor, message.endCursor = $util.newBuffer($util.base64.length(object.endCursor)), 0); + else if (object.endCursor.length) + message.endCursor = object.endCursor; + switch (object.moreResults) { + case "MORE_RESULTS_TYPE_UNSPECIFIED": + case 0: + message.moreResults = 0; + break; + case "NOT_FINISHED": + case 1: + message.moreResults = 1; + break; + case "MORE_RESULTS_AFTER_LIMIT": + case 2: + message.moreResults = 2; + break; + case "MORE_RESULTS_AFTER_CURSOR": + case 4: + message.moreResults = 4; + break; + case "NO_MORE_RESULTS": + case 3: + message.moreResults = 3; + break; } - if (object.gqlQuery != null) { - if (typeof object.gqlQuery !== "object") - throw TypeError(".google.datastore.v1.RunAggregationQueryRequest.gqlQuery: object expected"); - message.gqlQuery = $root.google.datastore.v1.GqlQuery.fromObject(object.gqlQuery); + if (object.snapshotVersion != null) + if ($util.Long) + (message.snapshotVersion = $util.Long.fromValue(object.snapshotVersion)).unsigned = false; + else if (typeof object.snapshotVersion === "string") + message.snapshotVersion = parseInt(object.snapshotVersion, 10); + else if (typeof object.snapshotVersion === "number") + message.snapshotVersion = object.snapshotVersion; + else if (typeof object.snapshotVersion === "object") + message.snapshotVersion = new $util.LongBits(object.snapshotVersion.low >>> 0, object.snapshotVersion.high >>> 0).toNumber(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.QueryResultBatch.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } return message; }; /** - * Creates a plain object from a RunAggregationQueryRequest message. Also converts values to other types if specified. + * Creates a plain object from a QueryResultBatch message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.RunAggregationQueryRequest + * @memberof google.datastore.v1.QueryResultBatch * @static - * @param {google.datastore.v1.RunAggregationQueryRequest} message RunAggregationQueryRequest + * @param {google.datastore.v1.QueryResultBatch} message QueryResultBatch * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunAggregationQueryRequest.toObject = function toObject(message, options) { + QueryResultBatch.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.entityResults = []; if (options.defaults) { - object.readOptions = null; - object.partitionId = null; - object.projectId = ""; - object.databaseId = ""; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) - object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); - if (message.partitionId != null && message.hasOwnProperty("partitionId")) - object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); - if (message.aggregationQuery != null && message.hasOwnProperty("aggregationQuery")) { - object.aggregationQuery = $root.google.datastore.v1.AggregationQuery.toObject(message.aggregationQuery, options); - if (options.oneofs) - object.queryType = "aggregationQuery"; + object.entityResultType = options.enums === String ? "RESULT_TYPE_UNSPECIFIED" : 0; + if (options.bytes === String) + object.skippedCursor = ""; + else { + object.skippedCursor = []; + if (options.bytes !== Array) + object.skippedCursor = $util.newBuffer(object.skippedCursor); + } + if (options.bytes === String) + object.endCursor = ""; + else { + object.endCursor = []; + if (options.bytes !== Array) + object.endCursor = $util.newBuffer(object.endCursor); + } + object.moreResults = options.enums === String ? "MORE_RESULTS_TYPE_UNSPECIFIED" : 0; + object.skippedResults = 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.snapshotVersion = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.snapshotVersion = options.longs === String ? "0" : 0; + object.readTime = null; } - if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { - object.gqlQuery = $root.google.datastore.v1.GqlQuery.toObject(message.gqlQuery, options); - if (options.oneofs) - object.queryType = "gqlQuery"; + if (message.entityResultType != null && message.hasOwnProperty("entityResultType")) + object.entityResultType = options.enums === String ? $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] : message.entityResultType; + if (message.entityResults && message.entityResults.length) { + object.entityResults = []; + for (var j = 0; j < message.entityResults.length; ++j) + object.entityResults[j] = $root.google.datastore.v1.EntityResult.toObject(message.entityResults[j], options); } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; + if (message.skippedCursor != null && message.hasOwnProperty("skippedCursor")) + object.skippedCursor = options.bytes === String ? $util.base64.encode(message.skippedCursor, 0, message.skippedCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.skippedCursor) : message.skippedCursor; + if (message.endCursor != null && message.hasOwnProperty("endCursor")) + object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; + if (message.moreResults != null && message.hasOwnProperty("moreResults")) + object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; + if (message.skippedResults != null && message.hasOwnProperty("skippedResults")) + object.skippedResults = message.skippedResults; + if (message.snapshotVersion != null && message.hasOwnProperty("snapshotVersion")) + if (typeof message.snapshotVersion === "number") + object.snapshotVersion = options.longs === String ? String(message.snapshotVersion) : message.snapshotVersion; + else + object.snapshotVersion = options.longs === String ? $util.Long.prototype.toString.call(message.snapshotVersion) : options.longs === Number ? new $util.LongBits(message.snapshotVersion.low >>> 0, message.snapshotVersion.high >>> 0).toNumber() : message.snapshotVersion; + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); return object; }; - /** - * Converts this RunAggregationQueryRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.RunAggregationQueryRequest - * @instance - * @returns {Object.} JSON object - */ - RunAggregationQueryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this QueryResultBatch to JSON. + * @function toJSON + * @memberof google.datastore.v1.QueryResultBatch + * @instance + * @returns {Object.} JSON object + */ + QueryResultBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * MoreResultsType enum. + * @name google.datastore.v1.QueryResultBatch.MoreResultsType + * @enum {number} + * @property {number} MORE_RESULTS_TYPE_UNSPECIFIED=0 MORE_RESULTS_TYPE_UNSPECIFIED value + * @property {number} NOT_FINISHED=1 NOT_FINISHED value + * @property {number} MORE_RESULTS_AFTER_LIMIT=2 MORE_RESULTS_AFTER_LIMIT value + * @property {number} MORE_RESULTS_AFTER_CURSOR=4 MORE_RESULTS_AFTER_CURSOR value + * @property {number} NO_MORE_RESULTS=3 NO_MORE_RESULTS value + */ + QueryResultBatch.MoreResultsType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MORE_RESULTS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOT_FINISHED"] = 1; + values[valuesById[2] = "MORE_RESULTS_AFTER_LIMIT"] = 2; + values[valuesById[4] = "MORE_RESULTS_AFTER_CURSOR"] = 4; + values[valuesById[3] = "NO_MORE_RESULTS"] = 3; + return values; + })(); + + return QueryResultBatch; + })(); + + return v1; + })(); + + return datastore; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; - return RunAggregationQueryRequest; - })(); + /** + * 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); + }; - v1.RunAggregationQueryResponse = (function() { + /** + * 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; + }; - /** - * Properties of a RunAggregationQueryResponse. - * @memberof google.datastore.v1 - * @interface IRunAggregationQueryResponse - * @property {google.datastore.v1.IAggregationResultBatch|null} [batch] RunAggregationQueryResponse batch - * @property {google.datastore.v1.IAggregationQuery|null} [query] RunAggregationQueryResponse query - */ + /** + * 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(); + }; - /** - * Constructs a new RunAggregationQueryResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a RunAggregationQueryResponse. - * @implements IRunAggregationQueryResponse - * @constructor - * @param {google.datastore.v1.IRunAggregationQueryResponse=} [properties] Properties to set - */ - function RunAggregationQueryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + case 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * RunAggregationQueryResponse batch. - * @member {google.datastore.v1.IAggregationResultBatch|null|undefined} batch - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @instance - */ - RunAggregationQueryResponse.prototype.batch = null; - - /** - * RunAggregationQueryResponse query. - * @member {google.datastore.v1.IAggregationQuery|null|undefined} query - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @instance - */ - RunAggregationQueryResponse.prototype.query = null; + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new RunAggregationQueryResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @static - * @param {google.datastore.v1.IRunAggregationQueryResponse=} [properties] Properties to set - * @returns {google.datastore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse instance - */ - RunAggregationQueryResponse.create = function create(properties) { - return new RunAggregationQueryResponse(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified RunAggregationQueryResponse message. Does not implicitly {@link google.datastore.v1.RunAggregationQueryResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @static - * @param {google.datastore.v1.IRunAggregationQueryResponse} message RunAggregationQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunAggregationQueryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) - $root.google.datastore.v1.AggregationResultBatch.encode(message.batch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.datastore.v1.AggregationQuery.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * 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; + }; - /** - * Encodes the specified RunAggregationQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunAggregationQueryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @static - * @param {google.datastore.v1.IRunAggregationQueryResponse} message RunAggregationQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunAggregationQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + }; - /** - * Decodes a RunAggregationQueryResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunAggregationQueryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunAggregationQueryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.batch = $root.google.datastore.v1.AggregationResultBatch.decode(reader, reader.uint32()); - break; - case 2: - message.query = $root.google.datastore.v1.AggregationQuery.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes a RunAggregationQueryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunAggregationQueryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return Http; + })(); - /** - * Verifies a RunAggregationQueryResponse message. - * @function verify - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunAggregationQueryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.batch != null && message.hasOwnProperty("batch")) { - var error = $root.google.datastore.v1.AggregationResultBatch.verify(message.batch); - if (error) - return "batch." + error; - } - if (message.query != null && message.hasOwnProperty("query")) { - var error = $root.google.datastore.v1.AggregationQuery.verify(message.query); - if (error) - return "query." + error; - } - return null; - }; + api.HttpRule = (function() { - /** - * Creates a RunAggregationQueryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RunAggregationQueryResponse} RunAggregationQueryResponse - */ - RunAggregationQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RunAggregationQueryResponse) - return object; - var message = new $root.google.datastore.v1.RunAggregationQueryResponse(); - if (object.batch != null) { - if (typeof object.batch !== "object") - throw TypeError(".google.datastore.v1.RunAggregationQueryResponse.batch: object expected"); - message.batch = $root.google.datastore.v1.AggregationResultBatch.fromObject(object.batch); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.datastore.v1.RunAggregationQueryResponse.query: object expected"); - message.query = $root.google.datastore.v1.AggregationQuery.fromObject(object.query); - } - return message; - }; + /** + * 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 + */ - /** - * Creates a plain object from a RunAggregationQueryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @static - * @param {google.datastore.v1.RunAggregationQueryResponse} message RunAggregationQueryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunAggregationQueryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.batch = null; - object.query = null; - } - if (message.batch != null && message.hasOwnProperty("batch")) - object.batch = $root.google.datastore.v1.AggregationResultBatch.toObject(message.batch, options); - if (message.query != null && message.hasOwnProperty("query")) - object.query = $root.google.datastore.v1.AggregationQuery.toObject(message.query, options); - return object; - }; + /** + * 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]]; + } - /** - * Converts this RunAggregationQueryResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @instance - * @returns {Object.} JSON object - */ - RunAggregationQueryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; - return RunAggregationQueryResponse; - })(); + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; - v1.BeginTransactionRequest = (function() { + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; - /** - * Properties of a BeginTransactionRequest. - * @memberof google.datastore.v1 - * @interface IBeginTransactionRequest - * @property {string|null} [projectId] BeginTransactionRequest projectId - * @property {string|null} [databaseId] BeginTransactionRequest databaseId - * @property {google.datastore.v1.ITransactionOptions|null} [transactionOptions] BeginTransactionRequest transactionOptions - */ + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; - /** - * Constructs a new BeginTransactionRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a BeginTransactionRequest. - * @implements IBeginTransactionRequest - * @constructor - * @param {google.datastore.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]]; - } + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; - /** - * BeginTransactionRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.projectId = ""; + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; - /** - * BeginTransactionRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.databaseId = ""; + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; - /** - * BeginTransactionRequest transactionOptions. - * @member {google.datastore.v1.ITransactionOptions|null|undefined} transactionOptions - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.transactionOptions = null; + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; - /** - * Creates a new BeginTransactionRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.v1.IBeginTransactionRequest=} [properties] Properties to set - * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest instance - */ - BeginTransactionRequest.create = function create(properties) { - return new BeginTransactionRequest(properties); - }; + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; - /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - if (message.transactionOptions != null && Object.hasOwnProperty.call(message, "transactionOptions")) - $root.google.datastore.v1.TransactionOptions.encode(message.transactionOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; + /** + * 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) + }); - /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.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(); - }; + /** + * 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); + }; - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 9: - message.databaseId = reader.string(); - break; - case 10: - message.transactionOptions = $root.google.datastore.v1.TransactionOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.selector = reader.string(); + break; + case 2: + message.get = reader.string(); + break; + case 3: + message.put = reader.string(); + break; + case 4: + message.post = reader.string(); + break; + case 5: + message["delete"] = reader.string(); + break; + case 6: + message.patch = reader.string(); + break; + case 8: + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + case 7: + message.body = reader.string(); + break; + case 12: + message.responseBody = reader.string(); + break; + case 11: + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a BeginTransactionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * 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 BeginTransactionRequest message. - * @function verify - * @memberof google.datastore.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.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.transactionOptions != null && message.hasOwnProperty("transactionOptions")) { - var error = $root.google.datastore.v1.TransactionOptions.verify(message.transactionOptions); + /** + * 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 "transactionOptions." + error; + return "custom." + error; } - return null; - }; - - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest - */ - BeginTransactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.BeginTransactionRequest) - return object; - var message = new $root.google.datastore.v1.BeginTransactionRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.transactionOptions != null) { - if (typeof object.transactionOptions !== "object") - throw TypeError(".google.datastore.v1.BeginTransactionRequest.transactionOptions: object expected"); - message.transactionOptions = $root.google.datastore.v1.TransactionOptions.fromObject(object.transactionOptions); + } + 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 message; - }; + } + return null; + }; - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.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.projectId = ""; - object.databaseId = ""; - object.transactionOptions = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.transactionOptions != null && message.hasOwnProperty("transactionOptions")) - object.transactionOptions = $root.google.datastore.v1.TransactionOptions.toObject(message.transactionOptions, options); + /** + * 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; - }; - - /** - * Converts this BeginTransactionRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - * @returns {Object.} JSON object - */ - BeginTransactionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return BeginTransactionRequest; - })(); - - v1.BeginTransactionResponse = (function() { - - /** - * Properties of a BeginTransactionResponse. - * @memberof google.datastore.v1 - * @interface IBeginTransactionResponse - * @property {Uint8Array|null} [transaction] BeginTransactionResponse transaction - */ - - /** - * Constructs a new BeginTransactionResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a BeginTransactionResponse. - * @implements IBeginTransactionResponse - * @constructor - * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set - */ - function BeginTransactionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; - /** - * BeginTransactionResponse transaction. - * @member {Uint8Array} transaction - * @memberof google.datastore.v1.BeginTransactionResponse - * @instance - */ - BeginTransactionResponse.prototype.transaction = $util.newBuffer([]); - - /** - * Creates a new BeginTransactionResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse instance - */ - BeginTransactionResponse.create = function create(properties) { - return new BeginTransactionResponse(properties); - }; - - /** - * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - return writer; - }; + /** + * 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; + }; - /** - * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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); + }; - /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.transaction = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return HttpRule; + })(); - /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + api.CustomHttpPattern = (function() { - /** - * Verifies a BeginTransactionResponse message. - * @function verify - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BeginTransactionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - return null; - }; + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ - /** - * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse - */ - BeginTransactionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.BeginTransactionResponse) - return object; - var message = new $root.google.datastore.v1.BeginTransactionResponse(); - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length) - message.transaction = object.transaction; - return message; - }; + /** + * 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]]; + } - /** - * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.BeginTransactionResponse} message BeginTransactionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BeginTransactionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - return object; - }; + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; - /** - * Converts this BeginTransactionResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.BeginTransactionResponse - * @instance - * @returns {Object.} JSON object - */ - BeginTransactionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; - return BeginTransactionResponse; - })(); + /** + * 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); + }; - v1.RollbackRequest = (function() { + /** + * 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; + }; - /** - * Properties of a RollbackRequest. - * @memberof google.datastore.v1 - * @interface IRollbackRequest - * @property {string|null} [projectId] RollbackRequest projectId - * @property {string|null} [databaseId] RollbackRequest databaseId - * @property {Uint8Array|null} [transaction] RollbackRequest transaction - */ + /** + * 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(); + }; - /** - * Constructs a new RollbackRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a RollbackRequest. - * @implements IRollbackRequest - * @constructor - * @param {google.datastore.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]]; + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.string(); + break; + case 2: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * RollbackRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.projectId = ""; - - /** - * RollbackRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.databaseId = ""; - - /** - * RollbackRequest transaction. - * @member {Uint8Array} transaction - * @memberof google.datastore.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.transaction = $util.newBuffer([]); + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new RollbackRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.v1.IRollbackRequest=} [properties] Properties to set - * @returns {google.datastore.v1.RollbackRequest} RollbackRequest instance - */ - RollbackRequest.create = function create(properties) { - return new RollbackRequest(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - return writer; - }; + /** + * 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; + }; - /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.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(); - }; + /** + * 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; + }; - /** - * Decodes a RollbackRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 9: - message.databaseId = reader.string(); - break; - case 1: - message.transaction = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes a RollbackRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + return CustomHttpPattern; + })(); - /** - * Verifies a RollbackRequest message. - * @function verify - * @memberof google.datastore.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.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.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - return null; - }; + /** + * 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 + */ + 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; + return values; + })(); - /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RollbackRequest} RollbackRequest - */ - RollbackRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RollbackRequest) - return object; - var message = new $root.google.datastore.v1.RollbackRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length) - message.transaction = object.transaction; - return message; - }; + return api; + })(); - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.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) { - if (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - object.projectId = ""; - object.databaseId = ""; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - return object; - }; + google.protobuf = (function() { - /** - * Converts this RollbackRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.RollbackRequest - * @instance - * @returns {Object.} JSON object - */ - RollbackRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; - return RollbackRequest; - })(); + protobuf.FileDescriptorSet = (function() { - v1.RollbackResponse = (function() { + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ - /** - * Properties of a RollbackResponse. - * @memberof google.datastore.v1 - * @interface IRollbackResponse - */ + /** + * 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]]; + } - /** - * Constructs a new RollbackResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a RollbackResponse. - * @implements IRollbackResponse - * @constructor - * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set - */ - function RollbackResponse(properties) { - if (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 RollbackResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse instance - */ - RollbackResponse.create = function create(properties) { - return new RollbackResponse(properties); - }; + /** + * 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 RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; + /** + * 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 RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a RollbackResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } + /** + * 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 message; - }; + } + return null; + }; - /** - * Decodes a RollbackResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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; + }; - /** - * Verifies a RollbackResponse message. - * @function verify - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RollbackResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + /** + * 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; + }; - /** - * Creates a RollbackResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse - */ - RollbackResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RollbackResponse) - return object; - return new $root.google.datastore.v1.RollbackResponse(); - }; + /** + * 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); + }; - /** - * Creates a plain object from a RollbackResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {google.datastore.v1.RollbackResponse} message RollbackResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RollbackResponse.toObject = function toObject() { - return {}; - }; + return FileDescriptorSet; + })(); - /** - * Converts this RollbackResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.RollbackResponse - * @instance - * @returns {Object.} JSON object - */ - RollbackResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + protobuf.FileDescriptorProto = (function() { - return RollbackResponse; - })(); + /** + * 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 + */ - v1.CommitRequest = (function() { + /** + * 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]]; + } - /** - * Properties of a CommitRequest. - * @memberof google.datastore.v1 - * @interface ICommitRequest - * @property {string|null} [projectId] CommitRequest projectId - * @property {string|null} [databaseId] CommitRequest databaseId - * @property {google.datastore.v1.CommitRequest.Mode|null} [mode] CommitRequest mode - * @property {Uint8Array|null} [transaction] CommitRequest transaction - * @property {Array.|null} [mutations] CommitRequest mutations - */ + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; - /** - * Constructs a new CommitRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a CommitRequest. - * @implements ICommitRequest - * @constructor - * @param {google.datastore.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]]; - } + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; - /** - * CommitRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.projectId = ""; + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; - /** - * CommitRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.databaseId = ""; + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - /** - * CommitRequest mode. - * @member {google.datastore.v1.CommitRequest.Mode} mode - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.mode = 0; + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - /** - * CommitRequest transaction. - * @member {Uint8Array|null|undefined} transaction - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.transaction = null; + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; - /** - * CommitRequest mutations. - * @member {Array.} mutations - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.mutations = $util.emptyArray; + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; - /** - * CommitRequest transactionSelector. - * @member {"transaction"|undefined} transactionSelector - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - Object.defineProperty(CommitRequest.prototype, "transactionSelector", { - get: $util.oneOfGetter($oneOfFields = ["transaction"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; - /** - * Creates a new CommitRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {google.datastore.v1.ICommitRequest=} [properties] Properties to set - * @returns {google.datastore.v1.CommitRequest} CommitRequest instance - */ - CommitRequest.create = function create(properties) { - return new CommitRequest(properties); - }; + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; - /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.mode); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.google.datastore.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - return writer; - }; + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; - /** - * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {google.datastore.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(); - }; + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; - /** - * Decodes a CommitRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 9: - message.databaseId = reader.string(); - break; - case 5: - message.mode = reader.int32(); - break; - case 1: - message.transaction = reader.bytes(); - break; - case 6: - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.google.datastore.v1.Mutation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes a CommitRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; - /** - * Verifies a CommitRequest message. - * @function verify - * @memberof google.datastore.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.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.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - properties.transactionSelector = 1; - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - } - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.google.datastore.v1.Mutation.verify(message.mutations[i]); - if (error) - return "mutations." + error; - } - } - return null; - }; + /** + * 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(); + }; - /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.CommitRequest} CommitRequest - */ - CommitRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.CommitRequest) - return object; - var message = new $root.google.datastore.v1.CommitRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - switch (object.mode) { - case "MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "TRANSACTIONAL": + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.mode = 1; + message.name = reader.string(); break; - case "NON_TRANSACTIONAL": case 2: - message.mode = 2; + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); break; } - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length) - message.transaction = object.transaction; - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".google.datastore.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.datastore.v1.CommitRequest.mutations: object expected"); - message.mutations[i] = $root.google.datastore.v1.Mutation.fromObject(object.mutations[i]); - } + } + 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; } - return message; - }; + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; - /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {google.datastore.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.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - object.projectId = ""; - object.databaseId = ""; + /** + * 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 (message.transaction != null && message.hasOwnProperty("transaction")) { - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (options.oneofs) - object.transactionSelector = "transaction"; + } + 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 (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.datastore.v1.CommitRequest.Mode[message.mode] : message.mode; - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.datastore.v1.Mutation.toObject(message.mutations[j], options); + } + 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 (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - return object; - }; + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ - /** - * Converts this CommitRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.CommitRequest - * @instance - * @returns {Object.} JSON object - */ - CommitRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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]]; + } - /** - * Mode enum. - * @name google.datastore.v1.CommitRequest.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} TRANSACTIONAL=1 TRANSACTIONAL value - * @property {number} NON_TRANSACTIONAL=2 NON_TRANSACTIONAL value - */ - CommitRequest.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TRANSACTIONAL"] = 1; - values[valuesById[2] = "NON_TRANSACTIONAL"] = 2; - return values; - })(); + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; - return CommitRequest; - })(); + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; - v1.CommitResponse = (function() { + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; - /** - * Properties of a CommitResponse. - * @memberof google.datastore.v1 - * @interface ICommitResponse - * @property {Array.|null} [mutationResults] CommitResponse mutationResults - * @property {number|null} [indexUpdates] CommitResponse indexUpdates - * @property {google.protobuf.ITimestamp|null} [commitTime] CommitResponse commitTime - */ + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; - /** - * Constructs a new CommitResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a CommitResponse. - * @implements ICommitResponse - * @constructor - * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set - */ - function CommitResponse(properties) { - this.mutationResults = []; - if (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 enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; - /** - * CommitResponse mutationResults. - * @member {Array.} mutationResults - * @memberof google.datastore.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.mutationResults = $util.emptyArray; + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; - /** - * CommitResponse indexUpdates. - * @member {number} indexUpdates - * @memberof google.datastore.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.indexUpdates = 0; + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; - /** - * CommitResponse commitTime. - * @member {google.protobuf.ITimestamp|null|undefined} commitTime - * @memberof google.datastore.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.commitTime = null; + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; - /** - * Creates a new CommitResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set - * @returns {google.datastore.v1.CommitResponse} CommitResponse instance - */ - CommitResponse.create = function create(properties) { - return new CommitResponse(properties); - }; + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; - /** - * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {google.datastore.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.mutationResults != null && message.mutationResults.length) - for (var i = 0; i < message.mutationResults.length; ++i) - $root.google.datastore.v1.MutationResult.encode(message.mutationResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.indexUpdates != null && Object.hasOwnProperty.call(message, "indexUpdates")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.indexUpdates); - if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) - $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; + /** + * 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 CommitResponse message, length delimited. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {google.datastore.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(); - }; + /** + * 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 CommitResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - if (!(message.mutationResults && message.mutationResults.length)) - message.mutationResults = []; - message.mutationResults.push($root.google.datastore.v1.MutationResult.decode(reader, reader.uint32())); - break; - case 4: - message.indexUpdates = reader.int32(); - break; - case 8: - message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a CommitResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * 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 CommitResponse message. - * @function verify - * @memberof google.datastore.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"; - if (message.mutationResults != null && message.hasOwnProperty("mutationResults")) { - if (!Array.isArray(message.mutationResults)) - return "mutationResults: array expected"; - for (var i = 0; i < message.mutationResults.length; ++i) { - var error = $root.google.datastore.v1.MutationResult.verify(message.mutationResults[i]); - if (error) - return "mutationResults." + error; - } + /** + * 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.indexUpdates != null && message.hasOwnProperty("indexUpdates")) - if (!$util.isInteger(message.indexUpdates)) - return "indexUpdates: integer expected"; - if (message.commitTime != null && message.hasOwnProperty("commitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTime); + } + 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 "commitTime." + error; + return "extension." + error; } - return null; - }; - - /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.CommitResponse} CommitResponse - */ - CommitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.CommitResponse) - return object; - var message = new $root.google.datastore.v1.CommitResponse(); - if (object.mutationResults) { - if (!Array.isArray(object.mutationResults)) - throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: array expected"); - message.mutationResults = []; - for (var i = 0; i < object.mutationResults.length; ++i) { - if (typeof object.mutationResults[i] !== "object") - throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: object expected"); - message.mutationResults[i] = $root.google.datastore.v1.MutationResult.fromObject(object.mutationResults[i]); - } + } + 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 (object.indexUpdates != null) - message.indexUpdates = object.indexUpdates | 0; - if (object.commitTime != null) { - if (typeof object.commitTime !== "object") - throw TypeError(".google.datastore.v1.CommitResponse.commitTime: object expected"); - message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); + } + 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; } - return message; - }; - - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {google.datastore.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.arrays || options.defaults) - object.mutationResults = []; - if (options.defaults) { - object.indexUpdates = 0; - object.commitTime = null; + } + 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.mutationResults && message.mutationResults.length) { - object.mutationResults = []; - for (var j = 0; j < message.mutationResults.length; ++j) - object.mutationResults[j] = $root.google.datastore.v1.MutationResult.toObject(message.mutationResults[j], options); + } + 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.indexUpdates != null && message.hasOwnProperty("indexUpdates")) - object.indexUpdates = message.indexUpdates; - if (message.commitTime != null && message.hasOwnProperty("commitTime")) - object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); - return object; - }; - - /** - * Converts this CommitResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.CommitResponse - * @instance - * @returns {Object.} JSON object - */ - CommitResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return CommitResponse; - })(); - - v1.AllocateIdsRequest = (function() { - - /** - * Properties of an AllocateIdsRequest. - * @memberof google.datastore.v1 - * @interface IAllocateIdsRequest - * @property {string|null} [projectId] AllocateIdsRequest projectId - * @property {string|null} [databaseId] AllocateIdsRequest databaseId - * @property {Array.|null} [keys] AllocateIdsRequest keys - */ - - /** - * Constructs a new AllocateIdsRequest. - * @memberof google.datastore.v1 - * @classdesc Represents an AllocateIdsRequest. - * @implements IAllocateIdsRequest - * @constructor - * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set - */ - function AllocateIdsRequest(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]]; } + 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; + }; - /** - * AllocateIdsRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - */ - AllocateIdsRequest.prototype.projectId = ""; - - /** - * AllocateIdsRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - */ - AllocateIdsRequest.prototype.databaseId = ""; - - /** - * AllocateIdsRequest keys. - * @member {Array.} keys - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - */ - AllocateIdsRequest.prototype.keys = $util.emptyArray; - - /** - * Creates a new AllocateIdsRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest instance - */ - AllocateIdsRequest.create = function create(properties) { - return new AllocateIdsRequest(properties); - }; - - /** - * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocateIdsRequest.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - return writer; - }; - - /** - * Encodes the specified AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocateIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllocateIdsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocateIdsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 9: - message.databaseId = reader.string(); - break; - case 1: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * 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]); } - return message; - }; - - /** - * Decodes an AllocateIdsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocateIdsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllocateIdsRequest message. - * @function verify - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllocateIdsRequest.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.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: 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.datastore.v1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } + } + 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]); } - return null; - }; - - /** - * Creates an AllocateIdsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest - */ - AllocateIdsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AllocateIdsRequest) - return object; - var message = new $root.google.datastore.v1.AllocateIdsRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.datastore.v1.AllocateIdsRequest.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.datastore.v1.AllocateIdsRequest.keys: object expected"); - message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[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]); } - return message; - }; - - /** - * Creates a plain object from an AllocateIdsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.AllocateIdsRequest} message AllocateIdsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllocateIdsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (options.defaults) { - object.projectId = ""; - object.databaseId = ""; + } + 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 (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + } + 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 (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - return object; - }; + } + 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; + }; - /** - * Converts this AllocateIdsRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - * @returns {Object.} JSON object - */ - AllocateIdsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return AllocateIdsRequest; - })(); + /** + * 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); + }; - v1.AllocateIdsResponse = (function() { + DescriptorProto.ExtensionRange = (function() { /** - * Properties of an AllocateIdsResponse. - * @memberof google.datastore.v1 - * @interface IAllocateIdsResponse - * @property {Array.|null} [keys] AllocateIdsResponse keys + * 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 AllocateIdsResponse. - * @memberof google.datastore.v1 - * @classdesc Represents an AllocateIdsResponse. - * @implements IAllocateIdsResponse + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange * @constructor - * @param {google.datastore.v1.IAllocateIdsResponse=} [properties] Properties to set + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set */ - function AllocateIdsResponse(properties) { - this.keys = []; + function ExtensionRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22349,78 +18670,101 @@ } /** - * AllocateIdsResponse keys. - * @member {Array.} keys - * @memberof google.datastore.v1.AllocateIdsResponse + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance */ - AllocateIdsResponse.prototype.keys = $util.emptyArray; + ExtensionRange.prototype.start = 0; /** - * Creates a new AllocateIdsResponse instance using the specified properties. + * 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.datastore.v1.AllocateIdsResponse + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static - * @param {google.datastore.v1.IAllocateIdsResponse=} [properties] Properties to set - * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse instance + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance */ - AllocateIdsResponse.create = function create(properties) { - return new AllocateIdsResponse(properties); + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); }; /** - * Encodes the specified AllocateIdsResponse message. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.AllocateIdsResponse + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static - * @param {google.datastore.v1.IAllocateIdsResponse} message AllocateIdsResponse message or plain object to encode + * @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 */ - AllocateIdsResponse.encode = function encode(message, writer) { + ExtensionRange.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + 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 AllocateIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsResponse.verify|verify} messages. + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.AllocateIdsResponse + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static - * @param {google.datastore.v1.IAllocateIdsResponse} message AllocateIdsResponse message or plain object to encode + * @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 */ - AllocateIdsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AllocateIdsResponse message from the specified reader or buffer. + * Decodes an ExtensionRange message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.AllocateIdsResponse + * @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.datastore.v1.AllocateIdsResponse} AllocateIdsResponse + * @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 */ - AllocateIdsResponse.decode = function decode(reader, length) { + ExtensionRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + 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); @@ -22431,127 +18775,130 @@ }; /** - * Decodes an AllocateIdsResponse message from the specified reader or buffer, length delimited. + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.AllocateIdsResponse + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse + * @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 */ - AllocateIdsResponse.decodeDelimited = function decodeDelimited(reader) { + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AllocateIdsResponse message. + * Verifies an ExtensionRange message. * @function verify - * @memberof google.datastore.v1.AllocateIdsResponse + * @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 */ - AllocateIdsResponse.verify = function verify(message) { + ExtensionRange.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.datastore.v1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } + 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 AllocateIdsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.AllocateIdsResponse + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.AllocateIdsResponse} AllocateIdsResponse + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange */ - AllocateIdsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AllocateIdsResponse) + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) return object; - var message = new $root.google.datastore.v1.AllocateIdsResponse(); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.datastore.v1.AllocateIdsResponse.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.datastore.v1.AllocateIdsResponse.keys: object expected"); - message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); - } + 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 AllocateIdsResponse message. Also converts values to other types if specified. + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.AllocateIdsResponse + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @static - * @param {google.datastore.v1.AllocateIdsResponse} message AllocateIdsResponse + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AllocateIdsResponse.toObject = function toObject(message, options) { + ExtensionRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.keys = []; - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + 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 AllocateIdsResponse to JSON. + * Converts this ExtensionRange to JSON. * @function toJSON - * @memberof google.datastore.v1.AllocateIdsResponse + * @memberof google.protobuf.DescriptorProto.ExtensionRange * @instance * @returns {Object.} JSON object */ - AllocateIdsResponse.prototype.toJSON = function toJSON() { + ExtensionRange.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AllocateIdsResponse; + return ExtensionRange; })(); - v1.ReserveIdsRequest = (function() { + DescriptorProto.ReservedRange = (function() { /** - * Properties of a ReserveIdsRequest. - * @memberof google.datastore.v1 - * @interface IReserveIdsRequest - * @property {string|null} [projectId] ReserveIdsRequest projectId - * @property {string|null} [databaseId] ReserveIdsRequest databaseId - * @property {Array.|null} [keys] ReserveIdsRequest keys + * 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 ReserveIdsRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a ReserveIdsRequest. - * @implements IReserveIdsRequest + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange * @constructor - * @param {google.datastore.v1.IReserveIdsRequest=} [properties] Properties to set + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set */ - function ReserveIdsRequest(properties) { - this.keys = []; + function ReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22559,104 +18906,88 @@ } /** - * ReserveIdsRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.ReserveIdsRequest - * @instance - */ - ReserveIdsRequest.prototype.projectId = ""; - - /** - * ReserveIdsRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.ReserveIdsRequest + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ - ReserveIdsRequest.prototype.databaseId = ""; + ReservedRange.prototype.start = 0; /** - * ReserveIdsRequest keys. - * @member {Array.} keys - * @memberof google.datastore.v1.ReserveIdsRequest + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange * @instance */ - ReserveIdsRequest.prototype.keys = $util.emptyArray; + ReservedRange.prototype.end = 0; /** - * Creates a new ReserveIdsRequest instance using the specified properties. + * Creates a new ReservedRange instance using the specified properties. * @function create - * @memberof google.datastore.v1.ReserveIdsRequest + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static - * @param {google.datastore.v1.IReserveIdsRequest=} [properties] Properties to set - * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest instance + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance */ - ReserveIdsRequest.create = function create(properties) { - return new ReserveIdsRequest(properties); + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); }; /** - * Encodes the specified ReserveIdsRequest message. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.ReserveIdsRequest + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static - * @param {google.datastore.v1.IReserveIdsRequest} message ReserveIdsRequest message or plain object to encode + * @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 */ - ReserveIdsRequest.encode = function encode(message, writer) { + ReservedRange.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + 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 ReserveIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsRequest.verify|verify} messages. + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.ReserveIdsRequest + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static - * @param {google.datastore.v1.IReserveIdsRequest} message ReserveIdsRequest message or plain object to encode + * @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 */ - ReserveIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReserveIdsRequest message from the specified reader or buffer. + * Decodes a ReservedRange message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.ReserveIdsRequest + * @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.datastore.v1.ReserveIdsRequest} ReserveIdsRequest + * @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 */ - ReserveIdsRequest.decode = function decode(reader, length) { + ReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 8: - message.projectId = reader.string(); - break; - case 9: - message.databaseId = reader.string(); - break; case 1: - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); break; default: reader.skipType(tag & 7); @@ -22667,976 +18998,1467 @@ }; /** - * Decodes a ReserveIdsRequest message from the specified reader or buffer, length delimited. + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.ReserveIdsRequest + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest + * @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 */ - ReserveIdsRequest.decodeDelimited = function decodeDelimited(reader) { + ReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReserveIdsRequest message. + * Verifies a ReservedRange message. * @function verify - * @memberof google.datastore.v1.ReserveIdsRequest + * @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 */ - ReserveIdsRequest.verify = function verify(message) { + ReservedRange.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.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: 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.datastore.v1.Key.verify(message.keys[i]); - if (error) - return "keys." + error; - } - } + 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 ReserveIdsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.ReserveIdsRequest + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.ReserveIdsRequest} ReserveIdsRequest + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange */ - ReserveIdsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.ReserveIdsRequest) + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) return object; - var message = new $root.google.datastore.v1.ReserveIdsRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.keys) { - if (!Array.isArray(object.keys)) - throw TypeError(".google.datastore.v1.ReserveIdsRequest.keys: array expected"); - message.keys = []; - for (var i = 0; i < object.keys.length; ++i) { - if (typeof object.keys[i] !== "object") - throw TypeError(".google.datastore.v1.ReserveIdsRequest.keys: object expected"); - message.keys[i] = $root.google.datastore.v1.Key.fromObject(object.keys[i]); - } - } + 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 ReserveIdsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.ReserveIdsRequest + * @memberof google.protobuf.DescriptorProto.ReservedRange * @static - * @param {google.datastore.v1.ReserveIdsRequest} message ReserveIdsRequest + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReserveIdsRequest.toObject = function toObject(message, options) { + ReservedRange.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.keys = []; if (options.defaults) { - object.projectId = ""; - object.databaseId = ""; + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.keys && message.keys.length) { - object.keys = []; - for (var j = 0; j < message.keys.length; ++j) - object.keys[j] = $root.google.datastore.v1.Key.toObject(message.keys[j], options); + } + 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.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) return object; - }; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * Converts this ReserveIdsRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.ReserveIdsRequest - * @instance - * @returns {Object.} JSON object - */ - ReserveIdsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - return ReserveIdsRequest; - })(); + /** + * 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); + }; - v1.ReserveIdsResponse = (function() { + return ExtensionRangeOptions; + })(); - /** - * Properties of a ReserveIdsResponse. - * @memberof google.datastore.v1 - * @interface IReserveIdsResponse - */ + protobuf.FieldDescriptorProto = (function() { - /** - * Constructs a new ReserveIdsResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a ReserveIdsResponse. - * @implements IReserveIdsResponse - * @constructor - * @param {google.datastore.v1.IReserveIdsResponse=} [properties] Properties to set - */ - function ReserveIdsResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a 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 + */ - /** - * Creates a new ReserveIdsResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {google.datastore.v1.IReserveIdsResponse=} [properties] Properties to set - * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse instance - */ - ReserveIdsResponse.create = function create(properties) { - return new ReserveIdsResponse(properties); - }; + /** + * 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]]; + } - /** - * Encodes the specified ReserveIdsResponse message. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {google.datastore.v1.IReserveIdsResponse} message ReserveIdsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReserveIdsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; - /** - * Encodes the specified ReserveIdsResponse message, length delimited. Does not implicitly {@link google.datastore.v1.ReserveIdsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {google.datastore.v1.IReserveIdsResponse} message ReserveIdsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReserveIdsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; - /** - * Decodes a ReserveIdsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReserveIdsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; - /** - * Decodes a ReserveIdsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReserveIdsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; - /** - * Verifies a ReserveIdsResponse message. - * @function verify - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReserveIdsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; - /** - * Creates a ReserveIdsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.ReserveIdsResponse} ReserveIdsResponse - */ - ReserveIdsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.ReserveIdsResponse) - return object; - return new $root.google.datastore.v1.ReserveIdsResponse(); - }; + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; - /** - * Creates a plain object from a ReserveIdsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {google.datastore.v1.ReserveIdsResponse} message ReserveIdsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReserveIdsResponse.toObject = function toObject() { - return {}; - }; + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; - /** - * Converts this ReserveIdsResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.ReserveIdsResponse - * @instance - * @returns {Object.} JSON object - */ - ReserveIdsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; - return ReserveIdsResponse; - })(); + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; - v1.Mutation = (function() { + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; - /** - * Properties of a Mutation. - * @memberof google.datastore.v1 - * @interface IMutation - * @property {google.datastore.v1.IEntity|null} [insert] Mutation insert - * @property {google.datastore.v1.IEntity|null} [update] Mutation update - * @property {google.datastore.v1.IEntity|null} [upsert] Mutation upsert - * @property {google.datastore.v1.IKey|null} ["delete"] Mutation delete - * @property {number|Long|null} [baseVersion] Mutation baseVersion - * @property {google.protobuf.ITimestamp|null} [updateTime] Mutation updateTime - */ + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; - /** - * Constructs a new Mutation. - * @memberof google.datastore.v1 - * @classdesc Represents a Mutation. - * @implements IMutation - * @constructor - * @param {google.datastore.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]]; + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * Mutation insert. - * @member {google.datastore.v1.IEntity|null|undefined} insert - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.insert = null; - - /** - * Mutation update. - * @member {google.datastore.v1.IEntity|null|undefined} update - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.update = null; - - /** - * Mutation upsert. - * @member {google.datastore.v1.IEntity|null|undefined} upsert - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.upsert = null; + /** + * 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()); + }; - /** - * Mutation delete. - * @member {google.datastore.v1.IKey|null|undefined} delete - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype["delete"] = null; + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; - /** - * Mutation baseVersion. - * @member {number|Long|null|undefined} baseVersion - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.baseVersion = null; + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; - /** - * Mutation updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.updateTime = null; + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * 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); + }; - /** - * Mutation operation. - * @member {"insert"|"update"|"upsert"|"delete"|undefined} operation - * @memberof google.datastore.v1.Mutation - * @instance - */ - Object.defineProperty(Mutation.prototype, "operation", { - get: $util.oneOfGetter($oneOfFields = ["insert", "update", "upsert", "delete"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * 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; + })(); - /** - * Mutation conflictDetectionStrategy. - * @member {"baseVersion"|"updateTime"|undefined} conflictDetectionStrategy - * @memberof google.datastore.v1.Mutation - * @instance - */ - Object.defineProperty(Mutation.prototype, "conflictDetectionStrategy", { - get: $util.oneOfGetter($oneOfFields = ["baseVersion", "updateTime"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); - /** - * Creates a new Mutation instance using the specified properties. - * @function create - * @memberof google.datastore.v1.Mutation - * @static - * @param {google.datastore.v1.IMutation=} [properties] Properties to set - * @returns {google.datastore.v1.Mutation} Mutation instance - */ - Mutation.create = function create(properties) { - return new Mutation(properties); - }; + return FieldDescriptorProto; + })(); - /** - * Encodes the specified Mutation message. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.Mutation - * @static - * @param {google.datastore.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.datastore.v1.Entity.encode(message.insert, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.update != null && Object.hasOwnProperty.call(message, "update")) - $root.google.datastore.v1.Entity.encode(message.update, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.upsert != null && Object.hasOwnProperty.call(message, "upsert")) - $root.google.datastore.v1.Entity.encode(message.upsert, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - $root.google.datastore.v1.Key.encode(message["delete"], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.baseVersion != null && Object.hasOwnProperty.call(message, "baseVersion")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.baseVersion); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; + protobuf.OneofDescriptorProto = (function() { - /** - * Encodes the specified Mutation message, length delimited. Does not implicitly {@link google.datastore.v1.Mutation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.Mutation - * @static - * @param {google.datastore.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(); - }; + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ - /** - * Decodes a Mutation message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.Mutation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Mutation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: - message.insert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); - break; - case 5: - message.update = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); - break; - case 6: - message.upsert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32()); - break; - case 7: - message["delete"] = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); - break; - case 8: - message.baseVersion = reader.int64(); - break; - case 11: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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]]; + } - /** - * Decodes a Mutation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.Mutation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; - /** - * Verifies a Mutation message. - * @function verify - * @memberof google.datastore.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.datastore.v1.Entity.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.datastore.v1.Entity.verify(message.update); - if (error) - return "update." + error; - } - } - if (message.upsert != null && message.hasOwnProperty("upsert")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.datastore.v1.Entity.verify(message.upsert); - if (error) - return "upsert." + error; - } - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.operation === 1) - return "operation: multiple values"; - properties.operation = 1; - { - var error = $root.google.datastore.v1.Key.verify(message["delete"]); - if (error) - return "delete." + error; - } - } - if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) { - properties.conflictDetectionStrategy = 1; - if (!$util.isInteger(message.baseVersion) && !(message.baseVersion && $util.isInteger(message.baseVersion.low) && $util.isInteger(message.baseVersion.high))) - return "baseVersion: integer|Long expected"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - if (properties.conflictDetectionStrategy === 1) - return "conflictDetectionStrategy: multiple values"; - properties.conflictDetectionStrategy = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - } - return null; - }; + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; - /** - * Creates a Mutation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.Mutation - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.Mutation} Mutation - */ - Mutation.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.Mutation) - return object; - var message = new $root.google.datastore.v1.Mutation(); - if (object.insert != null) { - if (typeof object.insert !== "object") - throw TypeError(".google.datastore.v1.Mutation.insert: object expected"); - message.insert = $root.google.datastore.v1.Entity.fromObject(object.insert); - } - if (object.update != null) { - if (typeof object.update !== "object") - throw TypeError(".google.datastore.v1.Mutation.update: object expected"); - message.update = $root.google.datastore.v1.Entity.fromObject(object.update); - } - if (object.upsert != null) { - if (typeof object.upsert !== "object") - throw TypeError(".google.datastore.v1.Mutation.upsert: object expected"); - message.upsert = $root.google.datastore.v1.Entity.fromObject(object.upsert); - } - if (object["delete"] != null) { - if (typeof object["delete"] !== "object") - throw TypeError(".google.datastore.v1.Mutation.delete: object expected"); - message["delete"] = $root.google.datastore.v1.Key.fromObject(object["delete"]); - } - if (object.baseVersion != null) - if ($util.Long) - (message.baseVersion = $util.Long.fromValue(object.baseVersion)).unsigned = false; - else if (typeof object.baseVersion === "string") - message.baseVersion = parseInt(object.baseVersion, 10); - else if (typeof object.baseVersion === "number") - message.baseVersion = object.baseVersion; - else if (typeof object.baseVersion === "object") - message.baseVersion = new $util.LongBits(object.baseVersion.low >>> 0, object.baseVersion.high >>> 0).toNumber(); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.datastore.v1.Mutation.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - return message; - }; + /** + * 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); + }; - /** - * Creates a plain object from a Mutation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.Mutation - * @static - * @param {google.datastore.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.datastore.v1.Entity.toObject(message.insert, options); - if (options.oneofs) - object.operation = "insert"; - } - if (message.update != null && message.hasOwnProperty("update")) { - object.update = $root.google.datastore.v1.Entity.toObject(message.update, options); - if (options.oneofs) - object.operation = "update"; - } - if (message.upsert != null && message.hasOwnProperty("upsert")) { - object.upsert = $root.google.datastore.v1.Entity.toObject(message.upsert, options); - if (options.oneofs) - object.operation = "upsert"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = $root.google.datastore.v1.Key.toObject(message["delete"], options); - if (options.oneofs) - object.operation = "delete"; - } - if (message.baseVersion != null && message.hasOwnProperty("baseVersion")) { - if (typeof message.baseVersion === "number") - object.baseVersion = options.longs === String ? String(message.baseVersion) : message.baseVersion; - else - object.baseVersion = options.longs === String ? $util.Long.prototype.toString.call(message.baseVersion) : options.longs === Number ? new $util.LongBits(message.baseVersion.low >>> 0, message.baseVersion.high >>> 0).toNumber() : message.baseVersion; - if (options.oneofs) - object.conflictDetectionStrategy = "baseVersion"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (options.oneofs) - object.conflictDetectionStrategy = "updateTime"; + /** + * 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - return object; - }; - - /** - * Converts this Mutation to JSON. - * @function toJSON - * @memberof google.datastore.v1.Mutation - * @instance - * @returns {Object.} JSON object - */ - Mutation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + } + return message; + }; - return Mutation; - })(); + /** + * 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()); + }; - v1.MutationResult = (function() { + /** + * 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; + }; - /** - * Properties of a MutationResult. - * @memberof google.datastore.v1 - * @interface IMutationResult - * @property {google.datastore.v1.IKey|null} [key] MutationResult key - * @property {number|Long|null} [version] MutationResult version - * @property {google.protobuf.ITimestamp|null} [updateTime] MutationResult updateTime - * @property {boolean|null} [conflictDetected] MutationResult conflictDetected - */ + /** + * 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; + }; - /** - * Constructs a new MutationResult. - * @memberof google.datastore.v1 - * @classdesc Represents a MutationResult. - * @implements IMutationResult - * @constructor - * @param {google.datastore.v1.IMutationResult=} [properties] Properties to set - */ - function MutationResult(properties) { - if (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 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; + }; - /** - * MutationResult key. - * @member {google.datastore.v1.IKey|null|undefined} key - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.key = null; + /** + * 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); + }; - /** - * MutationResult version. - * @member {number|Long} version - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + return OneofDescriptorProto; + })(); - /** - * MutationResult updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.updateTime = null; + protobuf.EnumDescriptorProto = (function() { - /** - * MutationResult conflictDetected. - * @member {boolean} conflictDetected - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.conflictDetected = false; + /** + * 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 + */ - /** - * Creates a new MutationResult instance using the specified properties. - * @function create - * @memberof google.datastore.v1.MutationResult - * @static - * @param {google.datastore.v1.IMutationResult=} [properties] Properties to set - * @returns {google.datastore.v1.MutationResult} MutationResult instance - */ - MutationResult.create = function create(properties) { - return new MutationResult(properties); - }; + /** + * 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]]; + } - /** - * Encodes the specified MutationResult message. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.MutationResult - * @static - * @param {google.datastore.v1.IMutationResult} message MutationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - $root.google.datastore.v1.Key.encode(message.key, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.version); - if (message.conflictDetected != null && Object.hasOwnProperty.call(message, "conflictDetected")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.conflictDetected); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * 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; - /** - * Encodes the specified MutationResult message, length delimited. Does not implicitly {@link google.datastore.v1.MutationResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.MutationResult - * @static - * @param {google.datastore.v1.IMutationResult} message MutationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MutationResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - /** - * Decodes a MutationResult message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.MutationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.MutationResult} MutationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.MutationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: - message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32()); - break; - case 4: - message.version = reader.int64(); - break; - case 6: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - message.conflictDetected = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - /** - * Decodes a MutationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.MutationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.MutationResult} MutationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MutationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies a MutationResult message. - * @function verify - * @memberof google.datastore.v1.MutationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MutationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.datastore.v1.Key.verify(message.key); - if (error) - return "key." + error; - } - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isInteger(message.version) && !(message.version && $util.isInteger(message.version.low) && $util.isInteger(message.version.high))) - return "version: integer|Long expected"; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; + /** + * 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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.conflictDetected != null && message.hasOwnProperty("conflictDetected")) - if (typeof message.conflictDetected !== "boolean") - return "conflictDetected: boolean expected"; - return null; - }; + } + return message; + }; - /** - * Creates a MutationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.MutationResult - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.MutationResult} MutationResult - */ - MutationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.MutationResult) - return object; - var message = new $root.google.datastore.v1.MutationResult(); - if (object.key != null) { - if (typeof object.key !== "object") - throw TypeError(".google.datastore.v1.MutationResult.key: object expected"); - message.key = $root.google.datastore.v1.Key.fromObject(object.key); + /** + * 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 (object.version != null) - if ($util.Long) - (message.version = $util.Long.fromValue(object.version)).unsigned = false; - else if (typeof object.version === "string") - message.version = parseInt(object.version, 10); - else if (typeof object.version === "number") - message.version = object.version; - else if (typeof object.version === "object") - message.version = new $util.LongBits(object.version.low >>> 0, object.version.high >>> 0).toNumber(); - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.datastore.v1.MutationResult.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + 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 (object.conflictDetected != null) - message.conflictDetected = Boolean(object.conflictDetected); - return message; - }; + } + 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 plain object from a MutationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.MutationResult - * @static - * @param {google.datastore.v1.MutationResult} message MutationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MutationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.key = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.version = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.version = options.longs === String ? "0" : 0; - object.conflictDetected = false; - object.updateTime = null; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = $root.google.datastore.v1.Key.toObject(message.key, options); - if (message.version != null && message.hasOwnProperty("version")) - if (typeof message.version === "number") - object.version = options.longs === String ? String(message.version) : message.version; - else - object.version = options.longs === String ? $util.Long.prototype.toString.call(message.version) : options.longs === Number ? new $util.LongBits(message.version.low >>> 0, message.version.high >>> 0).toNumber() : message.version; - if (message.conflictDetected != null && message.hasOwnProperty("conflictDetected")) - object.conflictDetected = message.conflictDetected; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + /** + * 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; + }; - /** - * Converts this MutationResult to JSON. - * @function toJSON - * @memberof google.datastore.v1.MutationResult - * @instance - * @returns {Object.} JSON object - */ - MutationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return MutationResult; - })(); + /** + * 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); + }; - v1.ReadOptions = (function() { + EnumDescriptorProto.EnumReservedRange = (function() { /** - * Properties of a ReadOptions. - * @memberof google.datastore.v1 - * @interface IReadOptions - * @property {google.datastore.v1.ReadOptions.ReadConsistency|null} [readConsistency] ReadOptions readConsistency - * @property {Uint8Array|null} [transaction] ReadOptions transaction - * @property {google.protobuf.ITimestamp|null} [readTime] ReadOptions readTime + * 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 ReadOptions. - * @memberof google.datastore.v1 - * @classdesc Represents a ReadOptions. - * @implements IReadOptions + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange * @constructor - * @param {google.datastore.v1.IReadOptions=} [properties] Properties to set + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set */ - function ReadOptions(properties) { + function EnumReservedRange(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -23644,115 +20466,88 @@ } /** - * ReadOptions readConsistency. - * @member {google.datastore.v1.ReadOptions.ReadConsistency|null|undefined} readConsistency - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - ReadOptions.prototype.readConsistency = null; - - /** - * ReadOptions transaction. - * @member {Uint8Array|null|undefined} transaction - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - ReadOptions.prototype.transaction = null; - - /** - * ReadOptions readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.ReadOptions + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @instance */ - ReadOptions.prototype.readTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + EnumReservedRange.prototype.start = 0; /** - * ReadOptions consistencyType. - * @member {"readConsistency"|"transaction"|"readTime"|undefined} consistencyType - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - Object.defineProperty(ReadOptions.prototype, "consistencyType", { - get: $util.oneOfGetter($oneOfFields = ["readConsistency", "transaction", "readTime"]), - set: $util.oneOfSetter($oneOfFields) - }); + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; /** - * Creates a new ReadOptions instance using the specified properties. + * Creates a new EnumReservedRange instance using the specified properties. * @function create - * @memberof google.datastore.v1.ReadOptions + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.datastore.v1.IReadOptions=} [properties] Properties to set - * @returns {google.datastore.v1.ReadOptions} ReadOptions instance + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance */ - ReadOptions.create = function create(properties) { - return new ReadOptions(properties); + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); }; /** - * Encodes the specified ReadOptions message. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.ReadOptions + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.datastore.v1.IReadOptions} message ReadOptions message or plain object to encode + * @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 */ - ReadOptions.encode = function encode(message, writer) { + EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readConsistency != null && Object.hasOwnProperty.call(message, "readConsistency")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.readConsistency); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.transaction); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + 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 ReadOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ReadOptions.verify|verify} messages. + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.ReadOptions + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static - * @param {google.datastore.v1.IReadOptions} message ReadOptions message or plain object to encode + * @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 */ - ReadOptions.encodeDelimited = function encodeDelimited(message, writer) { + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadOptions message from the specified reader or buffer. + * Decodes an EnumReservedRange message from the specified reader or buffer. * @function decode - * @memberof google.datastore.v1.ReadOptions + * @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.datastore.v1.ReadOptions} ReadOptions + * @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 */ - ReadOptions.decode = function decode(reader, length) { + EnumReservedRange.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReadOptions(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.readConsistency = reader.int32(); + message.start = reader.int32(); break; case 2: - message.transaction = reader.bytes(); - break; - case 4: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.end = reader.int32(); break; default: reader.skipType(tag & 7); @@ -23763,6663 +20558,7594 @@ }; /** - * Decodes a ReadOptions message from the specified reader or buffer, length delimited. + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.ReadOptions + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ReadOptions} ReadOptions + * @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 */ - ReadOptions.decodeDelimited = function decodeDelimited(reader) { + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadOptions message. + * Verifies an EnumReservedRange message. * @function verify - * @memberof google.datastore.v1.ReadOptions + * @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 */ - ReadOptions.verify = function verify(message) { + EnumReservedRange.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { - properties.consistencyType = 1; - switch (message.readConsistency) { - default: - return "readConsistency: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - if (properties.consistencyType === 1) - return "consistencyType: multiple values"; - properties.consistencyType = 1; - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - if (properties.consistencyType === 1) - return "consistencyType: multiple values"; - properties.consistencyType = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - } + 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 ReadOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.ReadOptions} ReadOptions - */ - ReadOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.ReadOptions) - return object; - var message = new $root.google.datastore.v1.ReadOptions(); - switch (object.readConsistency) { - case "READ_CONSISTENCY_UNSPECIFIED": - case 0: - message.readConsistency = 0; - break; - case "STRONG": + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.readConsistency = 1; + message.name = reader.string(); break; - case "EVENTUAL": case 2: - message.readConsistency = 2; + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); break; } - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length) - message.transaction = object.transaction; - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.ReadOptions.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - return message; - }; - - /** - * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {google.datastore.v1.ReadOptions} message ReadOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { - object.readConsistency = options.enums === String ? $root.google.datastore.v1.ReadOptions.ReadConsistency[message.readConsistency] : message.readConsistency; - if (options.oneofs) - object.consistencyType = "readConsistency"; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (options.oneofs) - object.consistencyType = "transaction"; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (options.oneofs) - object.consistencyType = "readTime"; - } - return object; - }; + } + return message; + }; - /** - * Converts this ReadOptions to JSON. - * @function toJSON - * @memberof google.datastore.v1.ReadOptions - * @instance - * @returns {Object.} JSON object - */ - ReadOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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()); + }; - /** - * ReadConsistency enum. - * @name google.datastore.v1.ReadOptions.ReadConsistency - * @enum {number} - * @property {number} READ_CONSISTENCY_UNSPECIFIED=0 READ_CONSISTENCY_UNSPECIFIED value - * @property {number} STRONG=1 STRONG value - * @property {number} EVENTUAL=2 EVENTUAL value - */ - ReadOptions.ReadConsistency = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "READ_CONSISTENCY_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRONG"] = 1; - values[valuesById[2] = "EVENTUAL"] = 2; - return values; - })(); + /** + * 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; + }; - return ReadOptions; - })(); + /** + * 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; + }; - v1.TransactionOptions = (function() { + /** + * 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; + }; - /** - * Properties of a TransactionOptions. - * @memberof google.datastore.v1 - * @interface ITransactionOptions - * @property {google.datastore.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite - * @property {google.datastore.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly - */ + /** + * 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); + }; - /** - * Constructs a new TransactionOptions. - * @memberof google.datastore.v1 - * @classdesc Represents a TransactionOptions. - * @implements ITransactionOptions - * @constructor - * @param {google.datastore.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]]; - } + return EnumValueDescriptorProto; + })(); - /** - * TransactionOptions readWrite. - * @member {google.datastore.v1.TransactionOptions.IReadWrite|null|undefined} readWrite - * @memberof google.datastore.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readWrite = null; + protobuf.ServiceDescriptorProto = (function() { - /** - * TransactionOptions readOnly. - * @member {google.datastore.v1.TransactionOptions.IReadOnly|null|undefined} readOnly - * @memberof google.datastore.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readOnly = null; + /** + * 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 + */ - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * 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]]; + } - /** - * TransactionOptions mode. - * @member {"readWrite"|"readOnly"|undefined} mode - * @memberof google.datastore.v1.TransactionOptions - * @instance - */ - Object.defineProperty(TransactionOptions.prototype, "mode", { - get: $util.oneOfGetter($oneOfFields = ["readWrite", "readOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; - /** - * Creates a new TransactionOptions instance using the specified properties. - * @function create - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.v1.ITransactionOptions=} [properties] Properties to set - * @returns {google.datastore.v1.TransactionOptions} TransactionOptions instance - */ - TransactionOptions.create = function create(properties) { - return new TransactionOptions(properties); - }; + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; - /** - * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; - /** - * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.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(); - }; + /** + * 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); + }; - /** - * Decodes a TransactionOptions message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); - break; - case 2: - message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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; + }; - /** - * Decodes a TransactionOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * 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(); + }; - /** - * Verifies a TransactionOptions message. - * @function verify - * @memberof google.datastore.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.datastore.v1.TransactionOptions.ReadWrite.verify(message.readWrite); - if (error) - return "readWrite." + error; - } - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - if (properties.mode === 1) - return "mode: multiple values"; - properties.mode = 1; - { - var error = $root.google.datastore.v1.TransactionOptions.ReadOnly.verify(message.readOnly); - if (error) - return "readOnly." + error; - } + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } - return null; - }; + } + return message; + }; - /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.TransactionOptions} TransactionOptions - */ - TransactionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.TransactionOptions) - return object; - var message = new $root.google.datastore.v1.TransactionOptions(); - if (object.readWrite != null) { - if (typeof object.readWrite !== "object") - throw TypeError(".google.datastore.v1.TransactionOptions.readWrite: object expected"); - message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); - } - if (object.readOnly != null) { - if (typeof object.readOnly !== "object") - throw TypeError(".google.datastore.v1.TransactionOptions.readOnly: object expected"); - message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); - } - 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()); + }; - /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.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 (message.readWrite != null && message.hasOwnProperty("readWrite")) { - object.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); - if (options.oneofs) - object.mode = "readWrite"; - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - object.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); - if (options.oneofs) - object.mode = "readOnly"; + /** + * 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; } - return object; - }; + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; - /** - * Converts this TransactionOptions to JSON. - * @function toJSON - * @memberof google.datastore.v1.TransactionOptions - * @instance - * @returns {Object.} JSON object - */ - TransactionOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - TransactionOptions.ReadWrite = (function() { + /** + * 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; + }; - /** - * Properties of a ReadWrite. - * @memberof google.datastore.v1.TransactionOptions - * @interface IReadWrite - * @property {Uint8Array|null} [previousTransaction] ReadWrite previousTransaction - */ + /** + * 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); + }; - /** - * Constructs a new ReadWrite. - * @memberof google.datastore.v1.TransactionOptions - * @classdesc Represents a ReadWrite. - * @implements IReadWrite - * @constructor - * @param {google.datastore.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]]; - } + return ServiceDescriptorProto; + })(); - /** - * ReadWrite previousTransaction. - * @member {Uint8Array} previousTransaction - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @instance - */ - ReadWrite.prototype.previousTransaction = $util.newBuffer([]); + protobuf.MethodDescriptorProto = (function() { - /** - * Creates a new ReadWrite instance using the specified properties. - * @function create - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set - * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite instance - */ - ReadWrite.create = function create(properties) { - return new ReadWrite(properties); - }; + /** + * 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 + */ - /** - * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.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.previousTransaction != null && Object.hasOwnProperty.call(message, "previousTransaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.previousTransaction); - return writer; - }; + /** + * 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]]; + } - /** - * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.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(); - }; + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; - /** - * Decodes a ReadWrite message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.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.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.previousTransaction = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; - /** - * Decodes a ReadWrite message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; - /** - * Verifies a ReadWrite message. - * @function verify - * @memberof google.datastore.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.previousTransaction != null && message.hasOwnProperty("previousTransaction")) - if (!(message.previousTransaction && typeof message.previousTransaction.length === "number" || $util.isString(message.previousTransaction))) - return "previousTransaction: buffer expected"; - return null; - }; + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite - */ - ReadWrite.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadWrite) - return object; - var message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); - if (object.previousTransaction != null) - if (typeof object.previousTransaction === "string") - $util.base64.decode(object.previousTransaction, message.previousTransaction = $util.newBuffer($util.base64.length(object.previousTransaction)), 0); - else if (object.previousTransaction.length) - message.previousTransaction = object.previousTransaction; - return message; - }; + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.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) - if (options.bytes === String) - object.previousTransaction = ""; - else { - object.previousTransaction = []; - if (options.bytes !== Array) - object.previousTransaction = $util.newBuffer(object.previousTransaction); - } - if (message.previousTransaction != null && message.hasOwnProperty("previousTransaction")) - object.previousTransaction = options.bytes === String ? $util.base64.encode(message.previousTransaction, 0, message.previousTransaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.previousTransaction) : message.previousTransaction; - return object; - }; + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; - /** - * Converts this ReadWrite to JSON. - * @function toJSON - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @instance - * @returns {Object.} JSON object - */ - ReadWrite.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; - return ReadWrite; - })(); + /** + * 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; + }; - TransactionOptions.ReadOnly = (function() { + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a ReadOnly. - * @memberof google.datastore.v1.TransactionOptions - * @interface IReadOnly - * @property {google.protobuf.ITimestamp|null} [readTime] ReadOnly readTime - */ + /** + * 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()); + }; - /** - * Constructs a new ReadOnly. - * @memberof google.datastore.v1.TransactionOptions - * @classdesc Represents a ReadOnly. - * @implements IReadOnly - * @constructor - * @param {google.datastore.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]]; - } + /** + * 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; + }; - /** - * ReadOnly readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.readTime = 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 new ReadOnly instance using the specified properties. - * @function create - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.v1.TransactionOptions.IReadOnly=} [properties] Properties to set - * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly instance - */ - ReadOnly.create = function create(properties) { - return new ReadOnly(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.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.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * 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); + }; - /** - * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.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(); - }; + return MethodDescriptorProto; + })(); - /** - * Decodes a ReadOnly message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.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.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + protobuf.FileOptions = (function() { - /** - * Decodes a ReadOnly message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + */ - /** - * Verifies a ReadOnly message. - * @function verify - * @memberof google.datastore.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"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - return null; - }; + /** + * 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 = []; + if (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 ReadOnly message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly - */ - ReadOnly.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadOnly) - return object; - var message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.TransactionOptions.ReadOnly.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - return message; - }; + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; - /** - * Creates a plain object from a ReadOnly message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.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.readTime = null; - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - return object; - }; + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; - /** - * Converts this ReadOnly to JSON. - * @function toJSON - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @instance - * @returns {Object.} JSON object - */ - ReadOnly.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; - return ReadOnly; - })(); + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; - return TransactionOptions; - })(); + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; - return v1; - })(); + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; - datastore.admin = (function() { + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; /** - * Namespace admin. - * @memberof google.datastore - * @namespace + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance */ - var admin = {}; + FileOptions.prototype.ccGenericServices = false; - admin.v1 = (function() { + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; - /** - * Namespace v1. - * @memberof google.datastore.admin - * @namespace - */ - var v1 = {}; + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; - v1.MigrationStateEvent = (function() { + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; - /** - * Properties of a MigrationStateEvent. - * @memberof google.datastore.admin.v1 - * @interface IMigrationStateEvent - * @property {google.datastore.admin.v1.MigrationState|null} [state] MigrationStateEvent state - */ + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; - /** - * Constructs a new MigrationStateEvent. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a MigrationStateEvent. - * @implements IMigrationStateEvent - * @constructor - * @param {google.datastore.admin.v1.IMigrationStateEvent=} [properties] Properties to set - */ - function MigrationStateEvent(properties) { - if (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 ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; - /** - * MigrationStateEvent state. - * @member {google.datastore.admin.v1.MigrationState} state - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @instance - */ - MigrationStateEvent.prototype.state = 0; + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; - /** - * Creates a new MigrationStateEvent instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {google.datastore.admin.v1.IMigrationStateEvent=} [properties] Properties to set - * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent instance - */ - MigrationStateEvent.create = function create(properties) { - return new MigrationStateEvent(properties); - }; + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; - /** - * Encodes the specified MigrationStateEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {google.datastore.admin.v1.IMigrationStateEvent} message MigrationStateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationStateEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); - return writer; - }; + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; - /** - * Encodes the specified MigrationStateEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationStateEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {google.datastore.admin.v1.IMigrationStateEvent} message MigrationStateEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationStateEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; - /** - * Decodes a MigrationStateEvent message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationStateEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationStateEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.state = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; - /** - * Decodes a MigrationStateEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationStateEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; - /** - * Verifies a MigrationStateEvent message. - * @function verify - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MigrationStateEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object 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; - } - return null; - }; + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; - /** - * Creates a MigrationStateEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.MigrationStateEvent} MigrationStateEvent - */ - MigrationStateEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.MigrationStateEvent) - return object; - var message = new $root.google.datastore.admin.v1.MigrationStateEvent(); - switch (object.state) { - case "MIGRATION_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "RUNNING": - case 1: - message.state = 1; - break; - case "PAUSED": - case 2: - message.state = 2; - break; - case "COMPLETE": - case 3: - message.state = 3; - break; - } - return message; - }; + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Creates a plain object from a MigrationStateEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {google.datastore.admin.v1.MigrationStateEvent} message MigrationStateEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MigrationStateEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.state = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.state] : message.state; - return object; - }; + /** + * 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.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Converts this MigrationStateEvent to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @instance - * @returns {Object.} JSON object - */ - MigrationStateEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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(); + }; - return MigrationStateEvent; - })(); + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - v1.MigrationProgressEvent = (function() { + /** + * 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()); + }; - /** - * Properties of a MigrationProgressEvent. - * @memberof google.datastore.admin.v1 - * @interface IMigrationProgressEvent - * @property {google.datastore.admin.v1.MigrationStep|null} [step] MigrationProgressEvent step - * @property {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null} [prepareStepDetails] MigrationProgressEvent prepareStepDetails - * @property {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null} [redirectWritesStepDetails] MigrationProgressEvent redirectWritesStepDetails - */ + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - /** - * Constructs a new MigrationProgressEvent. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a MigrationProgressEvent. - * @implements IMigrationProgressEvent - * @constructor - * @param {google.datastore.admin.v1.IMigrationProgressEvent=} [properties] Properties to set - */ - function MigrationProgressEvent(properties) { - if (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 FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); } + } + return message; + }; - /** - * MigrationProgressEvent step. - * @member {google.datastore.admin.v1.MigrationStep} step - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - */ - MigrationProgressEvent.prototype.step = 0; - - /** - * MigrationProgressEvent prepareStepDetails. - * @member {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails|null|undefined} prepareStepDetails - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - */ - MigrationProgressEvent.prototype.prepareStepDetails = null; - - /** - * MigrationProgressEvent redirectWritesStepDetails. - * @member {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails|null|undefined} redirectWritesStepDetails - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - */ - MigrationProgressEvent.prototype.redirectWritesStepDetails = null; + /** + * 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 = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * 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); + }; - /** - * MigrationProgressEvent stepDetails. - * @member {"prepareStepDetails"|"redirectWritesStepDetails"|undefined} stepDetails - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - */ - Object.defineProperty(MigrationProgressEvent.prototype, "stepDetails", { - get: $util.oneOfGetter($oneOfFields = ["prepareStepDetails", "redirectWritesStepDetails"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * 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; + })(); - /** - * Creates a new MigrationProgressEvent instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {google.datastore.admin.v1.IMigrationProgressEvent=} [properties] Properties to set - * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent instance - */ - MigrationProgressEvent.create = function create(properties) { - return new MigrationProgressEvent(properties); - }; + return FileOptions; + })(); - /** - * Encodes the specified MigrationProgressEvent message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {google.datastore.admin.v1.IMigrationProgressEvent} message MigrationProgressEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationProgressEvent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.step != null && Object.hasOwnProperty.call(message, "step")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.step); - if (message.prepareStepDetails != null && Object.hasOwnProperty.call(message, "prepareStepDetails")) - $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.encode(message.prepareStepDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.redirectWritesStepDetails != null && Object.hasOwnProperty.call(message, "redirectWritesStepDetails")) - $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.encode(message.redirectWritesStepDetails, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + protobuf.MessageOptions = (function() { - /** - * Encodes the specified MigrationProgressEvent message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {google.datastore.admin.v1.IMigrationProgressEvent} message MigrationProgressEvent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MigrationProgressEvent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + */ - /** - * Decodes a MigrationProgressEvent message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationProgressEvent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.step = reader.int32(); - break; - case 2: - message.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.decode(reader, reader.uint32()); - break; - case 3: - message.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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]]; + } - /** - * Decodes a MigrationProgressEvent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MigrationProgressEvent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; - /** - * Verifies a MigrationProgressEvent message. - * @function verify - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MigrationProgressEvent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.step != null && message.hasOwnProperty("step")) - switch (message.step) { - default: - return "step: enum value expected"; - case 0: - case 6: - case 1: - case 7: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { - properties.stepDetails = 1; - { - var error = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify(message.prepareStepDetails); - if (error) - return "prepareStepDetails." + error; - } - } - if (message.redirectWritesStepDetails != null && message.hasOwnProperty("redirectWritesStepDetails")) { - if (properties.stepDetails === 1) - return "stepDetails: multiple values"; - properties.stepDetails = 1; - { - var error = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify(message.redirectWritesStepDetails); - if (error) - return "redirectWritesStepDetails." + error; - } - } - return null; - }; + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; - /** - * Creates a MigrationProgressEvent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.MigrationProgressEvent} MigrationProgressEvent - */ - MigrationProgressEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent) - return object; - var message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); - switch (object.step) { - case "MIGRATION_STEP_UNSPECIFIED": - case 0: - message.step = 0; - break; - case "PREPARE": - case 6: - message.step = 6; - break; - case "START": - case 1: - message.step = 1; - break; - case "APPLY_WRITES_SYNCHRONOUSLY": - case 7: - message.step = 7; - break; - case "COPY_AND_VERIFY": - case 2: - message.step = 2; - break; - case "REDIRECT_EVENTUALLY_CONSISTENT_READS": - case 3: - message.step = 3; - break; - case "REDIRECT_STRONGLY_CONSISTENT_READS": - case 4: - message.step = 4; - break; - case "REDIRECT_WRITES": - case 5: - message.step = 5; - break; - } - if (object.prepareStepDetails != null) { - if (typeof object.prepareStepDetails !== "object") - throw TypeError(".google.datastore.admin.v1.MigrationProgressEvent.prepareStepDetails: object expected"); - message.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.fromObject(object.prepareStepDetails); - } - if (object.redirectWritesStepDetails != null) { - if (typeof object.redirectWritesStepDetails !== "object") - throw TypeError(".google.datastore.admin.v1.MigrationProgressEvent.redirectWritesStepDetails: object expected"); - message.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.fromObject(object.redirectWritesStepDetails); - } - return message; - }; + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; - /** - * Creates a plain object from a MigrationProgressEvent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent} message MigrationProgressEvent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MigrationProgressEvent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.step = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; - if (message.step != null && message.hasOwnProperty("step")) - object.step = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.step] : message.step; - if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { - object.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.toObject(message.prepareStepDetails, options); - if (options.oneofs) - object.stepDetails = "prepareStepDetails"; - } - if (message.redirectWritesStepDetails != null && message.hasOwnProperty("redirectWritesStepDetails")) { - object.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.toObject(message.redirectWritesStepDetails, options); - if (options.oneofs) - object.stepDetails = "redirectWritesStepDetails"; - } - return object; - }; + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; - /** - * Converts this MigrationProgressEvent to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @instance - * @returns {Object.} JSON object - */ - MigrationProgressEvent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * 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); + }; - /** - * ConcurrencyMode enum. - * @name google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode - * @enum {number} - * @property {number} CONCURRENCY_MODE_UNSPECIFIED=0 CONCURRENCY_MODE_UNSPECIFIED value - * @property {number} PESSIMISTIC=1 PESSIMISTIC value - * @property {number} OPTIMISTIC=2 OPTIMISTIC value - * @property {number} OPTIMISTIC_WITH_ENTITY_GROUPS=3 OPTIMISTIC_WITH_ENTITY_GROUPS value - */ - MigrationProgressEvent.ConcurrencyMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONCURRENCY_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PESSIMISTIC"] = 1; - values[valuesById[2] = "OPTIMISTIC"] = 2; - values[valuesById[3] = "OPTIMISTIC_WITH_ENTITY_GROUPS"] = 3; - return values; - })(); + /** + * 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.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; + }; - MigrationProgressEvent.PrepareStepDetails = (function() { + /** + * 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(); + }; - /** - * Properties of a PrepareStepDetails. - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @interface IPrepareStepDetails - * @property {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null} [concurrencyMode] PrepareStepDetails concurrencyMode - */ + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new PrepareStepDetails. - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @classdesc Represents a PrepareStepDetails. - * @implements IPrepareStepDetails - * @constructor - * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails=} [properties] Properties to set - */ - function PrepareStepDetails(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes a 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()); + }; - /** - * PrepareStepDetails concurrencyMode. - * @member {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} concurrencyMode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @instance - */ - PrepareStepDetails.prototype.concurrencyMode = 0; + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - /** - * Creates a new PrepareStepDetails instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails=} [properties] Properties to set - * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails instance - */ - PrepareStepDetails.create = function create(properties) { - return new PrepareStepDetails(properties); - }; + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * Encodes the specified PrepareStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails} message PrepareStepDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrepareStepDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.concurrencyMode != null && Object.hasOwnProperty.call(message, "concurrencyMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.concurrencyMode); - return writer; - }; + /** + * 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; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * Encodes the specified PrepareStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IPrepareStepDetails} message PrepareStepDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PrepareStepDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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); + }; - /** - * Decodes a PrepareStepDetails message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrepareStepDetails.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.concurrencyMode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return MessageOptions; + })(); - /** - * Decodes a PrepareStepDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PrepareStepDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + protobuf.FieldOptions = (function() { - /** - * Verifies a PrepareStepDetails message. - * @function verify - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PrepareStepDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - switch (message.concurrencyMode) { - default: - return "concurrencyMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + */ - /** - * Creates a PrepareStepDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} PrepareStepDetails - */ - PrepareStepDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) - return object; - var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); - switch (object.concurrencyMode) { - case "CONCURRENCY_MODE_UNSPECIFIED": - case 0: - message.concurrencyMode = 0; - break; - case "PESSIMISTIC": - case 1: - message.concurrencyMode = 1; - break; - case "OPTIMISTIC": - case 2: - message.concurrencyMode = 2; - break; - case "OPTIMISTIC_WITH_ENTITY_GROUPS": - case 3: - message.concurrencyMode = 3; - break; - } - return message; - }; + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a plain object from a PrepareStepDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails} message PrepareStepDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PrepareStepDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; - if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; - return object; - }; + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; - /** - * Converts this PrepareStepDetails to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @instance - * @returns {Object.} JSON object - */ - PrepareStepDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; - return PrepareStepDetails; - })(); + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; - MigrationProgressEvent.RedirectWritesStepDetails = (function() { + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; - /** - * Properties of a RedirectWritesStepDetails. - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @interface IRedirectWritesStepDetails - * @property {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|null} [concurrencyMode] RedirectWritesStepDetails concurrencyMode - */ + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; - /** - * Constructs a new RedirectWritesStepDetails. - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @classdesc Represents a RedirectWritesStepDetails. - * @implements IRedirectWritesStepDetails - * @constructor - * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails=} [properties] Properties to set - */ - function RedirectWritesStepDetails(properties) { - if (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 weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; - /** - * RedirectWritesStepDetails concurrencyMode. - * @member {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} concurrencyMode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @instance - */ - RedirectWritesStepDetails.prototype.concurrencyMode = 0; + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Creates a new RedirectWritesStepDetails instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails=} [properties] Properties to set - * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails instance - */ - RedirectWritesStepDetails.create = function create(properties) { - return new RedirectWritesStepDetails(properties); - }; + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - /** - * Encodes the specified RedirectWritesStepDetails message. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails} message RedirectWritesStepDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedirectWritesStepDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.concurrencyMode != null && Object.hasOwnProperty.call(message, "concurrencyMode")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.concurrencyMode); - return writer; - }; + /** + * 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 RedirectWritesStepDetails message, length delimited. Does not implicitly {@link google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.IRedirectWritesStepDetails} message RedirectWritesStepDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RedirectWritesStepDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + return writer; + }; - /** - * Decodes a RedirectWritesStepDetails message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedirectWritesStepDetails.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.concurrencyMode = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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 RedirectWritesStepDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RedirectWritesStepDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1052: + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + return null; + }; - /** - * Verifies a RedirectWritesStepDetails message. - * @function verify - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RedirectWritesStepDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - switch (message.concurrencyMode) { - default: - return "concurrencyMode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + return message; + }; - /** - * Creates a RedirectWritesStepDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} RedirectWritesStepDetails - */ - RedirectWritesStepDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) - return object; - var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); - switch (object.concurrencyMode) { - case "CONCURRENCY_MODE_UNSPECIFIED": - case 0: - message.concurrencyMode = 0; - break; - case "PESSIMISTIC": - case 1: - message.concurrencyMode = 1; - break; - case "OPTIMISTIC": - case 2: - message.concurrencyMode = 2; - break; - case "OPTIMISTIC_WITH_ENTITY_GROUPS": - case 3: - message.concurrencyMode = 3; - break; - } - return message; - }; + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + return object; + }; - /** - * Creates a plain object from a RedirectWritesStepDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails} message RedirectWritesStepDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RedirectWritesStepDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; - if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; - 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); + }; - /** - * Converts this RedirectWritesStepDetails to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @instance - * @returns {Object.} JSON object - */ - RedirectWritesStepDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); - return RedirectWritesStepDetails; - })(); + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); - return MigrationProgressEvent; - })(); + return FieldOptions; + })(); - /** - * MigrationState enum. - * @name google.datastore.admin.v1.MigrationState - * @enum {number} - * @property {number} MIGRATION_STATE_UNSPECIFIED=0 MIGRATION_STATE_UNSPECIFIED value - * @property {number} RUNNING=1 RUNNING value - * @property {number} PAUSED=2 PAUSED value - * @property {number} COMPLETE=3 COMPLETE value - */ - v1.MigrationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MIGRATION_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "RUNNING"] = 1; - values[valuesById[2] = "PAUSED"] = 2; - values[valuesById[3] = "COMPLETE"] = 3; - return values; - })(); + protobuf.OneofOptions = (function() { - /** - * MigrationStep enum. - * @name google.datastore.admin.v1.MigrationStep - * @enum {number} - * @property {number} MIGRATION_STEP_UNSPECIFIED=0 MIGRATION_STEP_UNSPECIFIED value - * @property {number} PREPARE=6 PREPARE value - * @property {number} START=1 START value - * @property {number} APPLY_WRITES_SYNCHRONOUSLY=7 APPLY_WRITES_SYNCHRONOUSLY value - * @property {number} COPY_AND_VERIFY=2 COPY_AND_VERIFY value - * @property {number} REDIRECT_EVENTUALLY_CONSISTENT_READS=3 REDIRECT_EVENTUALLY_CONSISTENT_READS value - * @property {number} REDIRECT_STRONGLY_CONSISTENT_READS=4 REDIRECT_STRONGLY_CONSISTENT_READS value - * @property {number} REDIRECT_WRITES=5 REDIRECT_WRITES value - */ - v1.MigrationStep = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MIGRATION_STEP_UNSPECIFIED"] = 0; - values[valuesById[6] = "PREPARE"] = 6; - values[valuesById[1] = "START"] = 1; - values[valuesById[7] = "APPLY_WRITES_SYNCHRONOUSLY"] = 7; - values[valuesById[2] = "COPY_AND_VERIFY"] = 2; - values[valuesById[3] = "REDIRECT_EVENTUALLY_CONSISTENT_READS"] = 3; - values[valuesById[4] = "REDIRECT_STRONGLY_CONSISTENT_READS"] = 4; - values[valuesById[5] = "REDIRECT_WRITES"] = 5; - return values; - })(); + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ - v1.DatastoreAdmin = (function() { + /** + * 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]]; + } - /** - * Constructs a new DatastoreAdmin service. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a DatastoreAdmin - * @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 DatastoreAdmin(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - (DatastoreAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatastoreAdmin; + /** + * 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); + }; - /** - * Creates new DatastoreAdmin service using the specified rpc implementation. - * @function create - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @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 {DatastoreAdmin} RPC service. Useful where requests and/or responses are streamed. - */ - DatastoreAdmin.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#exportEntities}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef ExportEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * 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(); + }; - /** - * Calls ExportEntities. - * @function exportEntities - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IExportEntitiesRequest} request ExportEntitiesRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.ExportEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.exportEntities = function exportEntities(request, callback) { - return this.rpcCall(exportEntities, $root.google.datastore.admin.v1.ExportEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportEntities" }); + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls ExportEntities. - * @function exportEntities - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IExportEntitiesRequest} request ExportEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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()); + }; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#importEntities}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef ImportEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - /** - * Calls ImportEntities. - * @function importEntities - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IImportEntitiesRequest} request ImportEntitiesRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.ImportEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.importEntities = function importEntities(request, callback) { - return this.rpcCall(importEntities, $root.google.datastore.admin.v1.ImportEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportEntities" }); + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * Calls ImportEntities. - * @function importEntities - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IImportEntitiesRequest} request ImportEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#createIndex}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef CreateIndexCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * 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); + }; - /** - * Calls CreateIndex. - * @function createIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.ICreateIndexRequest} request CreateIndexRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.CreateIndexCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.createIndex = function createIndex(request, callback) { - return this.rpcCall(createIndex, $root.google.datastore.admin.v1.CreateIndexRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateIndex" }); + return OneofOptions; + })(); - /** - * Calls CreateIndex. - * @function createIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.ICreateIndexRequest} request CreateIndexRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + protobuf.EnumOptions = (function() { - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#deleteIndex}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef DeleteIndexCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ - /** - * Calls DeleteIndex. - * @function deleteIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IDeleteIndexRequest} request DeleteIndexRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.DeleteIndexCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.deleteIndex = function deleteIndex(request, callback) { - return this.rpcCall(deleteIndex, $root.google.datastore.admin.v1.DeleteIndexRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteIndex" }); + /** + * 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]]; + } - /** - * Calls DeleteIndex. - * @function deleteIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IDeleteIndexRequest} request DeleteIndexRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#getIndex}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef GetIndexCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.admin.v1.Index} [response] Index - */ + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Calls GetIndex. - * @function getIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IGetIndexRequest} request GetIndexRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.GetIndexCallback} callback Node-style callback called with the error, if any, and Index - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.getIndex = function getIndex(request, callback) { - return this.rpcCall(getIndex, $root.google.datastore.admin.v1.GetIndexRequest, $root.google.datastore.admin.v1.Index, request, callback); - }, "name", { value: "GetIndex" }); + /** + * 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); + }; - /** - * Calls GetIndex. - * @function getIndex - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IGetIndexRequest} request GetIndexRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Callback as used by {@link google.datastore.admin.v1.DatastoreAdmin#listIndexes}. - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @typedef ListIndexesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.datastore.admin.v1.ListIndexesResponse} [response] ListIndexesResponse - */ + /** + * 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(); + }; - /** - * Calls ListIndexes. - * @function listIndexes - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IListIndexesRequest} request ListIndexesRequest message or plain object - * @param {google.datastore.admin.v1.DatastoreAdmin.ListIndexesCallback} callback Node-style callback called with the error, if any, and ListIndexesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(DatastoreAdmin.prototype.listIndexes = function listIndexes(request, callback) { - return this.rpcCall(listIndexes, $root.google.datastore.admin.v1.ListIndexesRequest, $root.google.datastore.admin.v1.ListIndexesResponse, request, callback); - }, "name", { value: "ListIndexes" }); + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls ListIndexes. - * @function listIndexes - * @memberof google.datastore.admin.v1.DatastoreAdmin - * @instance - * @param {google.datastore.admin.v1.IListIndexesRequest} request ListIndexesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * 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()); + }; - return DatastoreAdmin; - })(); + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - v1.CommonMetadata = (function() { + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; - /** - * Properties of a CommonMetadata. - * @memberof google.datastore.admin.v1 - * @interface ICommonMetadata - * @property {google.protobuf.ITimestamp|null} [startTime] CommonMetadata startTime - * @property {google.protobuf.ITimestamp|null} [endTime] CommonMetadata endTime - * @property {google.datastore.admin.v1.OperationType|null} [operationType] CommonMetadata operationType - * @property {Object.|null} [labels] CommonMetadata labels - * @property {google.datastore.admin.v1.CommonMetadata.State|null} [state] CommonMetadata state - */ + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new CommonMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a CommonMetadata. - * @implements ICommonMetadata - * @constructor - * @param {google.datastore.admin.v1.ICommonMetadata=} [properties] Properties to set - */ - function CommonMetadata(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]]; - } + return EnumOptions; + })(); - /** - * CommonMetadata startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.startTime = null; + protobuf.EnumValueOptions = (function() { - /** - * CommonMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.endTime = null; + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ - /** - * CommonMetadata operationType. - * @member {google.datastore.admin.v1.OperationType} operationType - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.operationType = 0; + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * CommonMetadata labels. - * @member {Object.} labels - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.labels = $util.emptyObject; + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; - /** - * CommonMetadata state. - * @member {google.datastore.admin.v1.CommonMetadata.State} state - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - */ - CommonMetadata.prototype.state = 0; + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Creates a new CommonMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {google.datastore.admin.v1.ICommonMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata instance - */ - CommonMetadata.create = function create(properties) { - return new CommonMetadata(properties); - }; + /** + * 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 CommonMetadata message. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {google.datastore.admin.v1.ICommonMetadata} message CommonMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonMetadata.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.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.operationType != null && Object.hasOwnProperty.call(message, "operationType")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.operationType); - 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(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - return writer; - }; + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified CommonMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CommonMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {google.datastore.admin.v1.ICommonMetadata} message CommonMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 a CommonMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.CommonMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 3: - message.operationType = reader.int32(); - 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; - case 5: - message.state = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a CommonMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 a CommonMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonMetadata.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.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.operationType != null && message.hasOwnProperty("operationType")) - switch (message.operationType) { - default: - return "operationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - 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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - return null; - }; + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; - /** - * Creates a CommonMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.CommonMetadata} CommonMetadata - */ - CommonMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.CommonMetadata) - return object; - var message = new $root.google.datastore.admin.v1.CommonMetadata(); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.datastore.admin.v1.CommonMetadata.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.datastore.admin.v1.CommonMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - switch (object.operationType) { - case "OPERATION_TYPE_UNSPECIFIED": - case 0: - message.operationType = 0; - break; - case "EXPORT_ENTITIES": - case 1: - message.operationType = 1; - break; - case "IMPORT_ENTITIES": - case 2: - message.operationType = 2; - break; - case "CREATE_INDEX": - case 3: - message.operationType = 3; - break; - case "DELETE_INDEX": - case 4: - message.operationType = 4; - break; - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.datastore.admin.v1.CommonMetadata.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.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "INITIALIZING": - case 1: - message.state = 1; - break; - case "PROCESSING": - case 2: - message.state = 2; - break; - case "CANCELLING": - case 3: - message.state = 3; - break; - case "FINALIZING": - case 4: - message.state = 4; - break; - case "SUCCESSFUL": - case 5: - message.state = 5; - break; - case "FAILED": - case 6: - message.state = 6; - break; - case "CANCELLED": - case 7: - message.state = 7; - break; - } - return message; - }; + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; - /** - * Creates a plain object from a CommonMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {google.datastore.admin.v1.CommonMetadata} message CommonMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.startTime = null; - object.endTime = null; - object.operationType = options.enums === String ? "OPERATION_TYPE_UNSPECIFIED" : 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.datastore.admin.v1.OperationType[message.operationType] : message.operationType; - 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.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.CommonMetadata.State[message.state] : message.state; - 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); + }; - /** - * Converts this CommonMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.CommonMetadata - * @instance - * @returns {Object.} JSON object - */ - CommonMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return EnumValueOptions; + })(); - /** - * State enum. - * @name google.datastore.admin.v1.CommonMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} INITIALIZING=1 INITIALIZING value - * @property {number} PROCESSING=2 PROCESSING value - * @property {number} CANCELLING=3 CANCELLING value - * @property {number} FINALIZING=4 FINALIZING value - * @property {number} SUCCESSFUL=5 SUCCESSFUL value - * @property {number} FAILED=6 FAILED value - * @property {number} CANCELLED=7 CANCELLED value - */ - CommonMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INITIALIZING"] = 1; - values[valuesById[2] = "PROCESSING"] = 2; - values[valuesById[3] = "CANCELLING"] = 3; - values[valuesById[4] = "FINALIZING"] = 4; - values[valuesById[5] = "SUCCESSFUL"] = 5; - values[valuesById[6] = "FAILED"] = 6; - values[valuesById[7] = "CANCELLED"] = 7; - return values; - })(); + protobuf.ServiceOptions = (function() { - return CommonMetadata; - })(); + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ - v1.Progress = (function() { + /** + * 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]]; + } - /** - * Properties of a Progress. - * @memberof google.datastore.admin.v1 - * @interface IProgress - * @property {number|Long|null} [workCompleted] Progress workCompleted - * @property {number|Long|null} [workEstimated] Progress workEstimated - */ + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 1049: + message[".google.api.defaultHost"] = reader.string(); + break; + case 1050: + message[".google.api.oauthScopes"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new Progress. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a Progress. - * @implements IProgress - * @constructor - * @param {google.datastore.admin.v1.IProgress=} [properties] Properties to set - */ - function Progress(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; - /** - * Progress workCompleted. - * @member {number|Long} workCompleted - * @memberof google.datastore.admin.v1.Progress - * @instance - */ - Progress.prototype.workCompleted = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; - /** - * Progress workEstimated. - * @member {number|Long} workEstimated - * @memberof google.datastore.admin.v1.Progress - * @instance - */ - Progress.prototype.workEstimated = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; - /** - * Creates a new Progress instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {google.datastore.admin.v1.IProgress=} [properties] Properties to set - * @returns {google.datastore.admin.v1.Progress} Progress instance - */ - Progress.create = function create(properties) { - return new Progress(properties); - }; + /** + * 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); + }; - /** - * Encodes the specified Progress message. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {google.datastore.admin.v1.IProgress} message Progress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Progress.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.workCompleted != null && Object.hasOwnProperty.call(message, "workCompleted")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.workCompleted); - if (message.workEstimated != null && Object.hasOwnProperty.call(message, "workEstimated")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.workEstimated); - return writer; - }; + return ServiceOptions; + })(); - /** - * Encodes the specified Progress message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Progress.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {google.datastore.admin.v1.IProgress} message Progress message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Progress.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + protobuf.MethodOptions = (function() { - /** - * Decodes a Progress message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.Progress} Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Progress.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Progress(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.workCompleted = reader.int64(); - break; - case 2: - message.workEstimated = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ - /** - * Decodes a Progress message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.Progress} Progress - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Progress.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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]]; + } - /** - * Verifies a Progress message. - * @function verify - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Progress.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.workCompleted != null && message.hasOwnProperty("workCompleted")) - if (!$util.isInteger(message.workCompleted) && !(message.workCompleted && $util.isInteger(message.workCompleted.low) && $util.isInteger(message.workCompleted.high))) - return "workCompleted: integer|Long expected"; - if (message.workEstimated != null && message.hasOwnProperty("workEstimated")) - if (!$util.isInteger(message.workEstimated) && !(message.workEstimated && $util.isInteger(message.workEstimated.low) && $util.isInteger(message.workEstimated.high))) - return "workEstimated: integer|Long expected"; - return null; - }; + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; - /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.Progress} Progress - */ - Progress.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.Progress) - return object; - var message = new $root.google.datastore.admin.v1.Progress(); - if (object.workCompleted != null) - if ($util.Long) - (message.workCompleted = $util.Long.fromValue(object.workCompleted)).unsigned = false; - else if (typeof object.workCompleted === "string") - message.workCompleted = parseInt(object.workCompleted, 10); - else if (typeof object.workCompleted === "number") - message.workCompleted = object.workCompleted; - else if (typeof object.workCompleted === "object") - message.workCompleted = new $util.LongBits(object.workCompleted.low >>> 0, object.workCompleted.high >>> 0).toNumber(); - if (object.workEstimated != null) - if ($util.Long) - (message.workEstimated = $util.Long.fromValue(object.workEstimated)).unsigned = false; - else if (typeof object.workEstimated === "string") - message.workEstimated = parseInt(object.workEstimated, 10); - else if (typeof object.workEstimated === "number") - message.workEstimated = object.workEstimated; - else if (typeof object.workEstimated === "object") - message.workEstimated = new $util.LongBits(object.workEstimated.low >>> 0, object.workEstimated.high >>> 0).toNumber(); - return message; - }; + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; - /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {google.datastore.admin.v1.Progress} message Progress - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Progress.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.workCompleted = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.workCompleted = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.workEstimated = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.workEstimated = options.longs === String ? "0" : 0; - } - if (message.workCompleted != null && message.hasOwnProperty("workCompleted")) - if (typeof message.workCompleted === "number") - object.workCompleted = options.longs === String ? String(message.workCompleted) : message.workCompleted; - else - object.workCompleted = options.longs === String ? $util.Long.prototype.toString.call(message.workCompleted) : options.longs === Number ? new $util.LongBits(message.workCompleted.low >>> 0, message.workCompleted.high >>> 0).toNumber() : message.workCompleted; - if (message.workEstimated != null && message.hasOwnProperty("workEstimated")) - if (typeof message.workEstimated === "number") - object.workEstimated = options.longs === String ? String(message.workEstimated) : message.workEstimated; - else - object.workEstimated = options.longs === String ? $util.Long.prototype.toString.call(message.workEstimated) : options.longs === Number ? new $util.LongBits(message.workEstimated.low >>> 0, message.workEstimated.high >>> 0).toNumber() : message.workEstimated; - return object; - }; + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - /** - * Converts this Progress to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.Progress - * @instance - * @returns {Object.} JSON object - */ - Progress.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; - return Progress; - })(); + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - v1.ExportEntitiesRequest = (function() { + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - /** - * Properties of an ExportEntitiesRequest. - * @memberof google.datastore.admin.v1 - * @interface IExportEntitiesRequest - * @property {string|null} [projectId] ExportEntitiesRequest projectId - * @property {Object.|null} [labels] ExportEntitiesRequest labels - * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ExportEntitiesRequest entityFilter - * @property {string|null} [outputUrlPrefix] ExportEntitiesRequest outputUrlPrefix - */ + /** + * 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); + }; - /** - * Constructs a new ExportEntitiesRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ExportEntitiesRequest. - * @implements IExportEntitiesRequest - * @constructor - * @param {google.datastore.admin.v1.IExportEntitiesRequest=} [properties] Properties to set - */ - function ExportEntitiesRequest(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]]; + /** + * 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.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 72295728: + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + case 1051: + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + case 1049: + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * ExportEntitiesRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - */ - ExportEntitiesRequest.prototype.projectId = ""; - - /** - * ExportEntitiesRequest labels. - * @member {Object.} labels - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - */ - ExportEntitiesRequest.prototype.labels = $util.emptyObject; - - /** - * ExportEntitiesRequest entityFilter. - * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - */ - ExportEntitiesRequest.prototype.entityFilter = null; - - /** - * ExportEntitiesRequest outputUrlPrefix. - * @member {string} outputUrlPrefix - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - */ - ExportEntitiesRequest.prototype.outputUrlPrefix = ""; - - /** - * Creates a new ExportEntitiesRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IExportEntitiesRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest instance - */ - ExportEntitiesRequest.create = function create(properties) { - return new ExportEntitiesRequest(properties); - }; - - /** - * Encodes the specified ExportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IExportEntitiesRequest} message ExportEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesRequest.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.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.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) - $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputUrlPrefix != null && Object.hasOwnProperty.call(message, "outputUrlPrefix")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.outputUrlPrefix); - return writer; - }; + /** + * 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()); + }; - /** - * Encodes the specified ExportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IExportEntitiesRequest} message ExportEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + 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; + }; - /** - * Decodes an ExportEntitiesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = 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.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); - break; - case 4: - message.outputUrlPrefix = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + 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; + }; - /** - * Decodes an ExportEntitiesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.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] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.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; + }; - /** - * Verifies an ExportEntitiesRequest message. - * @function verify - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportEntitiesRequest.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.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.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); - if (error) - return "entityFilter." + error; - } - if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) - if (!$util.isString(message.outputUrlPrefix)) - return "outputUrlPrefix: string expected"; - return null; - }; + /** + * 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); + }; - /** - * Creates an ExportEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ExportEntitiesRequest} ExportEntitiesRequest - */ - ExportEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesRequest) - return object; - var message = new $root.google.datastore.admin.v1.ExportEntitiesRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesRequest.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.entityFilter != null) { - if (typeof object.entityFilter !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesRequest.entityFilter: object expected"); - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); - } - if (object.outputUrlPrefix != null) - message.outputUrlPrefix = String(object.outputUrlPrefix); - return message; - }; + /** + * 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; + })(); - /** - * Creates a plain object from an ExportEntitiesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.ExportEntitiesRequest} message ExportEntitiesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportEntitiesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.projectId = ""; - object.entityFilter = null; - object.outputUrlPrefix = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - 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.entityFilter != null && message.hasOwnProperty("entityFilter")) - object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); - if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) - object.outputUrlPrefix = message.outputUrlPrefix; - return object; - }; + return MethodOptions; + })(); - /** - * Converts this ExportEntitiesRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @instance - * @returns {Object.} JSON object - */ - ExportEntitiesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + protobuf.UninterpretedOption = (function() { - return ExportEntitiesRequest; - })(); + /** + * 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 + */ - v1.ImportEntitiesRequest = (function() { + /** + * 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]]; + } - /** - * Properties of an ImportEntitiesRequest. - * @memberof google.datastore.admin.v1 - * @interface IImportEntitiesRequest - * @property {string|null} [projectId] ImportEntitiesRequest projectId - * @property {Object.|null} [labels] ImportEntitiesRequest labels - * @property {string|null} [inputUrl] ImportEntitiesRequest inputUrl - * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ImportEntitiesRequest entityFilter - */ + /** + * 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 = ""; - /** - * Constructs a new ImportEntitiesRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ImportEntitiesRequest. - * @implements IImportEntitiesRequest - * @constructor - * @param {google.datastore.admin.v1.IImportEntitiesRequest=} [properties] Properties to set - */ - function ImportEntitiesRequest(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]]; - } + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - /** - * ImportEntitiesRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - */ - ImportEntitiesRequest.prototype.projectId = ""; + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * ImportEntitiesRequest labels. - * @member {Object.} labels - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - */ - ImportEntitiesRequest.prototype.labels = $util.emptyObject; + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; - /** - * ImportEntitiesRequest inputUrl. - * @member {string} inputUrl - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - */ - ImportEntitiesRequest.prototype.inputUrl = ""; + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - /** - * ImportEntitiesRequest entityFilter. - * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - */ - ImportEntitiesRequest.prototype.entityFilter = null; + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; - /** - * Creates a new ImportEntitiesRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IImportEntitiesRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest instance - */ - ImportEntitiesRequest.create = function create(properties) { - return new ImportEntitiesRequest(properties); - }; + /** + * 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 ImportEntitiesRequest message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IImportEntitiesRequest} message ImportEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEntitiesRequest.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.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.inputUrl != null && Object.hasOwnProperty.call(message, "inputUrl")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.inputUrl); - if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) - $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * 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 ImportEntitiesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.IImportEntitiesRequest} message ImportEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 ImportEntitiesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEntitiesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ImportEntitiesRequest(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = 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.inputUrl = reader.string(); - break; - case 4: - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an ImportEntitiesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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 ImportEntitiesRequest message. - * @function verify - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportEntitiesRequest.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.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.inputUrl != null && message.hasOwnProperty("inputUrl")) - if (!$util.isString(message.inputUrl)) - return "inputUrl: string expected"; - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); - if (error) - return "entityFilter." + error; - } - return null; - }; + /** + * 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 ImportEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ImportEntitiesRequest} ImportEntitiesRequest - */ - ImportEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesRequest) - return object; - var message = new $root.google.datastore.admin.v1.ImportEntitiesRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesRequest.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.inputUrl != null) - message.inputUrl = String(object.inputUrl); - if (object.entityFilter != null) { - if (typeof object.entityFilter !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesRequest.entityFilter: object expected"); - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); - } - return message; - }; + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; - /** - * Creates a plain object from an ImportEntitiesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {google.datastore.admin.v1.ImportEntitiesRequest} message ImportEntitiesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportEntitiesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.projectId = ""; - object.inputUrl = ""; - object.entityFilter = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - 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.inputUrl != null && message.hasOwnProperty("inputUrl")) - object.inputUrl = message.inputUrl; - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) - object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); - return object; - }; + /** + * 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 ImportEntitiesRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @instance - * @returns {Object.} JSON object - */ - ImportEntitiesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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); + }; - return ImportEntitiesRequest; - })(); + UninterpretedOption.NamePart = (function() { - v1.ExportEntitiesResponse = (function() { + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ - /** - * Properties of an ExportEntitiesResponse. - * @memberof google.datastore.admin.v1 - * @interface IExportEntitiesResponse - * @property {string|null} [outputUrl] ExportEntitiesResponse outputUrl - */ + /** + * 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]]; + } - /** - * Constructs a new ExportEntitiesResponse. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ExportEntitiesResponse. - * @implements IExportEntitiesResponse - * @constructor - * @param {google.datastore.admin.v1.IExportEntitiesResponse=} [properties] Properties to set - */ - function ExportEntitiesResponse(properties) { - if (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 = ""; - /** - * ExportEntitiesResponse outputUrl. - * @member {string} outputUrl - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @instance - */ - ExportEntitiesResponse.prototype.outputUrl = ""; + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; - /** - * Creates a new ExportEntitiesResponse instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {google.datastore.admin.v1.IExportEntitiesResponse=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse instance - */ - ExportEntitiesResponse.create = function create(properties) { - return new ExportEntitiesResponse(properties); - }; + /** + * 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 ExportEntitiesResponse message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {google.datastore.admin.v1.IExportEntitiesResponse} message ExportEntitiesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.outputUrl != null && Object.hasOwnProperty.call(message, "outputUrl")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.outputUrl); - return writer; - }; + /** + * 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 ExportEntitiesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {google.datastore.admin.v1.IExportEntitiesResponse} message ExportEntitiesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 an ExportEntitiesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.outputUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes an ExportEntitiesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + 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; + }; - /** - * Verifies an ExportEntitiesResponse message. - * @function verify - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportEntitiesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.outputUrl != null && message.hasOwnProperty("outputUrl")) - if (!$util.isString(message.outputUrl)) - return "outputUrl: string expected"; - return null; - }; + /** + * 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()); + }; - /** - * Creates an ExportEntitiesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ExportEntitiesResponse} ExportEntitiesResponse - */ - ExportEntitiesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesResponse) - return object; - var message = new $root.google.datastore.admin.v1.ExportEntitiesResponse(); - if (object.outputUrl != null) - message.outputUrl = String(object.outputUrl); - return message; - }; + /** + * 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 plain object from an ExportEntitiesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {google.datastore.admin.v1.ExportEntitiesResponse} message ExportEntitiesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportEntitiesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.outputUrl = ""; - if (message.outputUrl != null && message.hasOwnProperty("outputUrl")) - object.outputUrl = message.outputUrl; + /** + * 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; + }; - /** - * Converts this ExportEntitiesResponse to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @instance - * @returns {Object.} JSON object - */ - ExportEntitiesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return ExportEntitiesResponse; - })(); + /** + * 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); + }; - v1.ExportEntitiesMetadata = (function() { + return NamePart; + })(); - /** - * Properties of an ExportEntitiesMetadata. - * @memberof google.datastore.admin.v1 - * @interface IExportEntitiesMetadata - * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] ExportEntitiesMetadata common - * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] ExportEntitiesMetadata progressEntities - * @property {google.datastore.admin.v1.IProgress|null} [progressBytes] ExportEntitiesMetadata progressBytes - * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ExportEntitiesMetadata entityFilter - * @property {string|null} [outputUrlPrefix] ExportEntitiesMetadata outputUrlPrefix - */ + return UninterpretedOption; + })(); - /** - * Constructs a new ExportEntitiesMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ExportEntitiesMetadata. - * @implements IExportEntitiesMetadata - * @constructor - * @param {google.datastore.admin.v1.IExportEntitiesMetadata=} [properties] Properties to set - */ - function ExportEntitiesMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + protobuf.SourceCodeInfo = (function() { - /** - * ExportEntitiesMetadata common. - * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.common = null; + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ - /** - * ExportEntitiesMetadata progressEntities. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.progressEntities = null; + /** + * 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; - /** - * ExportEntitiesMetadata progressBytes. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressBytes - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.progressBytes = null; + /** + * 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); + }; - /** - * ExportEntitiesMetadata entityFilter. - * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.entityFilter = null; + /** + * 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; + }; - /** - * ExportEntitiesMetadata outputUrlPrefix. - * @member {string} outputUrlPrefix - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - */ - ExportEntitiesMetadata.prototype.outputUrlPrefix = ""; + /** + * 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(); + }; - /** - * Creates a new ExportEntitiesMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IExportEntitiesMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata instance - */ - ExportEntitiesMetadata.create = function create(properties) { - return new ExportEntitiesMetadata(properties); - }; + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ExportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IExportEntitiesMetadata} message ExportEntitiesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) - $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.progressBytes != null && Object.hasOwnProperty.call(message, "progressBytes")) - $root.google.datastore.admin.v1.Progress.encode(message.progressBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) - $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.outputUrlPrefix != null && Object.hasOwnProperty.call(message, "outputUrlPrefix")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.outputUrlPrefix); - return writer; - }; + /** + * 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()); + }; - /** - * Encodes the specified ExportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ExportEntitiesMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IExportEntitiesMetadata} message ExportEntitiesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEntitiesMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + }; - /** - * Decodes an ExportEntitiesMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ExportEntitiesMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); - break; - case 2: - message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 3: - message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 4: - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); - break; - case 5: - message.outputUrlPrefix = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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; + }; - /** - * Decodes an ExportEntitiesMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEntitiesMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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; + }; - /** - * Verifies an ExportEntitiesMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportEntitiesMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); - if (error) - return "common." + error; - } - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); - if (error) - return "progressEntities." + error; - } - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes); - if (error) - return "progressBytes." + error; - } - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); - if (error) - return "entityFilter." + error; - } - if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) - if (!$util.isString(message.outputUrlPrefix)) - return "outputUrlPrefix: string expected"; - return null; - }; + /** + * 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); + }; - /** - * Creates an ExportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ExportEntitiesMetadata} ExportEntitiesMetadata - */ - ExportEntitiesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesMetadata) - return object; - var message = new $root.google.datastore.admin.v1.ExportEntitiesMetadata(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.common: object expected"); - message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); - } - if (object.progressEntities != null) { - if (typeof object.progressEntities !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.progressEntities: object expected"); - message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); - } - if (object.progressBytes != null) { - if (typeof object.progressBytes !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.progressBytes: object expected"); - message.progressBytes = $root.google.datastore.admin.v1.Progress.fromObject(object.progressBytes); - } - if (object.entityFilter != null) { - if (typeof object.entityFilter !== "object") - throw TypeError(".google.datastore.admin.v1.ExportEntitiesMetadata.entityFilter: object expected"); - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); - } - if (object.outputUrlPrefix != null) - message.outputUrlPrefix = String(object.outputUrlPrefix); - return message; - }; + SourceCodeInfo.Location = (function() { - /** - * Creates a plain object from an ExportEntitiesMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.ExportEntitiesMetadata} message ExportEntitiesMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportEntitiesMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.common = null; - object.progressEntities = null; - object.progressBytes = null; - object.entityFilter = null; - object.outputUrlPrefix = ""; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) - object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) - object.progressBytes = $root.google.datastore.admin.v1.Progress.toObject(message.progressBytes, options); - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) - object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); - if (message.outputUrlPrefix != null && message.hasOwnProperty("outputUrlPrefix")) - object.outputUrlPrefix = message.outputUrlPrefix; - return object; - }; + /** + * 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 + */ - /** - * Converts this ExportEntitiesMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @instance - * @returns {Object.} JSON object - */ - ExportEntitiesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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]]; + } - return ExportEntitiesMetadata; - })(); + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; - v1.ImportEntitiesMetadata = (function() { + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; - /** - * Properties of an ImportEntitiesMetadata. - * @memberof google.datastore.admin.v1 - * @interface IImportEntitiesMetadata - * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] ImportEntitiesMetadata common - * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] ImportEntitiesMetadata progressEntities - * @property {google.datastore.admin.v1.IProgress|null} [progressBytes] ImportEntitiesMetadata progressBytes - * @property {google.datastore.admin.v1.IEntityFilter|null} [entityFilter] ImportEntitiesMetadata entityFilter - * @property {string|null} [inputUrl] ImportEntitiesMetadata inputUrl - */ + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; - /** - * Constructs a new ImportEntitiesMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an ImportEntitiesMetadata. - * @implements IImportEntitiesMetadata - * @constructor - * @param {google.datastore.admin.v1.IImportEntitiesMetadata=} [properties] Properties to set - */ - function ImportEntitiesMetadata(properties) { - if (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 trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; - /** - * ImportEntitiesMetadata common. - * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.common = null; + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; - /** - * ImportEntitiesMetadata progressEntities. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.progressEntities = null; + /** + * 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); + }; - /** - * ImportEntitiesMetadata progressBytes. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressBytes - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.progressBytes = null; + /** + * 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; + }; - /** - * ImportEntitiesMetadata entityFilter. - * @member {google.datastore.admin.v1.IEntityFilter|null|undefined} entityFilter - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.entityFilter = null; + /** + * 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(); + }; - /** - * ImportEntitiesMetadata inputUrl. - * @member {string} inputUrl - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - */ - ImportEntitiesMetadata.prototype.inputUrl = ""; + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new ImportEntitiesMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IImportEntitiesMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata instance - */ - ImportEntitiesMetadata.create = function create(properties) { - return new ImportEntitiesMetadata(properties); - }; + /** + * 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()); + }; - /** - * Encodes the specified ImportEntitiesMetadata message. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IImportEntitiesMetadata} message ImportEntitiesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEntitiesMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) - $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.progressBytes != null && Object.hasOwnProperty.call(message, "progressBytes")) - $root.google.datastore.admin.v1.Progress.encode(message.progressBytes, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.entityFilter != null && Object.hasOwnProperty.call(message, "entityFilter")) - $root.google.datastore.admin.v1.EntityFilter.encode(message.entityFilter, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputUrl != null && Object.hasOwnProperty.call(message, "inputUrl")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.inputUrl); - return writer; - }; + /** + * 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; + }; - /** - * Encodes the specified ImportEntitiesMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ImportEntitiesMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.IImportEntitiesMetadata} message ImportEntitiesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImportEntitiesMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + }; - /** - * Decodes an ImportEntitiesMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEntitiesMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ImportEntitiesMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); - break; - case 2: - message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 3: - message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 4: - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32()); - break; - case 5: - message.inputUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - 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; + }; - /** - * Decodes an ImportEntitiesMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImportEntitiesMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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); + }; - /** - * Verifies an ImportEntitiesMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImportEntitiesMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); - if (error) - return "common." + error; - } - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); - if (error) - return "progressEntities." + error; - } - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes); - if (error) - return "progressBytes." + error; - } - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter); - if (error) - return "entityFilter." + error; - } - if (message.inputUrl != null && message.hasOwnProperty("inputUrl")) - if (!$util.isString(message.inputUrl)) - return "inputUrl: string expected"; - return null; - }; + return Location; + })(); - /** - * Creates an ImportEntitiesMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ImportEntitiesMetadata} ImportEntitiesMetadata - */ - ImportEntitiesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesMetadata) - return object; - var message = new $root.google.datastore.admin.v1.ImportEntitiesMetadata(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.common: object expected"); - message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); - } - if (object.progressEntities != null) { - if (typeof object.progressEntities !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.progressEntities: object expected"); - message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); - } - if (object.progressBytes != null) { - if (typeof object.progressBytes !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.progressBytes: object expected"); - message.progressBytes = $root.google.datastore.admin.v1.Progress.fromObject(object.progressBytes); - } - if (object.entityFilter != null) { - if (typeof object.entityFilter !== "object") - throw TypeError(".google.datastore.admin.v1.ImportEntitiesMetadata.entityFilter: object expected"); - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.fromObject(object.entityFilter); - } - if (object.inputUrl != null) - message.inputUrl = String(object.inputUrl); - return message; - }; + return SourceCodeInfo; + })(); - /** - * Creates a plain object from an ImportEntitiesMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {google.datastore.admin.v1.ImportEntitiesMetadata} message ImportEntitiesMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImportEntitiesMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.common = null; - object.progressEntities = null; - object.progressBytes = null; - object.entityFilter = null; - object.inputUrl = ""; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) - object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) - object.progressBytes = $root.google.datastore.admin.v1.Progress.toObject(message.progressBytes, options); - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) - object.entityFilter = $root.google.datastore.admin.v1.EntityFilter.toObject(message.entityFilter, options); - if (message.inputUrl != null && message.hasOwnProperty("inputUrl")) - object.inputUrl = message.inputUrl; - return object; - }; + protobuf.GeneratedCodeInfo = (function() { - /** - * Converts this ImportEntitiesMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @instance - * @returns {Object.} JSON object - */ - ImportEntitiesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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]]; + } - return ImportEntitiesMetadata; - })(); + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - v1.EntityFilter = (function() { + /** + * 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); + }; - /** - * Properties of an EntityFilter. - * @memberof google.datastore.admin.v1 - * @interface IEntityFilter - * @property {Array.|null} [kinds] EntityFilter kinds - * @property {Array.|null} [namespaceIds] EntityFilter namespaceIds - */ + /** + * 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; + }; - /** - * Constructs a new EntityFilter. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an EntityFilter. - * @implements IEntityFilter - * @constructor - * @param {google.datastore.admin.v1.IEntityFilter=} [properties] Properties to set - */ - function EntityFilter(properties) { - this.kinds = []; - this.namespaceIds = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * EntityFilter kinds. - * @member {Array.} kinds - * @memberof google.datastore.admin.v1.EntityFilter - * @instance - */ - EntityFilter.prototype.kinds = $util.emptyArray; + /** + * 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()); + }; - /** - * EntityFilter namespaceIds. - * @member {Array.} namespaceIds - * @memberof google.datastore.admin.v1.EntityFilter - * @instance - */ - EntityFilter.prototype.namespaceIds = $util.emptyArray; + /** + * 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 new EntityFilter instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {google.datastore.admin.v1.IEntityFilter=} [properties] Properties to set - * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter instance - */ - EntityFilter.create = function create(properties) { - return new EntityFilter(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified EntityFilter message. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {google.datastore.admin.v1.IEntityFilter} message EntityFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityFilter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kinds != null && message.kinds.length) - for (var i = 0; i < message.kinds.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kinds[i]); - if (message.namespaceIds != null && message.namespaceIds.length) - for (var i = 0; i < message.namespaceIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.namespaceIds[i]); - return writer; - }; + /** + * 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; + }; - /** - * Encodes the specified EntityFilter message, length delimited. Does not implicitly {@link google.datastore.admin.v1.EntityFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {google.datastore.admin.v1.IEntityFilter} message EntityFilter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { - /** - * Decodes an EntityFilter message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityFilter.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.EntityFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.kinds && message.kinds.length)) - message.kinds = []; - message.kinds.push(reader.string()); - break; - case 2: - if (!(message.namespaceIds && message.namespaceIds.length)) - message.namespaceIds = []; - message.namespaceIds.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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 + */ - /** - * Decodes an EntityFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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]]; + } - /** - * Verifies an EntityFilter message. - * @function verify - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityFilter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.kinds != null && message.hasOwnProperty("kinds")) { - if (!Array.isArray(message.kinds)) - return "kinds: array expected"; - for (var i = 0; i < message.kinds.length; ++i) - if (!$util.isString(message.kinds[i])) - return "kinds: string[] expected"; - } - if (message.namespaceIds != null && message.hasOwnProperty("namespaceIds")) { - if (!Array.isArray(message.namespaceIds)) - return "namespaceIds: array expected"; - for (var i = 0; i < message.namespaceIds.length; ++i) - if (!$util.isString(message.namespaceIds[i])) - return "namespaceIds: string[] expected"; - } - return null; - }; + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; - /** - * Creates an EntityFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.EntityFilter} EntityFilter - */ - EntityFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.EntityFilter) - return object; - var message = new $root.google.datastore.admin.v1.EntityFilter(); - if (object.kinds) { - if (!Array.isArray(object.kinds)) - throw TypeError(".google.datastore.admin.v1.EntityFilter.kinds: array expected"); - message.kinds = []; - for (var i = 0; i < object.kinds.length; ++i) - message.kinds[i] = String(object.kinds[i]); - } - if (object.namespaceIds) { - if (!Array.isArray(object.namespaceIds)) - throw TypeError(".google.datastore.admin.v1.EntityFilter.namespaceIds: array expected"); - message.namespaceIds = []; - for (var i = 0; i < object.namespaceIds.length; ++i) - message.namespaceIds[i] = String(object.namespaceIds[i]); - } - return message; - }; + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; - /** - * Creates a plain object from an EntityFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {google.datastore.admin.v1.EntityFilter} message EntityFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.kinds = []; - object.namespaceIds = []; - } - if (message.kinds && message.kinds.length) { - object.kinds = []; - for (var j = 0; j < message.kinds.length; ++j) - object.kinds[j] = message.kinds[j]; - } - if (message.namespaceIds && message.namespaceIds.length) { - object.namespaceIds = []; - for (var j = 0; j < message.namespaceIds.length; ++j) - object.namespaceIds[j] = message.namespaceIds[j]; - } - return object; - }; + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; - /** - * Converts this EntityFilter to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.EntityFilter - * @instance - * @returns {Object.} JSON object - */ - EntityFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; - return EntityFilter; - })(); + /** + * 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); + }; - v1.CreateIndexRequest = (function() { + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; - /** - * Properties of a CreateIndexRequest. - * @memberof google.datastore.admin.v1 - * @interface ICreateIndexRequest - * @property {string|null} [projectId] CreateIndexRequest projectId - * @property {google.datastore.admin.v1.IIndex|null} [index] CreateIndexRequest index - */ + /** + * 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(); + }; - /** - * Constructs a new CreateIndexRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a CreateIndexRequest. - * @implements ICreateIndexRequest - * @constructor - * @param {google.datastore.admin.v1.ICreateIndexRequest=} [properties] Properties to set - */ - function CreateIndexRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } } + return message; + }; - /** - * CreateIndexRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @instance - */ - CreateIndexRequest.prototype.projectId = ""; - - /** - * CreateIndexRequest index. - * @member {google.datastore.admin.v1.IIndex|null|undefined} index - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @instance - */ - CreateIndexRequest.prototype.index = null; + /** + * 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()); + }; - /** - * Creates a new CreateIndexRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {google.datastore.admin.v1.ICreateIndexRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest instance - */ - CreateIndexRequest.create = function create(properties) { - return new CreateIndexRequest(properties); - }; + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; - /** - * Encodes the specified CreateIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {google.datastore.admin.v1.ICreateIndexRequest} message CreateIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateIndexRequest.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.index != null && Object.hasOwnProperty.call(message, "index")) - $root.google.datastore.admin.v1.Index.encode(message.index, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; - /** - * Encodes the specified CreateIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.CreateIndexRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {google.datastore.admin.v1.ICreateIndexRequest} message CreateIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; - /** - * Decodes a CreateIndexRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateIndexRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.CreateIndexRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; - case 3: - message.index = $root.google.datastore.admin.v1.Index.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * 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); + }; - /** - * Decodes a CreateIndexRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateIndexRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return Annotation; + })(); - /** - * Verifies a CreateIndexRequest message. - * @function verify - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateIndexRequest.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.index != null && message.hasOwnProperty("index")) { - var error = $root.google.datastore.admin.v1.Index.verify(message.index); - if (error) - return "index." + error; - } - return null; - }; + return GeneratedCodeInfo; + })(); - /** - * Creates a CreateIndexRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.CreateIndexRequest} CreateIndexRequest - */ - CreateIndexRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.CreateIndexRequest) - return object; - var message = new $root.google.datastore.admin.v1.CreateIndexRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.index != null) { - if (typeof object.index !== "object") - throw TypeError(".google.datastore.admin.v1.CreateIndexRequest.index: object expected"); - message.index = $root.google.datastore.admin.v1.Index.fromObject(object.index); - } - return message; - }; + protobuf.Any = (function() { - /** - * Creates a plain object from a CreateIndexRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {google.datastore.admin.v1.CreateIndexRequest} message CreateIndexRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateIndexRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.index = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.index != null && message.hasOwnProperty("index")) - object.index = $root.google.datastore.admin.v1.Index.toObject(message.index, options); - return object; - }; + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ - /** - * Converts this CreateIndexRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @instance - * @returns {Object.} JSON object - */ - CreateIndexRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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]]; + } - return CreateIndexRequest; - })(); + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; - v1.DeleteIndexRequest = (function() { + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); - /** - * Properties of a DeleteIndexRequest. - * @memberof google.datastore.admin.v1 - * @interface IDeleteIndexRequest - * @property {string|null} [projectId] DeleteIndexRequest projectId - * @property {string|null} [indexId] DeleteIndexRequest indexId - */ + /** + * 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); + }; - /** - * Constructs a new DeleteIndexRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a DeleteIndexRequest. - * @implements IDeleteIndexRequest - * @constructor - * @param {google.datastore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set - */ - function DeleteIndexRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Encodes the specified 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) { + 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(); + 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; + }; - /** - * DeleteIndexRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @instance - */ - DeleteIndexRequest.prototype.projectId = ""; + /** + * 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()); + }; - /** - * DeleteIndexRequest indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @instance - */ - DeleteIndexRequest.prototype.indexId = ""; + /** + * 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 a new DeleteIndexRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {google.datastore.admin.v1.IDeleteIndexRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest instance - */ - DeleteIndexRequest.create = function create(properties) { - return new DeleteIndexRequest(properties); - }; + /** + * 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) + message.value = object.value; + return message; + }; - /** - * Encodes the specified DeleteIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {google.datastore.admin.v1.IDeleteIndexRequest} message DeleteIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteIndexRequest.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); - return writer; - }; + /** + * 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; + }; - /** - * Encodes the specified DeleteIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DeleteIndexRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {google.datastore.admin.v1.IDeleteIndexRequest} message DeleteIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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); + }; - /** - * Decodes a DeleteIndexRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteIndexRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.DeleteIndexRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; - case 3: - message.indexId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return Any; + })(); - /** - * Decodes a DeleteIndexRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteIndexRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + protobuf.Duration = (function() { - /** - * Verifies a DeleteIndexRequest message. - * @function verify - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteIndexRequest.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.indexId != null && message.hasOwnProperty("indexId")) - if (!$util.isString(message.indexId)) - return "indexId: string expected"; - return null; - }; + /** + * Properties of a Duration. + * @memberof google.protobuf + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos + */ - /** - * Creates a DeleteIndexRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.DeleteIndexRequest} DeleteIndexRequest - */ - DeleteIndexRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.DeleteIndexRequest) - return object; - var message = new $root.google.datastore.admin.v1.DeleteIndexRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.indexId != null) - message.indexId = String(object.indexId); - return message; - }; + /** + * 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]]; + } - /** - * Creates a plain object from a DeleteIndexRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {google.datastore.admin.v1.DeleteIndexRequest} message DeleteIndexRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteIndexRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.indexId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.indexId != null && message.hasOwnProperty("indexId")) - object.indexId = message.indexId; - return object; - }; + /** + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Converts this DeleteIndexRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteIndexRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration + * @instance + */ + Duration.prototype.nanos = 0; - return DeleteIndexRequest; - })(); + /** + * 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); + }; - v1.GetIndexRequest = (function() { + /** + * 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; + }; - /** - * Properties of a GetIndexRequest. - * @memberof google.datastore.admin.v1 - * @interface IGetIndexRequest - * @property {string|null} [projectId] GetIndexRequest projectId - * @property {string|null} [indexId] GetIndexRequest indexId - */ + /** + * 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(); + }; - /** - * Constructs a new GetIndexRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a GetIndexRequest. - * @implements IGetIndexRequest - * @constructor - * @param {google.datastore.admin.v1.IGetIndexRequest=} [properties] Properties to set - */ - function GetIndexRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a Duration message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Duration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Duration} Duration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Duration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * GetIndexRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.GetIndexRequest - * @instance - */ - GetIndexRequest.prototype.projectId = ""; + /** + * 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()); + }; - /** - * GetIndexRequest indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.GetIndexRequest - * @instance - */ - GetIndexRequest.prototype.indexId = ""; + /** + * 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 new GetIndexRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {google.datastore.admin.v1.IGetIndexRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest instance - */ - GetIndexRequest.create = function create(properties) { - return new GetIndexRequest(properties); - }; + /** + * 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; + }; - /** - * Encodes the specified GetIndexRequest message. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {google.datastore.admin.v1.IGetIndexRequest} message GetIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIndexRequest.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); - return writer; - }; + /** + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Duration + * @static + * @param {google.protobuf.Duration} message Duration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Duration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Duration; + })(); - /** - * Encodes the specified GetIndexRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.GetIndexRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {google.datastore.admin.v1.IGetIndexRequest} message GetIndexRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIndexRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + protobuf.Empty = (function() { - /** - * Decodes a GetIndexRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIndexRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.GetIndexRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; - case 3: - message.indexId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ - /** - * Decodes a GetIndexRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIndexRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * 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]]; + } - /** - * Verifies a GetIndexRequest message. - * @function verify - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIndexRequest.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.indexId != null && message.hasOwnProperty("indexId")) - if (!$util.isString(message.indexId)) - return "indexId: string expected"; - return null; - }; + /** + * 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); + }; - /** - * Creates a GetIndexRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.GetIndexRequest} GetIndexRequest - */ - GetIndexRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.GetIndexRequest) - return object; - var message = new $root.google.datastore.admin.v1.GetIndexRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.indexId != null) - message.indexId = String(object.indexId); - return message; - }; + /** + * 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; + }; - /** - * Creates a plain object from a GetIndexRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {google.datastore.admin.v1.GetIndexRequest} message GetIndexRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIndexRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.indexId = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.indexId != null && message.hasOwnProperty("indexId")) - object.indexId = message.indexId; - return object; - }; + /** + * 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(); + }; - /** - * Converts this GetIndexRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.GetIndexRequest - * @instance - * @returns {Object.} JSON object - */ - GetIndexRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return GetIndexRequest; - })(); + /** + * 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(); + }; - v1.ListIndexesRequest = (function() { + /** + * 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 {}; + }; - /** - * Properties of a ListIndexesRequest. - * @memberof google.datastore.admin.v1 - * @interface IListIndexesRequest - * @property {string|null} [projectId] ListIndexesRequest projectId - * @property {string|null} [filter] ListIndexesRequest filter - * @property {number|null} [pageSize] ListIndexesRequest pageSize - * @property {string|null} [pageToken] ListIndexesRequest pageToken - */ + /** + * 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); + }; - /** - * Constructs a new ListIndexesRequest. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a ListIndexesRequest. - * @implements IListIndexesRequest - * @constructor - * @param {google.datastore.admin.v1.IListIndexesRequest=} [properties] Properties to set - */ - function ListIndexesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return Empty; + })(); - /** - * ListIndexesRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.projectId = ""; + protobuf.Timestamp = (function() { - /** - * ListIndexesRequest filter. - * @member {string} filter - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.filter = ""; + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ - /** - * ListIndexesRequest pageSize. - * @member {number} pageSize - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.pageSize = 0; + /** + * 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]]; + } - /** - * ListIndexesRequest pageToken. - * @member {string} pageToken - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.pageToken = ""; + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a new ListIndexesRequest instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {google.datastore.admin.v1.IListIndexesRequest=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest instance - */ - ListIndexesRequest.create = function create(properties) { - return new ListIndexesRequest(properties); - }; + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; - /** - * Encodes the specified ListIndexesRequest message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {google.datastore.admin.v1.IListIndexesRequest} message ListIndexesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIndexesRequest.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 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; - }; + /** + * 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 ListIndexesRequest message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {google.datastore.admin.v1.IListIndexesRequest} message ListIndexesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIndexesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + }; - /** - * Decodes a ListIndexesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIndexesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ListIndexesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = 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; - }; + /** + * 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 ListIndexesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIndexesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = reader.int64(); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies a ListIndexesRequest message. - * @function verify - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListIndexesRequest.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.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; - }; + /** + * 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()); + }; - /** - * Creates a ListIndexesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ListIndexesRequest} ListIndexesRequest - */ - ListIndexesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ListIndexesRequest) - return object; - var message = new $root.google.datastore.admin.v1.ListIndexesRequest(); - 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; - }; + /** + * 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 plain object from a ListIndexesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {google.datastore.admin.v1.ListIndexesRequest} message ListIndexesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListIndexesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.projectId = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - 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; - }; + /** + * 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; + }; - /** - * Converts this ListIndexesRequest to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - * @returns {Object.} JSON object - */ - ListIndexesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return ListIndexesRequest; - })(); + /** + * 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); + }; - v1.ListIndexesResponse = (function() { + return Timestamp; + })(); - /** - * Properties of a ListIndexesResponse. - * @memberof google.datastore.admin.v1 - * @interface IListIndexesResponse - * @property {Array.|null} [indexes] ListIndexesResponse indexes - * @property {string|null} [nextPageToken] ListIndexesResponse nextPageToken - */ + protobuf.Struct = (function() { - /** - * Constructs a new ListIndexesResponse. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a ListIndexesResponse. - * @implements IListIndexesResponse - * @constructor - * @param {google.datastore.admin.v1.IListIndexesResponse=} [properties] Properties to set - */ - function ListIndexesResponse(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]]; - } + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ - /** - * ListIndexesResponse indexes. - * @member {Array.} indexes - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @instance - */ - ListIndexesResponse.prototype.indexes = $util.emptyArray; + /** + * 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]]; + } - /** - * ListIndexesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @instance - */ - ListIndexesResponse.prototype.nextPageToken = ""; + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; - /** - * Creates a new ListIndexesResponse instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {google.datastore.admin.v1.IListIndexesResponse=} [properties] Properties to set - * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse instance - */ - ListIndexesResponse.create = function create(properties) { - return new ListIndexesResponse(properties); - }; + /** + * 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 ListIndexesResponse message. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {google.datastore.admin.v1.IListIndexesResponse} message ListIndexesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIndexesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.indexes != null && message.indexes.length) - for (var i = 0; i < message.indexes.length; ++i) - $root.google.datastore.admin.v1.Index.encode(message.indexes[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 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 ListIndexesResponse message, length delimited. Does not implicitly {@link google.datastore.admin.v1.ListIndexesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {google.datastore.admin.v1.IListIndexesResponse} message ListIndexesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIndexesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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 ListIndexesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIndexesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.ListIndexesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * 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) { + 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(); + 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: - if (!(message.indexes && message.indexes.length)) - message.indexes = []; - message.indexes.push($root.google.datastore.admin.v1.Index.decode(reader, reader.uint32())); + key = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; default: - reader.skipType(tag & 7); + reader.skipType(tag2 & 7); break; } } - return message; - }; - - /** - * Decodes a ListIndexesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIndexesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListIndexesResponse message. - * @function verify - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListIndexesResponse.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) { - var error = $root.google.datastore.admin.v1.Index.verify(message.indexes[i]); - if (error) - return "indexes." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + message.fields[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a ListIndexesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.ListIndexesResponse} ListIndexesResponse - */ - ListIndexesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.ListIndexesResponse) - return object; - var message = new $root.google.datastore.admin.v1.ListIndexesResponse(); - if (object.indexes) { - if (!Array.isArray(object.indexes)) - throw TypeError(".google.datastore.admin.v1.ListIndexesResponse.indexes: array expected"); - message.indexes = []; - for (var i = 0; i < object.indexes.length; ++i) { - if (typeof object.indexes[i] !== "object") - throw TypeError(".google.datastore.admin.v1.ListIndexesResponse.indexes: object expected"); - message.indexes[i] = $root.google.datastore.admin.v1.Index.fromObject(object.indexes[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - 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()); + }; - /** - * Creates a plain object from a ListIndexesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {google.datastore.admin.v1.ListIndexesResponse} message ListIndexesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListIndexesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexes = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.indexes && message.indexes.length) { - object.indexes = []; - for (var j = 0; j < message.indexes.length; ++j) - object.indexes[j] = $root.google.datastore.admin.v1.Index.toObject(message.indexes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + /** + * 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; + }; - /** - * Converts this ListIndexesResponse to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @instance - * @returns {Object.} JSON object - */ - ListIndexesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return ListIndexesResponse; - })(); + /** + * 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; + }; - v1.IndexOperationMetadata = (function() { + /** + * 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); + }; - /** - * Properties of an IndexOperationMetadata. - * @memberof google.datastore.admin.v1 - * @interface IIndexOperationMetadata - * @property {google.datastore.admin.v1.ICommonMetadata|null} [common] IndexOperationMetadata common - * @property {google.datastore.admin.v1.IProgress|null} [progressEntities] IndexOperationMetadata progressEntities - * @property {string|null} [indexId] IndexOperationMetadata indexId - */ + return Struct; + })(); - /** - * Constructs a new IndexOperationMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an IndexOperationMetadata. - * @implements IIndexOperationMetadata - * @constructor - * @param {google.datastore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set - */ - function IndexOperationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + protobuf.Value = (function() { - /** - * IndexOperationMetadata common. - * @member {google.datastore.admin.v1.ICommonMetadata|null|undefined} common - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.common = null; + /** + * 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 + */ - /** - * IndexOperationMetadata progressEntities. - * @member {google.datastore.admin.v1.IProgress|null|undefined} progressEntities - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.progressEntities = null; + /** + * 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]]; + } - /** - * IndexOperationMetadata indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @instance - */ - IndexOperationMetadata.prototype.indexId = ""; + /** + * Value nullValue. + * @member {google.protobuf.NullValue|null|undefined} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = null; - /** - * Creates a new IndexOperationMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {google.datastore.admin.v1.IIndexOperationMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata instance - */ - IndexOperationMetadata.create = function create(properties) { - return new IndexOperationMetadata(properties); - }; + /** + * Value numberValue. + * @member {number|null|undefined} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = null; - /** - * Encodes the specified IndexOperationMetadata message. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {google.datastore.admin.v1.IIndexOperationMetadata} message IndexOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexOperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.datastore.admin.v1.CommonMetadata.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.progressEntities != null && Object.hasOwnProperty.call(message, "progressEntities")) - $root.google.datastore.admin.v1.Progress.encode(message.progressEntities, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.indexId != null && Object.hasOwnProperty.call(message, "indexId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); - return writer; - }; + /** + * Value stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = null; - /** - * Encodes the specified IndexOperationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.IndexOperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {google.datastore.admin.v1.IIndexOperationMetadata} message IndexOperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Value boolValue. + * @member {boolean|null|undefined} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = null; - /** - * Decodes an IndexOperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexOperationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.IndexOperationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32()); - break; - case 2: - message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32()); - break; - case 3: - message.indexId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; - /** - * Decodes an IndexOperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexOperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; - /** - * Verifies an IndexOperationMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndexOperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common); - if (error) - return "common." + error; - } - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities); - if (error) - return "progressEntities." + error; - } - if (message.indexId != null && message.hasOwnProperty("indexId")) - if (!$util.isString(message.indexId)) - return "indexId: string expected"; - return null; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates an IndexOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.IndexOperationMetadata} IndexOperationMetadata - */ - IndexOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.IndexOperationMetadata) - return object; - var message = new $root.google.datastore.admin.v1.IndexOperationMetadata(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.datastore.admin.v1.IndexOperationMetadata.common: object expected"); - message.common = $root.google.datastore.admin.v1.CommonMetadata.fromObject(object.common); - } - if (object.progressEntities != null) { - if (typeof object.progressEntities !== "object") - throw TypeError(".google.datastore.admin.v1.IndexOperationMetadata.progressEntities: object expected"); - message.progressEntities = $root.google.datastore.admin.v1.Progress.fromObject(object.progressEntities); - } - if (object.indexId != null) - message.indexId = String(object.indexId); - return message; - }; + /** + * 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 plain object from an IndexOperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {google.datastore.admin.v1.IndexOperationMetadata} message IndexOperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndexOperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.common = null; - object.progressEntities = null; - object.indexId = ""; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.datastore.admin.v1.CommonMetadata.toObject(message.common, options); - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) - object.progressEntities = $root.google.datastore.admin.v1.Progress.toObject(message.progressEntities, options); - if (message.indexId != null && message.hasOwnProperty("indexId")) - object.indexId = message.indexId; - return object; - }; + /** + * 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); + }; - /** - * Converts this IndexOperationMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @instance - * @returns {Object.} JSON object - */ - IndexOperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return IndexOperationMetadata; - })(); + /** + * 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(); + }; - v1.DatastoreFirestoreMigrationMetadata = (function() { + /** + * 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) { + 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(); + 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; + }; - /** - * Properties of a DatastoreFirestoreMigrationMetadata. - * @memberof google.datastore.admin.v1 - * @interface IDatastoreFirestoreMigrationMetadata - * @property {google.datastore.admin.v1.MigrationState|null} [migrationState] DatastoreFirestoreMigrationMetadata migrationState - * @property {google.datastore.admin.v1.MigrationStep|null} [migrationStep] DatastoreFirestoreMigrationMetadata migrationStep - */ + /** + * 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()); + }; - /** - * Constructs a new DatastoreFirestoreMigrationMetadata. - * @memberof google.datastore.admin.v1 - * @classdesc Represents a DatastoreFirestoreMigrationMetadata. - * @implements IDatastoreFirestoreMigrationMetadata - * @constructor - * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata=} [properties] Properties to set - */ - function DatastoreFirestoreMigrationMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * 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; + }; - /** - * DatastoreFirestoreMigrationMetadata migrationState. - * @member {google.datastore.admin.v1.MigrationState} migrationState - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @instance - */ - DatastoreFirestoreMigrationMetadata.prototype.migrationState = 0; + /** + * 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) { + 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; + }; - /** - * DatastoreFirestoreMigrationMetadata migrationStep. - * @member {google.datastore.admin.v1.MigrationStep} migrationStep - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @instance - */ - DatastoreFirestoreMigrationMetadata.prototype.migrationStep = 0; + /** + * 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] : 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; + }; - /** - * Creates a new DatastoreFirestoreMigrationMetadata instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata=} [properties] Properties to set - * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata instance - */ - DatastoreFirestoreMigrationMetadata.create = function create(properties) { - return new DatastoreFirestoreMigrationMetadata(properties); - }; + /** + * 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); + }; - /** - * Encodes the specified DatastoreFirestoreMigrationMetadata message. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatastoreFirestoreMigrationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.migrationState != null && Object.hasOwnProperty.call(message, "migrationState")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.migrationState); - if (message.migrationStep != null && Object.hasOwnProperty.call(message, "migrationStep")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.migrationStep); - return writer; - }; + return Value; + })(); - /** - * Encodes the specified DatastoreFirestoreMigrationMetadata message, length delimited. Does not implicitly {@link google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DatastoreFirestoreMigrationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * 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; + })(); - /** - * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatastoreFirestoreMigrationMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.migrationState = reader.int32(); - break; - case 2: - message.migrationStep = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + protobuf.ListValue = (function() { - /** - * Decodes a DatastoreFirestoreMigrationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DatastoreFirestoreMigrationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ - /** - * Verifies a DatastoreFirestoreMigrationMetadata message. - * @function verify - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DatastoreFirestoreMigrationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.migrationState != null && message.hasOwnProperty("migrationState")) - switch (message.migrationState) { - default: - return "migrationState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) - switch (message.migrationStep) { - default: - return "migrationStep: enum value expected"; - case 0: - case 6: - case 1: - case 7: - case 2: - case 3: - case 4: - case 5: - break; - } - return null; - }; + /** + * 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]]; + } - /** - * Creates a DatastoreFirestoreMigrationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} DatastoreFirestoreMigrationMetadata - */ - DatastoreFirestoreMigrationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) - return object; - var message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); - switch (object.migrationState) { - case "MIGRATION_STATE_UNSPECIFIED": - case 0: - message.migrationState = 0; - break; - case "RUNNING": - case 1: - message.migrationState = 1; - break; - case "PAUSED": - case 2: - message.migrationState = 2; - break; - case "COMPLETE": - case 3: - message.migrationState = 3; - break; - } - switch (object.migrationStep) { - case "MIGRATION_STEP_UNSPECIFIED": - case 0: - message.migrationStep = 0; - break; - case "PREPARE": - case 6: - message.migrationStep = 6; - break; - case "START": - case 1: - message.migrationStep = 1; - break; - case "APPLY_WRITES_SYNCHRONOUSLY": - case 7: - message.migrationStep = 7; - break; - case "COPY_AND_VERIFY": - case 2: - message.migrationStep = 2; - break; - case "REDIRECT_EVENTUALLY_CONSISTENT_READS": - case 3: - message.migrationStep = 3; - break; - case "REDIRECT_STRONGLY_CONSISTENT_READS": - case 4: - message.migrationStep = 4; - break; - case "REDIRECT_WRITES": - case 5: - message.migrationStep = 5; - break; - } - return message; - }; + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; - /** - * Creates a plain object from a DatastoreFirestoreMigrationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata} message DatastoreFirestoreMigrationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DatastoreFirestoreMigrationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.migrationState = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; - object.migrationStep = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; - } - if (message.migrationState != null && message.hasOwnProperty("migrationState")) - object.migrationState = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.migrationState] : message.migrationState; - if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) - object.migrationStep = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] : message.migrationStep; - return object; - }; + /** + * 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); + }; - /** - * Converts this DatastoreFirestoreMigrationMetadata to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @instance - * @returns {Object.} JSON object - */ - DatastoreFirestoreMigrationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * 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; + }; - return DatastoreFirestoreMigrationMetadata; - })(); + /** + * 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(); + }; - /** - * OperationType enum. - * @name google.datastore.admin.v1.OperationType - * @enum {number} - * @property {number} OPERATION_TYPE_UNSPECIFIED=0 OPERATION_TYPE_UNSPECIFIED value - * @property {number} EXPORT_ENTITIES=1 EXPORT_ENTITIES value - * @property {number} IMPORT_ENTITIES=2 IMPORT_ENTITIES value - * @property {number} CREATE_INDEX=3 CREATE_INDEX value - * @property {number} DELETE_INDEX=4 DELETE_INDEX value - */ - v1.OperationType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXPORT_ENTITIES"] = 1; - values[valuesById[2] = "IMPORT_ENTITIES"] = 2; - values[valuesById[3] = "CREATE_INDEX"] = 3; - values[valuesById[4] = "DELETE_INDEX"] = 4; - return values; - })(); + /** + * 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) { + 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(); + 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; + }; - v1.Index = (function() { + /** + * 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()); + }; - /** - * Properties of an Index. - * @memberof google.datastore.admin.v1 - * @interface IIndex - * @property {string|null} [projectId] Index projectId - * @property {string|null} [indexId] Index indexId - * @property {string|null} [kind] Index kind - * @property {google.datastore.admin.v1.Index.AncestorMode|null} [ancestor] Index ancestor - * @property {Array.|null} [properties] Index properties - * @property {google.datastore.admin.v1.Index.State|null} [state] Index state - */ + /** + * 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; + }; - /** - * Constructs a new Index. - * @memberof google.datastore.admin.v1 - * @classdesc Represents an Index. - * @implements IIndex - * @constructor - * @param {google.datastore.admin.v1.IIndex=} [properties] Properties to set - */ - function Index(properties) { - this.properties = []; - if (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 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; + }; - /** - * Index projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.projectId = ""; + /** + * 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; + }; - /** - * Index indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.indexId = ""; + /** + * 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); + }; - /** - * Index kind. - * @member {string} kind - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.kind = ""; + return ListValue; + })(); - /** - * Index ancestor. - * @member {google.datastore.admin.v1.Index.AncestorMode} ancestor - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.ancestor = 0; + protobuf.DoubleValue = (function() { - /** - * Index properties. - * @member {Array.} properties - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.properties = $util.emptyArray; + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ - /** - * Index state. - * @member {google.datastore.admin.v1.Index.State} state - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.state = 0; + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; - /** - * Creates a new Index instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.Index - * @static - * @param {google.datastore.admin.v1.IIndex=} [properties] Properties to set - * @returns {google.datastore.admin.v1.Index} Index instance - */ - Index.create = function create(properties) { - return new Index(properties); - }; + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; - /** - * Encodes the specified Index message. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.Index - * @static - * @param {google.datastore.admin.v1.IIndex} message Index message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Index.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.indexId != null && Object.hasOwnProperty.call(message, "indexId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.indexId); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.kind); - if (message.ancestor != null && Object.hasOwnProperty.call(message, "ancestor")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.ancestor); - if (message.properties != null && message.properties.length) - for (var i = 0; i < message.properties.length; ++i) - $root.google.datastore.admin.v1.Index.IndexedProperty.encode(message.properties[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - return writer; - }; + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified Index message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.Index - * @static - * @param {google.datastore.admin.v1.IIndex} message Index message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Index.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an Index message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.Index - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.Index} Index - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Index.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Index(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.projectId = reader.string(); - break; - case 3: - message.indexId = reader.string(); - break; - case 4: - message.kind = reader.string(); - break; - case 5: - message.ancestor = reader.int32(); - break; - case 6: - if (!(message.properties && message.properties.length)) - message.properties = []; - message.properties.push($root.google.datastore.admin.v1.Index.IndexedProperty.decode(reader, reader.uint32())); - break; - case 7: - message.state = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an Index message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.Index - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.Index} Index - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Index.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; - /** - * Verifies an Index message. - * @function verify - * @memberof google.datastore.admin.v1.Index - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Index.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.indexId != null && message.hasOwnProperty("indexId")) - if (!$util.isString(message.indexId)) - return "indexId: string expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.ancestor != null && message.hasOwnProperty("ancestor")) - switch (message.ancestor) { - default: - return "ancestor: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.properties != null && message.hasOwnProperty("properties")) { - if (!Array.isArray(message.properties)) - return "properties: array expected"; - for (var i = 0; i < message.properties.length; ++i) { - var error = $root.google.datastore.admin.v1.Index.IndexedProperty.verify(message.properties[i]); - if (error) - return "properties." + error; - } - } - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; - /** - * Creates an Index message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.Index - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.Index} Index - */ - Index.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.Index) - return object; - var message = new $root.google.datastore.admin.v1.Index(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.indexId != null) - message.indexId = String(object.indexId); - if (object.kind != null) - message.kind = String(object.kind); - switch (object.ancestor) { - case "ANCESTOR_MODE_UNSPECIFIED": - case 0: - message.ancestor = 0; - break; - case "NONE": - case 1: - message.ancestor = 1; - break; - case "ALL_ANCESTORS": - case 2: - message.ancestor = 2; - break; - } - if (object.properties) { - if (!Array.isArray(object.properties)) - throw TypeError(".google.datastore.admin.v1.Index.properties: array expected"); - message.properties = []; - for (var i = 0; i < object.properties.length; ++i) { - if (typeof object.properties[i] !== "object") - throw TypeError(".google.datastore.admin.v1.Index.properties: object expected"); - message.properties[i] = $root.google.datastore.admin.v1.Index.IndexedProperty.fromObject(object.properties[i]); - } - } - switch (object.state) { - 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 "DELETING": - case 3: - message.state = 3; - break; - case "ERROR": - case 4: - message.state = 4; - break; - } - return message; - }; + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; - /** - * Creates a plain object from an Index message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.Index - * @static - * @param {google.datastore.admin.v1.Index} message Index - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Index.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.properties = []; - if (options.defaults) { - object.projectId = ""; - object.indexId = ""; - object.kind = ""; - object.ancestor = options.enums === String ? "ANCESTOR_MODE_UNSPECIFIED" : 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.indexId != null && message.hasOwnProperty("indexId")) - object.indexId = message.indexId; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.ancestor != null && message.hasOwnProperty("ancestor")) - object.ancestor = options.enums === String ? $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] : message.ancestor; - if (message.properties && message.properties.length) { - object.properties = []; - for (var j = 0; j < message.properties.length; ++j) - object.properties[j] = $root.google.datastore.admin.v1.Index.IndexedProperty.toObject(message.properties[j], options); - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.Index.State[message.state] : message.state; - return object; - }; + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Index to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.Index - * @instance - * @returns {Object.} JSON object - */ - Index.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return DoubleValue; + })(); - /** - * AncestorMode enum. - * @name google.datastore.admin.v1.Index.AncestorMode - * @enum {number} - * @property {number} ANCESTOR_MODE_UNSPECIFIED=0 ANCESTOR_MODE_UNSPECIFIED value - * @property {number} NONE=1 NONE value - * @property {number} ALL_ANCESTORS=2 ALL_ANCESTORS value - */ - Index.AncestorMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ANCESTOR_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NONE"] = 1; - values[valuesById[2] = "ALL_ANCESTORS"] = 2; - return values; - })(); + protobuf.FloatValue = (function() { - /** - * Direction enum. - * @name google.datastore.admin.v1.Index.Direction - * @enum {number} - * @property {number} DIRECTION_UNSPECIFIED=0 DIRECTION_UNSPECIFIED value - * @property {number} ASCENDING=1 ASCENDING value - * @property {number} DESCENDING=2 DESCENDING value - */ - Index.Direction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DIRECTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ASCENDING"] = 1; - values[valuesById[2] = "DESCENDING"] = 2; - return values; - })(); + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - Index.IndexedProperty = (function() { + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of an IndexedProperty. - * @memberof google.datastore.admin.v1.Index - * @interface IIndexedProperty - * @property {string|null} [name] IndexedProperty name - * @property {google.datastore.admin.v1.Index.Direction|null} [direction] IndexedProperty direction - */ + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new IndexedProperty. - * @memberof google.datastore.admin.v1.Index - * @classdesc Represents an IndexedProperty. - * @implements IIndexedProperty - * @constructor - * @param {google.datastore.admin.v1.Index.IIndexedProperty=} [properties] Properties to set - */ - function IndexedProperty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; - /** - * IndexedProperty name. - * @member {string} name - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @instance - */ - IndexedProperty.prototype.name = ""; + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; - /** - * IndexedProperty direction. - * @member {google.datastore.admin.v1.Index.Direction} direction - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @instance - */ - IndexedProperty.prototype.direction = 0; + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; - /** - * Creates a new IndexedProperty instance using the specified properties. - * @function create - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {google.datastore.admin.v1.Index.IIndexedProperty=} [properties] Properties to set - * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty instance - */ - IndexedProperty.create = function create(properties) { - return new IndexedProperty(properties); - }; + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified IndexedProperty message. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. - * @function encode - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {google.datastore.admin.v1.Index.IIndexedProperty} message IndexedProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexedProperty.encode = function encode(message, writer) { - 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.direction != null && Object.hasOwnProperty.call(message, "direction")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.direction); - return writer; - }; + return FloatValue; + })(); - /** - * Encodes the specified IndexedProperty message, length delimited. Does not implicitly {@link google.datastore.admin.v1.Index.IndexedProperty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {google.datastore.admin.v1.Index.IIndexedProperty} message IndexedProperty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IndexedProperty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + protobuf.Int64Value = (function() { - /** - * Decodes an IndexedProperty message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexedProperty.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.admin.v1.Index.IndexedProperty(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.direction = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ - /** - * Decodes an IndexedProperty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IndexedProperty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Verifies an IndexedProperty message. - * @function verify - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IndexedProperty.verify = function verify(message) { - if (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.direction != null && message.hasOwnProperty("direction")) - switch (message.direction) { - default: - return "direction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; - /** - * Creates an IndexedProperty message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.admin.v1.Index.IndexedProperty} IndexedProperty - */ - IndexedProperty.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.admin.v1.Index.IndexedProperty) - return object; - var message = new $root.google.datastore.admin.v1.Index.IndexedProperty(); - if (object.name != null) - message.name = String(object.name); - switch (object.direction) { - case "DIRECTION_UNSPECIFIED": - case 0: - message.direction = 0; - break; - case "ASCENDING": - case 1: - message.direction = 1; - break; - case "DESCENDING": - case 2: - message.direction = 2; - break; - } - return message; - }; + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; - /** - * Creates a plain object from an IndexedProperty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {google.datastore.admin.v1.Index.IndexedProperty} message IndexedProperty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IndexedProperty.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.direction = options.enums === String ? "DIRECTION_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.datastore.admin.v1.Index.Direction[message.direction] : message.direction; - return object; - }; + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this IndexedProperty to JSON. - * @function toJSON - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @instance - * @returns {Object.} JSON object - */ - IndexedProperty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return IndexedProperty; - })(); + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * State enum. - * @name google.datastore.admin.v1.Index.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} DELETING=3 DELETING value - * @property {number} ERROR=4 ERROR value - */ - Index.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] = "DELETING"] = 3; - values[valuesById[4] = "ERROR"] = 4; - return values; - })(); + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; - return Index; - })(); + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; - return v1; - })(); + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return admin; + return Int64Value; })(); - return datastore; - })(); - - google.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - type.LatLng = (function() { + protobuf.UInt64Value = (function() { /** - * Properties of a LatLng. - * @memberof google.type - * @interface ILatLng - * @property {number|null} [latitude] LatLng latitude - * @property {number|null} [longitude] LatLng longitude + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value */ /** - * Constructs a new LatLng. - * @memberof google.type - * @classdesc Represents a LatLng. - * @implements ILatLng + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value * @constructor - * @param {google.type.ILatLng=} [properties] Properties to set + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set */ - function LatLng(properties) { + function UInt64Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30427,88 +28153,75 @@ } /** - * LatLng latitude. - * @member {number} latitude - * @memberof google.type.LatLng - * @instance - */ - LatLng.prototype.latitude = 0; - - /** - * LatLng longitude. - * @member {number} longitude - * @memberof google.type.LatLng + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value * @instance */ - LatLng.prototype.longitude = 0; + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** - * Creates a new LatLng instance using the specified properties. + * Creates a new UInt64Value instance using the specified properties. * @function create - * @memberof google.type.LatLng + * @memberof google.protobuf.UInt64Value * @static - * @param {google.type.ILatLng=} [properties] Properties to set - * @returns {google.type.LatLng} LatLng instance + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance */ - LatLng.create = function create(properties) { - return new LatLng(properties); + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); }; /** - * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. * @function encode - * @memberof google.type.LatLng + * @memberof google.protobuf.UInt64Value * @static - * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LatLng.encode = function encode(message, writer) { + UInt64Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); - if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); return writer; }; /** - * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.type.LatLng + * @memberof google.protobuf.UInt64Value * @static - * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LatLng.encodeDelimited = function encodeDelimited(message, writer) { + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LatLng message from the specified reader or buffer. + * Decodes a UInt64Value message from the specified reader or buffer. * @function decode - * @memberof google.type.LatLng + * @memberof google.protobuf.UInt64Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.type.LatLng} LatLng + * @returns {google.protobuf.UInt64Value} UInt64Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LatLng.decode = function decode(reader, length) { + UInt64Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.latitude = reader.double(); - break; - case 2: - message.longitude = reader.double(); + message.value = reader.uint64(); break; default: reader.skipType(tag & 7); @@ -30519,156 +28232,121 @@ }; /** - * Decodes a LatLng message from the specified reader or buffer, length delimited. + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.type.LatLng + * @memberof google.protobuf.UInt64Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.type.LatLng} LatLng + * @returns {google.protobuf.UInt64Value} UInt64Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LatLng.decodeDelimited = function decodeDelimited(reader) { + UInt64Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LatLng message. + * Verifies a UInt64Value message. * @function verify - * @memberof google.type.LatLng + * @memberof google.protobuf.UInt64Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LatLng.verify = function verify(message) { + UInt64Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.latitude != null && message.hasOwnProperty("latitude")) - if (typeof message.latitude !== "number") - return "latitude: number expected"; - if (message.longitude != null && message.hasOwnProperty("longitude")) - if (typeof message.longitude !== "number") - return "longitude: number expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; return null; }; /** - * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.type.LatLng + * @memberof google.protobuf.UInt64Value * @static * @param {Object.} object Plain object - * @returns {google.type.LatLng} LatLng + * @returns {google.protobuf.UInt64Value} UInt64Value */ - LatLng.fromObject = function fromObject(object) { - if (object instanceof $root.google.type.LatLng) + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) return object; - var message = new $root.google.type.LatLng(); - if (object.latitude != null) - message.latitude = Number(object.latitude); - if (object.longitude != null) - message.longitude = Number(object.longitude); + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); return message; }; /** - * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.type.LatLng + * @memberof google.protobuf.UInt64Value * @static - * @param {google.type.LatLng} message LatLng + * @param {google.protobuf.UInt64Value} message UInt64Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LatLng.toObject = function toObject(message, options) { + UInt64Value.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.latitude = 0; - object.longitude = 0; - } - if (message.latitude != null && message.hasOwnProperty("latitude")) - object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; - if (message.longitude != null && message.hasOwnProperty("longitude")) - object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; return object; }; /** - * Converts this LatLng to JSON. + * Converts this UInt64Value to JSON. * @function toJSON - * @memberof google.type.LatLng + * @memberof google.protobuf.UInt64Value * @instance * @returns {Object.} JSON object */ - LatLng.prototype.toJSON = function toJSON() { + UInt64Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return LatLng; - })(); - - return type; - })(); - - 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 - */ - 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; - return values; + return UInt64Value; })(); - api.Http = (function() { + protobuf.Int32Value = (function() { /** - * Properties of a Http. - * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value */ /** - * Constructs a new Http. - * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.protobuf.IInt32Value=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + function Int32Value(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -30676,91 +28354,75 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + Int32Value.prototype.value = 0; /** - * Creates a new Http instance using the specified properties. + * Creates a new Int32Value instance using the specified properties. * @function create - * @memberof google.api.Http + * @memberof google.protobuf.Int32Value * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance */ - Http.create = function create(properties) { - return new Http(properties); + Int32Value.create = function create(properties) { + return new Int32Value(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.protobuf.Int32Value * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + Int32Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); return writer; }; /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.protobuf.Int32Value * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes an Int32Value message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @memberof google.protobuf.Int32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http + * @returns {google.protobuf.Int32Value} Int32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decode = function decode(reader, length) { + Int32Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - 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(); + message.value = reader.int32(); break; default: reader.skipType(tag & 7); @@ -30771,353 +28433,183 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes an Int32Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.protobuf.Int32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @returns {google.protobuf.Int32Value} Int32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Http.decodeDelimited = function decodeDelimited(reader) { + Int32Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies an Int32Value message. * @function verify - * @memberof google.api.Http + * @memberof google.protobuf.Int32Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Http.verify = function verify(message) { + Int32Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.rules != null && message.hasOwnProperty("rules")) { - if (!Array.isArray(message.rules)) - return "rules: array expected"; - for (var i = 0; i < message.rules.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.rules[i]); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; return null; }; /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.protobuf.Int32Value * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.protobuf.Int32Value} Int32Value */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) return object; - var message = new $root.google.api.Http(); - if (object.rules) { - if (!Array.isArray(object.rules)) - throw TypeError(".google.api.Http.rules: array expected"); - message.rules = []; - for (var i = 0; i < object.rules.length; ++i) { - if (typeof object.rules[i] !== "object") - throw TypeError(".google.api.Http.rules: object expected"); - message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|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; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - HttpRule.prototype.custom = null; + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value * @instance + * @returns {Object.} JSON object */ - HttpRule.prototype.body = ""; + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value */ - HttpRule.prototype.responseBody = ""; /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + UInt32Value.prototype.value = 0; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new UInt32Value instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.protobuf.UInt32Value * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.protobuf.UInt32Value * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + UInt32Value.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); return writer; }; /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.UInt32Value * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a UInt32Value message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @memberof google.protobuf.UInt32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule + * @returns {google.protobuf.UInt32Value} UInt32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decode = function decode(reader, length) { + UInt32Value.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 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())); + message.value = reader.uint32(); break; default: reader.skipType(tag & 7); @@ -31128,240 +28620,107 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.protobuf.UInt32Value * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @returns {google.protobuf.UInt32Value} UInt32Value * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + UInt32Value.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a UInt32Value message. * @function verify - * @memberof google.api.HttpRule + * @memberof google.protobuf.UInt32Value * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - HttpRule.verify = function verify(message) { + UInt32Value.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.get != null && message.hasOwnProperty("get")) { - properties.pattern = 1; - if (!$util.isString(message.get)) - return "get: string expected"; - } - if (message.put != null && message.hasOwnProperty("put")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.put)) - return "put: string expected"; - } - if (message.post != null && message.hasOwnProperty("post")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.post)) - return "post: string expected"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message["delete"])) - return "delete: string expected"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - if (!$util.isString(message.patch)) - return "patch: string expected"; - } - if (message.custom != null && message.hasOwnProperty("custom")) { - if (properties.pattern === 1) - return "pattern: multiple values"; - properties.pattern = 1; - { - var error = $root.google.api.CustomHttpPattern.verify(message.custom); - if (error) - return "custom." + error; - } - } - if (message.body != null && message.hasOwnProperty("body")) - if (!$util.isString(message.body)) - return "body: string expected"; - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - if (!$util.isString(message.responseBody)) - return "responseBody: string expected"; - if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { - if (!Array.isArray(message.additionalBindings)) - return "additionalBindings: array expected"; - for (var i = 0; i < message.additionalBindings.length; ++i) { - var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); - if (error) - return "additionalBindings." + error; - } - } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; return null; }; /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.UInt32Value * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.protobuf.UInt32Value} UInt32Value */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) return object; - var message = new $root.google.api.HttpRule(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.get != null) - message.get = String(object.get); - if (object.put != null) - message.put = String(object.put); - if (object.post != null) - message.post = String(object.post); - if (object["delete"] != null) - message["delete"] = String(object["delete"]); - if (object.patch != null) - message.patch = String(object.patch); - if (object.custom != null) { - if (typeof object.custom !== "object") - throw TypeError(".google.api.HttpRule.custom: object expected"); - message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); - } - if (object.body != null) - message.body = String(object.body); - if (object.responseBody != null) - message.responseBody = String(object.responseBody); - if (object.additionalBindings) { - if (!Array.isArray(object.additionalBindings)) - throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); - message.additionalBindings = []; - for (var i = 0; i < object.additionalBindings.length; ++i) { - if (typeof object.additionalBindings[i] !== "object") - throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); - message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); - } - } + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; return message; }; /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.protobuf.UInt32Value * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.protobuf.UInt32Value} message UInt32Value * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + UInt32Value.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; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; return object; }; /** - * Converts this HttpRule to JSON. + * Converts this UInt32Value to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.protobuf.UInt32Value * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + UInt32Value.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + return UInt32Value; })(); - api.CustomHttpPattern = (function() { + protobuf.BoolValue = (function() { /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value */ /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.protobuf.IBoolValue=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function BoolValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31369,88 +28728,75 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue * @instance */ - CustomHttpPattern.prototype.path = ""; + BoolValue.prototype.value = false; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new BoolValue instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.BoolValue * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + BoolValue.create = function create(properties) { + return new BoolValue(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.BoolValue * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + BoolValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); return writer; }; /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.BoolValue * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a BoolValue message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.BoolValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.protobuf.BoolValue} BoolValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decode = function decode(reader, length) { + BoolValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.kind = reader.string(); - break; - case 2: - message.path = reader.string(); + message.value = reader.bool(); break; default: reader.skipType(tag & 7); @@ -31461,124 +28807,107 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a BoolValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.BoolValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.protobuf.BoolValue} BoolValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + BoolValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a BoolValue message. * @function verify - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.BoolValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CustomHttpPattern.verify = function verify(message) { + BoolValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; return null; }; /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.BoolValue * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.protobuf.BoolValue} BoolValue */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) return object; - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); return message; }; /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.BoolValue * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.protobuf.BoolValue} message BoolValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + BoolValue.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; + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this BoolValue to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.protobuf.BoolValue * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + BoolValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; + return BoolValue; })(); - api.ResourceDescriptor = (function() { + protobuf.StringValue = (function() { /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value */ /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.protobuf.IStringValue=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function StringValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31586,167 +28915,75 @@ } /** - * 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 + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue * @instance */ - ResourceDescriptor.prototype.style = $util.emptyArray; + StringValue.prototype.value = ""; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * Creates a new StringValue instance using the specified properties. * @function create - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.StringValue * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + StringValue.create = function create(properties) { + return new StringValue(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.StringValue * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + StringValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); return writer; }; /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.StringValue * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + StringValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a StringValue message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.StringValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.protobuf.StringValue} StringValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decode = function decode(reader, length) { + StringValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.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()); + message.value = reader.string(); break; default: reader.skipType(tag & 7); @@ -31757,246 +28994,107 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a StringValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.StringValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.protobuf.StringValue} StringValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + StringValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a StringValue message. * @function verify - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.StringValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceDescriptor.verify = function verify(message) { + StringValue.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; - } - } + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; return null; }; /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.StringValue * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.protobuf.StringValue} StringValue */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) return object; - var message = new $root.google.api.ResourceDescriptor(); - if (object.type != null) - message.type = String(object.type); - if (object.pattern) { - if (!Array.isArray(object.pattern)) - throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); - message.pattern = []; - for (var i = 0; i < object.pattern.length; ++i) - message.pattern[i] = String(object.pattern[i]); - } - if (object.nameField != null) - message.nameField = String(object.nameField); - switch (object.history) { - case "HISTORY_UNSPECIFIED": - case 0: - message.history = 0; - break; - case "ORIGINALLY_SINGLE_PATTERN": - case 1: - message.history = 1; - break; - case "FUTURE_MULTI_PATTERN": - case 2: - message.history = 2; - break; - } - if (object.plural != null) - message.plural = String(object.plural); - if (object.singular != null) - message.singular = String(object.singular); - if (object.style) { - if (!Array.isArray(object.style)) - throw TypeError(".google.api.ResourceDescriptor.style: array expected"); - message.style = []; - for (var i = 0; i < object.style.length; ++i) - switch (object.style[i]) { - default: - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } - } + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); return message; }; /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a StringValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.StringValue * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.protobuf.StringValue} message StringValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + StringValue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; - } - if (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.pattern && message.pattern.length) { - object.pattern = []; - for (var j = 0; j < message.pattern.length; ++j) - object.pattern[j] = message.pattern[j]; - } - if (message.nameField != null && message.hasOwnProperty("nameField")) - object.nameField = message.nameField; - if (message.history != null && message.hasOwnProperty("history")) - object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] : message.history; - if (message.plural != null && message.hasOwnProperty("plural")) - object.plural = message.plural; - if (message.singular != null && message.hasOwnProperty("singular")) - object.singular = message.singular; - if (message.style && message.style.length) { - object.style = []; - for (var j = 0; j < message.style.length; ++j) - object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; - } + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; return object; }; /** - * Converts this ResourceDescriptor to JSON. + * Converts this StringValue to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.protobuf.StringValue * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + StringValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * History enum. - * @name google.api.ResourceDescriptor.History - * @enum {number} - * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value - * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value - * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value - */ - ResourceDescriptor.History = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; - values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; - return values; - })(); - - /** - * 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; + return StringValue; })(); - api.ResourceReference = (function() { + protobuf.BytesValue = (function() { /** - * Properties of a ResourceReference. - * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value */ /** - * Constructs a new ResourceReference. - * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.protobuf.IBytesValue=} [properties] Properties to set */ - function ResourceReference(properties) { + function BytesValue(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32004,88 +29102,75 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference - * @instance - */ - ResourceReference.prototype.type = ""; - - /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue * @instance */ - ResourceReference.prototype.childType = ""; + BytesValue.prototype.value = $util.newBuffer([]); /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new BytesValue instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.protobuf.BytesValue * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + BytesValue.create = function create(properties) { + return new BytesValue(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.protobuf.BytesValue * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + BytesValue.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); return writer; }; /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.protobuf.BytesValue * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a BytesValue message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @memberof google.protobuf.BytesValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.protobuf.BytesValue} BytesValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decode = function decode(reader, length) { + BytesValue.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); - break; - case 2: - message.childType = reader.string(); + message.value = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -32096,99 +29181,99 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a BytesValue message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.protobuf.BytesValue * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.protobuf.BytesValue} BytesValue * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + BytesValue.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a BytesValue message. * @function verify - * @memberof google.api.ResourceReference + * @memberof google.protobuf.BytesValue * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourceReference.verify = function verify(message) { + BytesValue.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.childType != null && message.hasOwnProperty("childType")) - if (!$util.isString(message.childType)) - return "childType: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; return null; }; /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.protobuf.BytesValue * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.protobuf.BytesValue} BytesValue */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) return object; - var message = new $root.google.api.ResourceReference(); - if (object.type != null) - message.type = String(object.type); - if (object.childType != null) - message.childType = String(object.childType); + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; return message; }; /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.protobuf.BytesValue * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.protobuf.BytesValue} message BytesValue * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + BytesValue.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; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** - * Converts this ResourceReference to JSON. + * Converts this BytesValue to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.protobuf.BytesValue * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + BytesValue.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return BytesValue; })(); - return api; + return protobuf; })(); google.longrunning = (function() { @@ -34339,855 +31424,349 @@ /** * Decodes a Status message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.rpc.Status + * @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); + }; + + return Status; + })(); + + return rpc; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.LatLng = (function() { + + /** + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude + */ + + /** + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng + * @constructor + * @param {google.type.ILatLng=} [properties] Properties to set + */ + function LatLng(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.latitude = 0; + + /** + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a new LatLng instance using the specified properties. + * @function create + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance + */ + LatLng.create = function create(properties) { + return new LatLng(properties); + }; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encode + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @function decode + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.latitude = reader.double(); + break; + case 2: + message.longitude = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LatLng * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status + * @returns {google.type.LatLng} LatLng * @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) { + LatLng.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Status message. + * Verifies a LatLng message. * @function verify - * @memberof google.rpc.Status + * @memberof google.type.LatLng * @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) { + LatLng.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; - } - } + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; return null; }; /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.rpc.Status + * @memberof google.type.LatLng * @static * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status + * @returns {google.type.LatLng} LatLng */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) 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]); - } - } + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); return message; }; /** - * Creates a plain object from a Status message. Also converts values to other types if specified. + * Creates a plain object from a LatLng message. Also converts values to other types if specified. * @function toObject - * @memberof google.rpc.Status + * @memberof google.type.LatLng * @static - * @param {google.rpc.Status} message Status + * @param {google.type.LatLng} message LatLng * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Status.toObject = function toObject(message, options) { + LatLng.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); + object.latitude = 0; + object.longitude = 0; } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; return object; }; /** - * Converts this Status to JSON. + * Converts this LatLng to JSON. * @function toJSON - * @memberof google.rpc.Status + * @memberof google.type.LatLng * @instance * @returns {Object.} JSON object */ - Status.prototype.toJSON = function toJSON() { + LatLng.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Status; + return LatLng; })(); - return rpc; - })(); - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - return cloud; + return type; })(); return google; })(); - - $root.Reference = (function() { - - /** - * Properties of a Reference. - * @exports IReference - * @interface IReference - * @property {string} app Reference app - * @property {string|null} [namespace] Reference namespace - * @property {IPath} path Reference path - * @property {string|null} [databaseId] Reference databaseId - */ - - /** - * Constructs a new Reference. - * @exports Reference - * @classdesc Represents a Reference. - * @implements IReference - * @constructor - * @param {IReference=} [properties] Properties to set - */ - function Reference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Reference app. - * @member {string} app - * @memberof Reference - * @instance - */ - Reference.prototype.app = ""; - - /** - * Reference namespace. - * @member {string} namespace - * @memberof Reference - * @instance - */ - Reference.prototype.namespace = ""; - - /** - * Reference path. - * @member {IPath} path - * @memberof Reference - * @instance - */ - Reference.prototype.path = null; - - /** - * Reference databaseId. - * @member {string} databaseId - * @memberof Reference - * @instance - */ - Reference.prototype.databaseId = ""; - - /** - * Creates a new Reference instance using the specified properties. - * @function create - * @memberof Reference - * @static - * @param {IReference=} [properties] Properties to set - * @returns {Reference} Reference instance - */ - Reference.create = function create(properties) { - return new Reference(properties); - }; - - /** - * Encodes the specified Reference message. Does not implicitly {@link Reference.verify|verify} messages. - * @function encode - * @memberof Reference - * @static - * @param {IReference} message Reference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Reference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 13, wireType 2 =*/106).string(message.app); - $root.Path.encode(message.path, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) - writer.uint32(/* id 20, wireType 2 =*/162).string(message.namespace); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 23, wireType 2 =*/186).string(message.databaseId); - return writer; - }; - - /** - * Encodes the specified Reference message, length delimited. Does not implicitly {@link Reference.verify|verify} messages. - * @function encodeDelimited - * @memberof Reference - * @static - * @param {IReference} message Reference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Reference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Reference message from the specified reader or buffer. - * @function decode - * @memberof Reference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {Reference} Reference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Reference.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Reference(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 13: - message.app = reader.string(); - break; - case 20: - message.namespace = reader.string(); - break; - case 14: - message.path = $root.Path.decode(reader, reader.uint32()); - break; - case 23: - message.databaseId = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("app")) - throw $util.ProtocolError("missing required 'app'", { instance: message }); - if (!message.hasOwnProperty("path")) - throw $util.ProtocolError("missing required 'path'", { instance: message }); - return message; - }; - - /** - * Decodes a Reference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof Reference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {Reference} Reference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Reference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Reference message. - * @function verify - * @memberof Reference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Reference.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.app)) - return "app: string expected"; - if (message.namespace != null && message.hasOwnProperty("namespace")) - if (!$util.isString(message.namespace)) - return "namespace: string expected"; - { - var error = $root.Path.verify(message.path); - if (error) - return "path." + error; - } - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - return null; - }; - - /** - * Creates a Reference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof Reference - * @static - * @param {Object.} object Plain object - * @returns {Reference} Reference - */ - Reference.fromObject = function fromObject(object) { - if (object instanceof $root.Reference) - return object; - var message = new $root.Reference(); - if (object.app != null) - message.app = String(object.app); - if (object.namespace != null) - message.namespace = String(object.namespace); - if (object.path != null) { - if (typeof object.path !== "object") - throw TypeError(".Reference.path: object expected"); - message.path = $root.Path.fromObject(object.path); - } - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - return message; - }; - - /** - * Creates a plain object from a Reference message. Also converts values to other types if specified. - * @function toObject - * @memberof Reference - * @static - * @param {Reference} message Reference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Reference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.app = ""; - object.path = null; - object.namespace = ""; - object.databaseId = ""; - } - if (message.app != null && message.hasOwnProperty("app")) - object.app = message.app; - if (message.path != null && message.hasOwnProperty("path")) - object.path = $root.Path.toObject(message.path, options); - if (message.namespace != null && message.hasOwnProperty("namespace")) - object.namespace = message.namespace; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - return object; - }; - - /** - * Converts this Reference to JSON. - * @function toJSON - * @memberof Reference - * @instance - * @returns {Object.} JSON object - */ - Reference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Reference; - })(); - - $root.Path = (function() { - - /** - * Properties of a Path. - * @exports IPath - * @interface IPath - * @property {Array.|null} [element] Path element - */ - - /** - * Constructs a new Path. - * @exports Path - * @classdesc Represents a Path. - * @implements IPath - * @constructor - * @param {IPath=} [properties] Properties to set - */ - function Path(properties) { - this.element = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Path element. - * @member {Array.} element - * @memberof Path - * @instance - */ - Path.prototype.element = $util.emptyArray; - - /** - * Creates a new Path instance using the specified properties. - * @function create - * @memberof Path - * @static - * @param {IPath=} [properties] Properties to set - * @returns {Path} Path instance - */ - Path.create = function create(properties) { - return new Path(properties); - }; - - /** - * Encodes the specified Path message. Does not implicitly {@link Path.verify|verify} messages. - * @function encode - * @memberof Path - * @static - * @param {IPath} message Path message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Path.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.element != null && message.element.length) - for (var i = 0; i < message.element.length; ++i) - $root.Path.Element.encode(message.element[i], writer.uint32(/* id 1, wireType 3 =*/11)).uint32(/* id 1, wireType 4 =*/12); - return writer; - }; - - /** - * Encodes the specified Path message, length delimited. Does not implicitly {@link Path.verify|verify} messages. - * @function encodeDelimited - * @memberof Path - * @static - * @param {IPath} message Path message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Path.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Path message from the specified reader or buffer. - * @function decode - * @memberof Path - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {Path} Path - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Path.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Path(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.element && message.element.length)) - message.element = []; - message.element.push($root.Path.Element.decode(reader)); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Path message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof Path - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {Path} Path - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Path.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Path message. - * @function verify - * @memberof Path - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Path.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.element != null && message.hasOwnProperty("element")) { - if (!Array.isArray(message.element)) - return "element: array expected"; - for (var i = 0; i < message.element.length; ++i) { - var error = $root.Path.Element.verify(message.element[i]); - if (error) - return "element." + error; - } - } - return null; - }; - - /** - * Creates a Path message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof Path - * @static - * @param {Object.} object Plain object - * @returns {Path} Path - */ - Path.fromObject = function fromObject(object) { - if (object instanceof $root.Path) - return object; - var message = new $root.Path(); - if (object.element) { - if (!Array.isArray(object.element)) - throw TypeError(".Path.element: array expected"); - message.element = []; - for (var i = 0; i < object.element.length; ++i) { - if (typeof object.element[i] !== "object") - throw TypeError(".Path.element: object expected"); - message.element[i] = $root.Path.Element.fromObject(object.element[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Path message. Also converts values to other types if specified. - * @function toObject - * @memberof Path - * @static - * @param {Path} message Path - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Path.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.element = []; - if (message.element && message.element.length) { - object.element = []; - for (var j = 0; j < message.element.length; ++j) - object.element[j] = $root.Path.Element.toObject(message.element[j], options); - } - return object; - }; - - /** - * Converts this Path to JSON. - * @function toJSON - * @memberof Path - * @instance - * @returns {Object.} JSON object - */ - Path.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - Path.Element = (function() { - - /** - * Properties of an Element. - * @memberof Path - * @interface IElement - * @property {string} type Element type - * @property {number|Long|null} [id] Element id - * @property {string|null} [name] Element name - */ - - /** - * Constructs a new Element. - * @memberof Path - * @classdesc Represents an Element. - * @implements IElement - * @constructor - * @param {Path.IElement=} [properties] Properties to set - */ - function Element(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Element type. - * @member {string} type - * @memberof Path.Element - * @instance - */ - Element.prototype.type = ""; - - /** - * Element id. - * @member {number|Long} id - * @memberof Path.Element - * @instance - */ - Element.prototype.id = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Element name. - * @member {string} name - * @memberof Path.Element - * @instance - */ - Element.prototype.name = ""; - - /** - * Creates a new Element instance using the specified properties. - * @function create - * @memberof Path.Element - * @static - * @param {Path.IElement=} [properties] Properties to set - * @returns {Path.Element} Element instance - */ - Element.create = function create(properties) { - return new Element(properties); - }; - - /** - * Encodes the specified Element message. Does not implicitly {@link Path.Element.verify|verify} messages. - * @function encode - * @memberof Path.Element - * @static - * @param {Path.IElement} message Element message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Element.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.id); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified Element message, length delimited. Does not implicitly {@link Path.Element.verify|verify} messages. - * @function encodeDelimited - * @memberof Path.Element - * @static - * @param {Path.IElement} message Element message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Element.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Element message from the specified reader or buffer. - * @function decode - * @memberof Path.Element - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {Path.Element} Element - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Element.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Path.Element(); - while (reader.pos < end) { - var tag = reader.uint32(); - if ((tag & 7) === 4) - break; - switch (tag >>> 3) { - case 2: - message.type = reader.string(); - break; - case 3: - message.id = reader.int64(); - break; - case 4: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("type")) - throw $util.ProtocolError("missing required 'type'", { instance: message }); - return message; - }; - - /** - * Decodes an Element message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof Path.Element - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {Path.Element} Element - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Element.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Element message. - * @function verify - * @memberof Path.Element - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Element.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high))) - return "id: integer|Long expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an Element message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof Path.Element - * @static - * @param {Object.} object Plain object - * @returns {Path.Element} Element - */ - Element.fromObject = function fromObject(object) { - if (object instanceof $root.Path.Element) - return object; - var message = new $root.Path.Element(); - if (object.type != null) - message.type = String(object.type); - if (object.id != null) - if ($util.Long) - (message.id = $util.Long.fromValue(object.id)).unsigned = false; - else if (typeof object.id === "string") - message.id = parseInt(object.id, 10); - else if (typeof object.id === "number") - message.id = object.id; - else if (typeof object.id === "object") - message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an Element message. Also converts values to other types if specified. - * @function toObject - * @memberof Path.Element - * @static - * @param {Path.Element} message Element - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Element.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.id = options.longs === String ? "0" : 0; - object.name = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.id != null && message.hasOwnProperty("id")) - if (typeof message.id === "number") - object.id = options.longs === String ? String(message.id) : message.id; - else - object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber() : message.id; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this Element to JSON. - * @function toJSON - * @memberof Path.Element - * @instance - * @returns {Object.} JSON object - */ - Element.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Element; - })(); - - return Path; - })(); return $root; }); diff --git a/protos/protos.json b/protos/protos.json index 18bb2bde5..f40ddedcc 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -613,531 +613,12 @@ "csharp_namespace": "Google.Cloud.Datastore.V1", "go_package": "google.golang.org/genproto/googleapis/datastore/v1;datastore", "java_multiple_files": true, - "java_outer_classname": "DatastoreProto", + "java_outer_classname": "QueryProto", "java_package": "com.google.datastore.v1", "php_namespace": "Google\\Cloud\\Datastore\\V1", "ruby_package": "Google::Cloud::Datastore::V1" }, "nested": { - "AggregationResult": { - "fields": { - "aggregateProperties": { - "keyType": "string", - "type": "Value", - "id": 2 - } - } - }, - "AggregationResultBatch": { - "fields": { - "aggregationResults": { - "rule": "repeated", - "type": "AggregationResult", - "id": 1 - }, - "moreResults": { - "type": "QueryResultBatch.MoreResultsType", - "id": 2 - }, - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 3 - } - } - }, - "PartitionId": { - "fields": { - "projectId": { - "type": "string", - "id": 2 - }, - "databaseId": { - "type": "string", - "id": 3 - }, - "namespaceId": { - "type": "string", - "id": 4 - } - } - }, - "Key": { - "fields": { - "partitionId": { - "type": "PartitionId", - "id": 1 - }, - "path": { - "rule": "repeated", - "type": "PathElement", - "id": 2 - } - }, - "nested": { - "PathElement": { - "oneofs": { - "idType": { - "oneof": [ - "id", - "name" - ] - } - }, - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "id": { - "type": "int64", - "id": 2 - }, - "name": { - "type": "string", - "id": 3 - } - } - } - } - }, - "ArrayValue": { - "fields": { - "values": { - "rule": "repeated", - "type": "Value", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "valueType": { - "oneof": [ - "nullValue", - "booleanValue", - "integerValue", - "doubleValue", - "timestampValue", - "keyValue", - "stringValue", - "blobValue", - "geoPointValue", - "entityValue", - "arrayValue" - ] - } - }, - "fields": { - "nullValue": { - "type": "google.protobuf.NullValue", - "id": 11 - }, - "booleanValue": { - "type": "bool", - "id": 1 - }, - "integerValue": { - "type": "int64", - "id": 2 - }, - "doubleValue": { - "type": "double", - "id": 3 - }, - "timestampValue": { - "type": "google.protobuf.Timestamp", - "id": 10 - }, - "keyValue": { - "type": "Key", - "id": 5 - }, - "stringValue": { - "type": "string", - "id": 17 - }, - "blobValue": { - "type": "bytes", - "id": 18 - }, - "geoPointValue": { - "type": "google.type.LatLng", - "id": 8 - }, - "entityValue": { - "type": "Entity", - "id": 6 - }, - "arrayValue": { - "type": "ArrayValue", - "id": 9 - }, - "meaning": { - "type": "int32", - "id": 14 - }, - "excludeFromIndexes": { - "type": "bool", - "id": 19 - } - } - }, - "Entity": { - "fields": { - "key": { - "type": "Key", - "id": 1 - }, - "properties": { - "keyType": "string", - "type": "Value", - "id": 3 - } - } - }, - "EntityResult": { - "fields": { - "entity": { - "type": "Entity", - "id": 1 - }, - "version": { - "type": "int64", - "id": 4 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5 - }, - "cursor": { - "type": "bytes", - "id": 3 - } - }, - "nested": { - "ResultType": { - "values": { - "RESULT_TYPE_UNSPECIFIED": 0, - "FULL": 1, - "PROJECTION": 2, - "KEY_ONLY": 3 - } - } - } - }, - "Query": { - "fields": { - "projection": { - "rule": "repeated", - "type": "Projection", - "id": 2 - }, - "kind": { - "rule": "repeated", - "type": "KindExpression", - "id": 3 - }, - "filter": { - "type": "Filter", - "id": 4 - }, - "order": { - "rule": "repeated", - "type": "PropertyOrder", - "id": 5 - }, - "distinctOn": { - "rule": "repeated", - "type": "PropertyReference", - "id": 6 - }, - "startCursor": { - "type": "bytes", - "id": 7 - }, - "endCursor": { - "type": "bytes", - "id": 8 - }, - "offset": { - "type": "int32", - "id": 10 - }, - "limit": { - "type": "google.protobuf.Int32Value", - "id": 12 - } - } - }, - "AggregationQuery": { - "oneofs": { - "queryType": { - "oneof": [ - "nestedQuery" - ] - } - }, - "fields": { - "nestedQuery": { - "type": "Query", - "id": 1 - }, - "aggregations": { - "rule": "repeated", - "type": "Aggregation", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Aggregation": { - "oneofs": { - "operator": { - "oneof": [ - "count" - ] - } - }, - "fields": { - "count": { - "type": "Count", - "id": 1 - }, - "alias": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Count": { - "fields": { - "upTo": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } - } - } - }, - "KindExpression": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "PropertyReference": { - "fields": { - "name": { - "type": "string", - "id": 2 - } - } - }, - "Projection": { - "fields": { - "property": { - "type": "PropertyReference", - "id": 1 - } - } - }, - "PropertyOrder": { - "fields": { - "property": { - "type": "PropertyReference", - "id": 1 - }, - "direction": { - "type": "Direction", - "id": 2 - } - }, - "nested": { - "Direction": { - "values": { - "DIRECTION_UNSPECIFIED": 0, - "ASCENDING": 1, - "DESCENDING": 2 - } - } - } - }, - "Filter": { - "oneofs": { - "filterType": { - "oneof": [ - "compositeFilter", - "propertyFilter" - ] - } - }, - "fields": { - "compositeFilter": { - "type": "CompositeFilter", - "id": 1 - }, - "propertyFilter": { - "type": "PropertyFilter", - "id": 2 - } - } - }, - "CompositeFilter": { - "fields": { - "op": { - "type": "Operator", - "id": 1 - }, - "filters": { - "rule": "repeated", - "type": "Filter", - "id": 2 - } - }, - "nested": { - "Operator": { - "values": { - "OPERATOR_UNSPECIFIED": 0, - "AND": 1, - "OR": 2 - } - } - } - }, - "PropertyFilter": { - "fields": { - "property": { - "type": "PropertyReference", - "id": 1 - }, - "op": { - "type": "Operator", - "id": 2 - }, - "value": { - "type": "Value", - "id": 3 - } - }, - "nested": { - "Operator": { - "values": { - "OPERATOR_UNSPECIFIED": 0, - "LESS_THAN": 1, - "LESS_THAN_OR_EQUAL": 2, - "GREATER_THAN": 3, - "GREATER_THAN_OR_EQUAL": 4, - "EQUAL": 5, - "IN": 6, - "NOT_EQUAL": 9, - "HAS_ANCESTOR": 11, - "NOT_IN": 13 - } - } - } - }, - "GqlQuery": { - "fields": { - "queryString": { - "type": "string", - "id": 1 - }, - "allowLiterals": { - "type": "bool", - "id": 2 - }, - "namedBindings": { - "keyType": "string", - "type": "GqlQueryParameter", - "id": 5 - }, - "positionalBindings": { - "rule": "repeated", - "type": "GqlQueryParameter", - "id": 4 - } - } - }, - "GqlQueryParameter": { - "oneofs": { - "parameterType": { - "oneof": [ - "value", - "cursor" - ] - } - }, - "fields": { - "value": { - "type": "Value", - "id": 2 - }, - "cursor": { - "type": "bytes", - "id": 3 - } - } - }, - "QueryResultBatch": { - "fields": { - "skippedResults": { - "type": "int32", - "id": 6 - }, - "skippedCursor": { - "type": "bytes", - "id": 3 - }, - "entityResultType": { - "type": "EntityResult.ResultType", - "id": 1 - }, - "entityResults": { - "rule": "repeated", - "type": "EntityResult", - "id": 2 - }, - "endCursor": { - "type": "bytes", - "id": 4 - }, - "moreResults": { - "type": "MoreResultsType", - "id": 5 - }, - "snapshotVersion": { - "type": "int64", - "id": 7 - }, - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 8 - } - }, - "nested": { - "MoreResultsType": { - "values": { - "MORE_RESULTS_TYPE_UNSPECIFIED": 0, - "NOT_FINISHED": 1, - "MORE_RESULTS_AFTER_LIMIT": 2, - "MORE_RESULTS_AFTER_CURSOR": 4, - "NO_MORE_RESULTS": 3 - } - } - } - }, "Datastore": { "options": { "(google.api.default_host)": "datastore.googleapis.com", @@ -1180,22 +661,6 @@ } ] }, - "RunAggregationQuery": { - "requestType": "RunAggregationQueryRequest", - "responseType": "RunAggregationQueryResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:runAggregationQuery", - "(google.api.http).body": "*" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:runAggregationQuery", - "body": "*" - } - } - ] - }, "BeginTransaction": { "requestType": "BeginTransactionRequest", "responseType": "BeginTransactionResponse", @@ -1263,45 +728,267 @@ "requestType": "AllocateIdsRequest", "responseType": "AllocateIdsResponse", "options": { - "(google.api.http).post": "/v1/projects/{project_id}:allocateIds", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id,keys" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:allocateIds", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id,keys" - } - ] + "(google.api.http).post": "/v1/projects/{project_id}:allocateIds", + "(google.api.http).body": "*", + "(google.api.method_signature)": "project_id,keys" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}:allocateIds", + "body": "*" + } + }, + { + "(google.api.method_signature)": "project_id,keys" + } + ] + }, + "ReserveIds": { + "requestType": "ReserveIdsRequest", + "responseType": "ReserveIdsResponse", + "options": { + "(google.api.http).post": "/v1/projects/{project_id}:reserveIds", + "(google.api.http).body": "*", + "(google.api.method_signature)": "project_id,keys" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/projects/{project_id}:reserveIds", + "body": "*" + } + }, + { + "(google.api.method_signature)": "project_id,keys" + } + ] + } + } + }, + "LookupRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "readOptions": { + "type": "ReadOptions", + "id": 1 + }, + "keys": { + "rule": "repeated", + "type": "Key", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "LookupResponse": { + "fields": { + "found": { + "rule": "repeated", + "type": "EntityResult", + "id": 1 + }, + "missing": { + "rule": "repeated", + "type": "EntityResult", + "id": 2 + }, + "deferred": { + "rule": "repeated", + "type": "Key", + "id": 3 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + }, + "RunQueryRequest": { + "oneofs": { + "queryType": { + "oneof": [ + "query", + "gqlQuery" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "partitionId": { + "type": "PartitionId", + "id": 2 + }, + "readOptions": { + "type": "ReadOptions", + "id": 1 + }, + "query": { + "type": "Query", + "id": 3 + }, + "gqlQuery": { + "type": "GqlQuery", + "id": 7 + } + } + }, + "RunQueryResponse": { + "fields": { + "batch": { + "type": "QueryResultBatch", + "id": 1 + }, + "query": { + "type": "Query", + "id": 2 + } + } + }, + "BeginTransactionRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "transactionOptions": { + "type": "TransactionOptions", + "id": 10 + } + } + }, + "BeginTransactionResponse": { + "fields": { + "transaction": { + "type": "bytes", + "id": 1 + } + } + }, + "RollbackRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "transaction": { + "type": "bytes", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RollbackResponse": { + "fields": {} + }, + "CommitRequest": { + "oneofs": { + "transactionSelector": { + "oneof": [ + "transaction" + ] + } + }, + "fields": { + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mode": { + "type": "Mode", + "id": 5 + }, + "transaction": { + "type": "bytes", + "id": 1 + }, + "mutations": { + "rule": "repeated", + "type": "Mutation", + "id": 6 + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "TRANSACTIONAL": 1, + "NON_TRANSACTIONAL": 2 + } + } + } + }, + "CommitResponse": { + "fields": { + "mutationResults": { + "rule": "repeated", + "type": "MutationResult", + "id": 3 + }, + "indexUpdates": { + "type": "int32", + "id": 4 + }, + "commitTime": { + "type": "google.protobuf.Timestamp", + "id": 8 + } + } + }, + "AllocateIdsRequest": { + "fields": { + "projectId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "ReserveIds": { - "requestType": "ReserveIdsRequest", - "responseType": "ReserveIdsResponse", + "keys": { + "rule": "repeated", + "type": "Key", + "id": 1, "options": { - "(google.api.http).post": "/v1/projects/{project_id}:reserveIds", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id,keys" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:reserveIds", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id,keys" - } - ] + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "LookupRequest": { + "AllocateIdsResponse": { + "fields": { + "keys": { + "rule": "repeated", + "type": "Key", + "id": 1 + } + } + }, + "ReserveIdsRequest": { "fields": { "projectId": { "type": "string", @@ -1314,448 +1001,579 @@ "type": "string", "id": 9 }, - "readOptions": { - "type": "ReadOptions", - "id": 1 - }, "keys": { "rule": "repeated", "type": "Key", - "id": 3, + "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } } } }, - "LookupResponse": { + "ReserveIdsResponse": { + "fields": {} + }, + "Mutation": { + "oneofs": { + "operation": { + "oneof": [ + "insert", + "update", + "upsert", + "delete" + ] + }, + "conflictDetectionStrategy": { + "oneof": [ + "baseVersion", + "updateTime" + ] + } + }, "fields": { - "found": { - "rule": "repeated", - "type": "EntityResult", - "id": 1 + "insert": { + "type": "Entity", + "id": 4 }, - "missing": { - "rule": "repeated", - "type": "EntityResult", - "id": 2 + "update": { + "type": "Entity", + "id": 5 }, - "deferred": { - "rule": "repeated", + "upsert": { + "type": "Entity", + "id": 6 + }, + "delete": { + "type": "Key", + "id": 7 + }, + "baseVersion": { + "type": "int64", + "id": 8 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11 + } + } + }, + "MutationResult": { + "fields": { + "key": { "type": "Key", "id": 3 }, + "version": { + "type": "int64", + "id": 4 + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + }, + "conflictDetected": { + "type": "bool", + "id": 5 + } + } + }, + "ReadOptions": { + "oneofs": { + "consistencyType": { + "oneof": [ + "readConsistency", + "transaction", + "readTime" + ] + } + }, + "fields": { + "readConsistency": { + "type": "ReadConsistency", + "id": 1 + }, + "transaction": { + "type": "bytes", + "id": 2 + }, "readTime": { "type": "google.protobuf.Timestamp", - "id": 7 + "id": 4 + } + }, + "nested": { + "ReadConsistency": { + "values": { + "READ_CONSISTENCY_UNSPECIFIED": 0, + "STRONG": 1, + "EVENTUAL": 2 + } } } }, - "RunQueryRequest": { + "TransactionOptions": { "oneofs": { - "queryType": { + "mode": { "oneof": [ - "query", - "gqlQuery" + "readWrite", + "readOnly" ] } }, "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "readWrite": { + "type": "ReadWrite", + "id": 1 + }, + "readOnly": { + "type": "ReadOnly", + "id": 2 + } + }, + "nested": { + "ReadWrite": { + "fields": { + "previousTransaction": { + "type": "bytes", + "id": 1 + } } }, - "databaseId": { + "ReadOnly": { + "fields": { + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + } + } + } + } + }, + "PartitionId": { + "fields": { + "projectId": { "type": "string", - "id": 9 + "id": 2 }, + "namespaceId": { + "type": "string", + "id": 4 + } + } + }, + "Key": { + "fields": { "partitionId": { "type": "PartitionId", - "id": 2 - }, - "readOptions": { - "type": "ReadOptions", "id": 1 }, - "query": { - "type": "Query", - "id": 3 - }, - "gqlQuery": { - "type": "GqlQuery", - "id": 7 + "path": { + "rule": "repeated", + "type": "PathElement", + "id": 2 + } + }, + "nested": { + "PathElement": { + "oneofs": { + "idType": { + "oneof": [ + "id", + "name" + ] + } + }, + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "id": { + "type": "int64", + "id": 2 + }, + "name": { + "type": "string", + "id": 3 + } + } } } }, - "RunQueryResponse": { + "ArrayValue": { "fields": { - "batch": { - "type": "QueryResultBatch", + "values": { + "rule": "repeated", + "type": "Value", "id": 1 - }, - "query": { - "type": "Query", - "id": 2 } } }, - "RunAggregationQueryRequest": { + "Value": { "oneofs": { - "queryType": { + "valueType": { "oneof": [ - "aggregationQuery", - "gqlQuery" + "nullValue", + "booleanValue", + "integerValue", + "doubleValue", + "timestampValue", + "keyValue", + "stringValue", + "blobValue", + "geoPointValue", + "entityValue", + "arrayValue" ] } }, "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "nullValue": { + "type": "google.protobuf.NullValue", + "id": 11 }, - "databaseId": { - "type": "string", - "id": 9 + "booleanValue": { + "type": "bool", + "id": 1 }, - "partitionId": { - "type": "PartitionId", + "integerValue": { + "type": "int64", "id": 2 }, - "readOptions": { - "type": "ReadOptions", - "id": 1 - }, - "aggregationQuery": { - "type": "AggregationQuery", + "doubleValue": { + "type": "double", "id": 3 }, - "gqlQuery": { - "type": "GqlQuery", - "id": 7 - } - } - }, - "RunAggregationQueryResponse": { - "fields": { - "batch": { - "type": "AggregationResultBatch", - "id": 1 + "timestampValue": { + "type": "google.protobuf.Timestamp", + "id": 10 }, - "query": { - "type": "AggregationQuery", - "id": 2 - } - } - }, - "BeginTransactionRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "keyValue": { + "type": "Key", + "id": 5 }, - "databaseId": { + "stringValue": { "type": "string", + "id": 17 + }, + "blobValue": { + "type": "bytes", + "id": 18 + }, + "geoPointValue": { + "type": "google.type.LatLng", + "id": 8 + }, + "entityValue": { + "type": "Entity", + "id": 6 + }, + "arrayValue": { + "type": "ArrayValue", "id": 9 }, - "transactionOptions": { - "type": "TransactionOptions", - "id": 10 + "meaning": { + "type": "int32", + "id": 14 + }, + "excludeFromIndexes": { + "type": "bool", + "id": 19 } } }, - "BeginTransactionResponse": { + "Entity": { "fields": { - "transaction": { - "type": "bytes", + "key": { + "type": "Key", "id": 1 - } - } - }, - "RollbackRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "databaseId": { - "type": "string", - "id": 9 }, - "transaction": { - "type": "bytes", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "properties": { + "keyType": "string", + "type": "Value", + "id": 3 } } }, - "RollbackResponse": { - "fields": {} - }, - "CommitRequest": { - "oneofs": { - "transactionSelector": { - "oneof": [ - "transaction" - ] - } - }, + "EntityResult": { "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "entity": { + "type": "Entity", + "id": 1 }, - "databaseId": { - "type": "string", - "id": 9 + "version": { + "type": "int64", + "id": 4 }, - "mode": { - "type": "Mode", + "updateTime": { + "type": "google.protobuf.Timestamp", "id": 5 }, - "transaction": { + "cursor": { "type": "bytes", - "id": 1 - }, - "mutations": { - "rule": "repeated", - "type": "Mutation", - "id": 6 + "id": 3 } }, "nested": { - "Mode": { + "ResultType": { "values": { - "MODE_UNSPECIFIED": 0, - "TRANSACTIONAL": 1, - "NON_TRANSACTIONAL": 2 + "RESULT_TYPE_UNSPECIFIED": 0, + "FULL": 1, + "PROJECTION": 2, + "KEY_ONLY": 3 } } } }, - "CommitResponse": { + "Query": { "fields": { - "mutationResults": { + "projection": { "rule": "repeated", - "type": "MutationResult", + "type": "Projection", + "id": 2 + }, + "kind": { + "rule": "repeated", + "type": "KindExpression", "id": 3 }, - "indexUpdates": { - "type": "int32", + "filter": { + "type": "Filter", "id": 4 }, - "commitTime": { - "type": "google.protobuf.Timestamp", + "order": { + "rule": "repeated", + "type": "PropertyOrder", + "id": 5 + }, + "distinctOn": { + "rule": "repeated", + "type": "PropertyReference", + "id": 6 + }, + "startCursor": { + "type": "bytes", + "id": 7 + }, + "endCursor": { + "type": "bytes", "id": 8 + }, + "offset": { + "type": "int32", + "id": 10 + }, + "limit": { + "type": "google.protobuf.Int32Value", + "id": 12 } } }, - "AllocateIdsRequest": { + "KindExpression": { "fields": { - "projectId": { + "name": { "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "databaseId": { + "id": 1 + } + } + }, + "PropertyReference": { + "fields": { + "name": { "type": "string", - "id": 9 - }, - "keys": { - "rule": "repeated", - "type": "Key", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 2 } } }, - "AllocateIdsResponse": { + "Projection": { "fields": { - "keys": { - "rule": "repeated", - "type": "Key", + "property": { + "type": "PropertyReference", "id": 1 } } }, - "ReserveIdsRequest": { + "PropertyOrder": { "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "databaseId": { - "type": "string", - "id": 9 + "property": { + "type": "PropertyReference", + "id": 1 }, - "keys": { - "rule": "repeated", - "type": "Key", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "direction": { + "type": "Direction", + "id": 2 + } + }, + "nested": { + "Direction": { + "values": { + "DIRECTION_UNSPECIFIED": 0, + "ASCENDING": 1, + "DESCENDING": 2 } } } }, - "ReserveIdsResponse": { - "fields": {} - }, - "Mutation": { + "Filter": { "oneofs": { - "operation": { - "oneof": [ - "insert", - "update", - "upsert", - "delete" - ] - }, - "conflictDetectionStrategy": { + "filterType": { "oneof": [ - "baseVersion", - "updateTime" + "compositeFilter", + "propertyFilter" ] } }, "fields": { - "insert": { - "type": "Entity", - "id": 4 - }, - "update": { - "type": "Entity", - "id": 5 - }, - "upsert": { - "type": "Entity", - "id": 6 - }, - "delete": { - "type": "Key", - "id": 7 - }, - "baseVersion": { - "type": "int64", - "id": 8 + "compositeFilter": { + "type": "CompositeFilter", + "id": 1 }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 11 + "propertyFilter": { + "type": "PropertyFilter", + "id": 2 } } }, - "MutationResult": { + "CompositeFilter": { "fields": { - "key": { - "type": "Key", - "id": 3 - }, - "version": { - "type": "int64", - "id": 4 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6 + "op": { + "type": "Operator", + "id": 1 }, - "conflictDetected": { - "type": "bool", - "id": 5 + "filters": { + "rule": "repeated", + "type": "Filter", + "id": 2 + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "AND": 1 + } } } }, - "ReadOptions": { - "oneofs": { - "consistencyType": { - "oneof": [ - "readConsistency", - "transaction", - "readTime" - ] - } - }, + "PropertyFilter": { "fields": { - "readConsistency": { - "type": "ReadConsistency", + "property": { + "type": "PropertyReference", "id": 1 }, - "transaction": { - "type": "bytes", + "op": { + "type": "Operator", "id": 2 }, - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 4 + "value": { + "type": "Value", + "id": 3 } }, "nested": { - "ReadConsistency": { + "Operator": { "values": { - "READ_CONSISTENCY_UNSPECIFIED": 0, - "STRONG": 1, - "EVENTUAL": 2 + "OPERATOR_UNSPECIFIED": 0, + "LESS_THAN": 1, + "LESS_THAN_OR_EQUAL": 2, + "GREATER_THAN": 3, + "GREATER_THAN_OR_EQUAL": 4, + "EQUAL": 5, + "IN": 6, + "NOT_EQUAL": 9, + "HAS_ANCESTOR": 11, + "NOT_IN": 13 } } } }, - "TransactionOptions": { + "GqlQuery": { + "fields": { + "queryString": { + "type": "string", + "id": 1 + }, + "allowLiterals": { + "type": "bool", + "id": 2 + }, + "namedBindings": { + "keyType": "string", + "type": "GqlQueryParameter", + "id": 5 + }, + "positionalBindings": { + "rule": "repeated", + "type": "GqlQueryParameter", + "id": 4 + } + } + }, + "GqlQueryParameter": { "oneofs": { - "mode": { + "parameterType": { "oneof": [ - "readWrite", - "readOnly" + "value", + "cursor" ] } }, "fields": { - "readWrite": { - "type": "ReadWrite", + "value": { + "type": "Value", + "id": 2 + }, + "cursor": { + "type": "bytes", + "id": 3 + } + } + }, + "QueryResultBatch": { + "fields": { + "skippedResults": { + "type": "int32", + "id": 6 + }, + "skippedCursor": { + "type": "bytes", + "id": 3 + }, + "entityResultType": { + "type": "EntityResult.ResultType", "id": 1 }, - "readOnly": { - "type": "ReadOnly", + "entityResults": { + "rule": "repeated", + "type": "EntityResult", "id": 2 + }, + "endCursor": { + "type": "bytes", + "id": 4 + }, + "moreResults": { + "type": "MoreResultsType", + "id": 5 + }, + "snapshotVersion": { + "type": "int64", + "id": 7 + }, + "readTime": { + "type": "google.protobuf.Timestamp", + "id": 8 } }, "nested": { - "ReadWrite": { - "fields": { - "previousTransaction": { - "type": "bytes", - "id": 1 - } - } - }, - "ReadOnly": { - "fields": { - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - } + "MoreResultsType": { + "values": { + "MORE_RESULTS_TYPE_UNSPECIFIED": 0, + "NOT_FINISHED": 1, + "MORE_RESULTS_AFTER_LIMIT": 2, + "MORE_RESULTS_AFTER_CURSOR": 4, + "NO_MORE_RESULTS": 3 } } } @@ -2507,13 +2325,6 @@ "default": false } }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, "deprecated": { "type": "bool", "id": 3, From 4329129afa883ca3eeff2b0b4e1efde965fe9ed6 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 26 Aug 2022 14:56:47 -0400 Subject: [PATCH 27/67] Eliminate comments --- src/request.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/request.ts b/src/request.ts index 3db6dcbba..61657cb06 100644 --- a/src/request.ts +++ b/src/request.ts @@ -1158,9 +1158,7 @@ export interface RequestOptions extends SharedQueryOptions{ entityFilter?: google.datastore.admin.v1.IEntityFilter; } export interface RunAggregationQueryRequest extends SharedQueryOptions{ - // query_type: { - aggregationQuery: AggregationQueryOptions - // } + aggregationQuery: AggregationQueryOptions } export interface AggregationQueryOptions { nestedQuery: QueryProto, From cd82996b353e896ef49d5451076c57930dc0f290 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 26 Aug 2022 15:01:32 -0400 Subject: [PATCH 28/67] Add new line --- src/aggregate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index 813de3977..a52e7535d 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -30,4 +30,4 @@ class Count extends AggregateField { } } -export {AggregateField} \ No newline at end of file +export {AggregateField} From b58a1d582db9ee257a58adbdc15a1da7583f0fc1 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 30 Aug 2022 15:40:00 -0400 Subject: [PATCH 29/67] Change upTo --- src/aggregate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index a52e7535d..dcec8c067 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -24,7 +24,7 @@ class Count extends AggregateField { } toProto(): any { - const convertedMaximum = this.maximum_ ? {up_to: this.maximum_} : null; + const convertedMaximum = this.maximum_ ? {upTo: {value: this.maximum_}} : null; const count = Object.assign({}, convertedMaximum); return Object.assign({count}, this.alias_ ? {alias: this.alias_} : null); } From 377d8574ec0f80d39f2ca1555d95a955e265988d Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 30 Aug 2022 15:49:08 -0400 Subject: [PATCH 30/67] Change maximum name to upTo --- src/aggregate.ts | 2 +- src/v1/index.ts | 1 - system-test/datastore.ts | 2 +- test/query.ts | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index dcec8c067..c58a24397 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -18,7 +18,7 @@ abstract class AggregateField { class Count extends AggregateField { maximum_?: number - maximum(maximum: number): AggregateField { + upTo(maximum: number): AggregateField { this.maximum_ = maximum; return this; } diff --git a/src/v1/index.ts b/src/v1/index.ts index cba4bf594..8f7c527c2 100644 --- a/src/v1/index.ts +++ b/src/v1/index.ts @@ -16,6 +16,5 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export {DatastoreAdminClient} from './datastore_admin_client'; export {DatastoreClient} from './datastore_client'; export {DatastoreAdminClient} from './datastore_admin_client'; diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 25289ab97..f98199b6b 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -809,7 +809,7 @@ describe('Datastore', () => { it('should run a count aggregation having a maximum', async () => { const q = datastore .createQuery('Character') - .aggregate(AggregateField.count().maximum(4).alias('total')); + .aggregate(AggregateField.count().upTo(4).alias('total')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 4}]); }); diff --git a/test/query.ts b/test/query.ts index 3d965ef47..f0fcc5c91 100644 --- a/test/query.ts +++ b/test/query.ts @@ -59,8 +59,8 @@ describe('Query', () => { it('should create a query with a count aggregation', () => { const query = new Query(['kind1']) - .aggregate(AggregateField.count().maximum(4).alias('total')) - .aggregate(AggregateField.count().maximum(6).alias('total2')); + .aggregate(AggregateField.count().upTo(4).alias('total')) + .aggregate(AggregateField.count().upTo(6).alias('total2')); assert.deepStrictEqual(query.aggregations, [ {alias: 'total', count: {up_to: 4}}, {alias: 'total2', count: {up_to: 6}} From 3e7445223d7b96ec599980b5e23f99c7a016a360 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 30 Aug 2022 15:58:03 -0400 Subject: [PATCH 31/67] upTo relabelled from maximum --- src/aggregate.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index c58a24397..de2ccaa2a 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -16,16 +16,16 @@ abstract class AggregateField { } class Count extends AggregateField { - maximum_?: number + upTo_?: number - upTo(maximum: number): AggregateField { - this.maximum_ = maximum; + upTo(upTo: number): AggregateField { + this.upTo_ = upTo; return this; } toProto(): any { - const convertedMaximum = this.maximum_ ? {upTo: {value: this.maximum_}} : null; - const count = Object.assign({}, convertedMaximum); + const convertedUpTo = this.upTo_ ? {upTo: {value: this.upTo_}} : null; + const count = Object.assign({}, convertedUpTo); return Object.assign({count}, this.alias_ ? {alias: this.alias_} : null); } } From 6e112431341c0ce571ba542dfbc6abb549012566 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 31 Aug 2022 10:04:40 -0400 Subject: [PATCH 32/67] remove import --- src/aggregate.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index de2ccaa2a..322c29a23 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -1,5 +1,3 @@ -import * as Long from 'long'; - abstract class AggregateField { alias_?: string; From 1225d24fd3e9344cf87e0d580b67ba970d18e25f Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 31 Aug 2022 10:06:22 -0400 Subject: [PATCH 33/67] ran the linter --- src/aggregate.ts | 6 ++-- src/request.ts | 67 +++++++++++++++++++++------------------- system-test/datastore.ts | 26 ++++++++-------- test/query.ts | 8 ++--- 4 files changed, 55 insertions(+), 52 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index 322c29a23..6f0ea2046 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -10,11 +10,11 @@ abstract class AggregateField { return this; } - abstract toProto(): any + abstract toProto(): any; } class Count extends AggregateField { - upTo_?: number + upTo_?: number; upTo(upTo: number): AggregateField { this.upTo_ = upTo; @@ -28,4 +28,4 @@ class Count extends AggregateField { } } -export {AggregateField} +export {AggregateField}; diff --git a/src/request.ts b/src/request.ts index 61657cb06..929992398 100644 --- a/src/request.ts +++ b/src/request.ts @@ -43,7 +43,8 @@ import { EntityProto, KeyProto, ResponseResult, - Entities, ValueProto, + Entities, + ValueProto, } from './entity'; import { Query, @@ -728,7 +729,6 @@ class DatastoreRequest { * ``` */ runQueryStream(query: Query, options: RunQueryStreamOptions = {}): Transform { - query = extend(true, new Query(), query); const makeRequest = (query: Query) => { const sharedQueryOpts = {} as SharedQueryOptions; @@ -760,33 +760,33 @@ class DatastoreRequest { const reqOpts: RequestOptions = sharedQueryOpts; reqOpts.query = queryProto; this.request_( - { - client: 'DatastoreClient', - method: 'runQuery', - reqOpts, - gaxOpts: options.gaxOptions, - }, - onResultSet + { + client: 'DatastoreClient', + method: 'runQuery', + reqOpts, + gaxOpts: options.gaxOptions, + }, + onResultSet ); } else { const aggregationQueryOptions: AggregationQueryOptions = { nestedQuery: queryProto, - aggregations: query.aggregations + aggregations: query.aggregations, }; const reqOpts: RunAggregationQueryRequest = Object.assign( sharedQueryOpts, { - aggregationQuery: aggregationQueryOptions + aggregationQuery: aggregationQueryOptions, } ); this.request_( - { - client: 'DatastoreClient', - method: 'runAggregationQuery', - reqOpts, - gaxOpts: options.gaxOptions, - }, - onAggregateResultSet + { + client: 'DatastoreClient', + method: 'runAggregationQuery', + reqOpts, + gaxOpts: options.gaxOptions, + }, + onAggregateResultSet ); } }; @@ -805,16 +805,19 @@ class DatastoreRequest { try { const results = resp.batch.aggregationResults; const finalResults = results - .map((aggregationResult: any) => aggregationResult.aggregateProperties) - .map((aggregateProperties: any) => - Object.fromEntries( - new Map( - Object.keys(aggregateProperties).map(key => - [key, entity.decodeValueProto(aggregateProperties[key])] - ) - ) + .map( + (aggregationResult: any) => aggregationResult.aggregateProperties + ) + .map((aggregateProperties: any) => + Object.fromEntries( + new Map( + Object.keys(aggregateProperties).map(key => [ + key, + entity.decodeValueProto(aggregateProperties[key]), + ]) ) - ); + ) + ); split(finalResults, stream).then(streamEnded => { if (streamEnded) { return; @@ -1143,7 +1146,7 @@ export interface SharedQueryOptions { readTime?: ITimestamp; }; } -export interface RequestOptions extends SharedQueryOptions{ +export interface RequestOptions extends SharedQueryOptions { mutations?: google.datastore.v1.IMutation[]; keys?: Entity; transactionOptions?: { @@ -1157,12 +1160,12 @@ export interface RequestOptions extends SharedQueryOptions{ indexId?: string; entityFilter?: google.datastore.admin.v1.IEntityFilter; } -export interface RunAggregationQueryRequest extends SharedQueryOptions{ - aggregationQuery: AggregationQueryOptions +export interface RunAggregationQueryRequest extends SharedQueryOptions { + aggregationQuery: AggregationQueryOptions; } export interface AggregationQueryOptions { - nestedQuery: QueryProto, - aggregations: Array + nestedQuery: QueryProto; + aggregations: Array; } export type RunQueryStreamOptions = RunQueryOptions; export interface CommitCallback { diff --git a/system-test/datastore.ts b/system-test/datastore.ts index f98199b6b..11e7153b4 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -801,39 +801,39 @@ describe('Datastore', () => { describe('with a count filter', () => { it('should run a count aggregation', async () => { const q = datastore - .createQuery('Character') - .aggregate(AggregateField.count()); + .createQuery('Character') + .aggregate(AggregateField.count()); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{property_1: 8}]); }); it('should run a count aggregation having a maximum', async () => { const q = datastore - .createQuery('Character') - .aggregate(AggregateField.count().upTo(4).alias('total')); + .createQuery('Character') + .aggregate(AggregateField.count().upTo(4).alias('total')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 4}]); }); it('should run a count aggregation having other filters', async () => { const q = datastore - .createQuery('Character') - .filter('family', 'Stark') - .filter('appearances', '>=', 20) - .aggregate(AggregateField.count().alias('total')); + .createQuery('Character') + .filter('family', 'Stark') + .filter('appearances', '>=', 20) + .aggregate(AggregateField.count().alias('total')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 6}]); }); it('should run a count aggregate filter with an alias', async () => { const q = datastore - .createQuery('Character') - .aggregate(AggregateField.count().alias('total')); + .createQuery('Character') + .aggregate(AggregateField.count().alias('total')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 8}]); }); it('should do multiple count aggregations', async () => { const q = datastore - .createQuery('Character') - .aggregate(AggregateField.count().alias('total')) - .aggregate(AggregateField.count().alias('total2')); + .createQuery('Character') + .aggregate(AggregateField.count().alias('total')) + .aggregate(AggregateField.count().alias('total2')); const [results] = await datastore.runQuery(q); assert.deepStrictEqual(results, [{total: 8, total2: 8}]); }); diff --git a/test/query.ts b/test/query.ts index f0fcc5c91..25d6a9412 100644 --- a/test/query.ts +++ b/test/query.ts @@ -59,13 +59,13 @@ describe('Query', () => { it('should create a query with a count aggregation', () => { const query = new Query(['kind1']) - .aggregate(AggregateField.count().upTo(4).alias('total')) - .aggregate(AggregateField.count().upTo(6).alias('total2')); + .aggregate(AggregateField.count().upTo(4).alias('total')) + .aggregate(AggregateField.count().upTo(6).alias('total2')); assert.deepStrictEqual(query.aggregations, [ {alias: 'total', count: {up_to: 4}}, - {alias: 'total2', count: {up_to: 6}} + {alias: 'total2', count: {up_to: 6}}, ]); - }) + }); }); describe('filter', () => { From 2d4386b43e3664294c4dbeda8e7373fbdb94a126 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 31 Aug 2022 11:23:00 -0400 Subject: [PATCH 34/67] improve code readability --- src/query.ts | 1 - src/request.ts | 21 ++++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/query.ts b/src/query.ts index 804d2604d..2486d87fb 100644 --- a/src/query.ts +++ b/src/query.ts @@ -15,7 +15,6 @@ */ import arrify = require('arrify'); -import * as Long from 'long'; import {Key} from 'readline'; import {Datastore} from '.'; import {Entity} from './entity'; diff --git a/src/request.ts b/src/request.ts index 929992398..33d46fff6 100644 --- a/src/request.ts +++ b/src/request.ts @@ -757,9 +757,19 @@ class DatastoreRequest { } if (query.aggregations.length === 0) { + runDataQuery(sharedQueryOpts, queryProto); + } else { + runAggregationQuery(sharedQueryOpts, queryProto); + } + + const self = this; + function runDataQuery( + sharedQueryOpts: SharedQueryOptions, + queryProto: QueryProto + ) { const reqOpts: RequestOptions = sharedQueryOpts; reqOpts.query = queryProto; - this.request_( + self.request_( { client: 'DatastoreClient', method: 'runQuery', @@ -768,7 +778,11 @@ class DatastoreRequest { }, onResultSet ); - } else { + } + function runAggregationQuery( + sharedQueryOpts: SharedQueryOptions, + queryProto: QueryProto + ) { const aggregationQueryOptions: AggregationQueryOptions = { nestedQuery: queryProto, aggregations: query.aggregations, @@ -779,7 +793,7 @@ class DatastoreRequest { aggregationQuery: aggregationQueryOptions, } ); - this.request_( + self.request_( { client: 'DatastoreClient', method: 'runAggregationQuery', @@ -790,6 +804,7 @@ class DatastoreRequest { ); } }; + function onAggregateResultSet(err?: Error | null, resp?: Entity) { if (err) { stream.destroy(err); From db9c34057e696118b4c557fe1681dc65ab151cf3 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 31 Aug 2022 11:35:21 -0400 Subject: [PATCH 35/67] move self equals this --- src/request.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/request.ts b/src/request.ts index 33d46fff6..993c470c3 100644 --- a/src/request.ts +++ b/src/request.ts @@ -729,6 +729,7 @@ class DatastoreRequest { * ``` */ runQueryStream(query: Query, options: RunQueryStreamOptions = {}): Transform { + const self = this; query = extend(true, new Query(), query); const makeRequest = (query: Query) => { const sharedQueryOpts = {} as SharedQueryOptions; @@ -762,7 +763,6 @@ class DatastoreRequest { runAggregationQuery(sharedQueryOpts, queryProto); } - const self = this; function runDataQuery( sharedQueryOpts: SharedQueryOptions, queryProto: QueryProto From b3ea9765247574f57879caa2fc242fdc2bccefd7 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 31 Aug 2022 11:51:12 -0400 Subject: [PATCH 36/67] change header --- src/request.ts | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/request.ts b/src/request.ts index 993c470c3..c4c761ea6 100644 --- a/src/request.ts +++ b/src/request.ts @@ -1,18 +1,20 @@ -/*! - * Copyright 2014 Google LLC. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** import {promisifyAll} from '@google-cloud/promisify'; import arrify = require('arrify'); From 7e9d018dafac7437f839c7870ff0473fe85a878a Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 31 Aug 2022 11:52:58 -0400 Subject: [PATCH 37/67] Revert "change header" This reverts commit b3ea9765247574f57879caa2fc242fdc2bccefd7. --- src/request.ts | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/request.ts b/src/request.ts index c4c761ea6..993c470c3 100644 --- a/src/request.ts +++ b/src/request.ts @@ -1,20 +1,18 @@ -// Copyright 2022 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** +/*! + * Copyright 2014 Google LLC. + * + * Licensed under the Apache License, Version 2.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 {promisifyAll} from '@google-cloud/promisify'; import arrify = require('arrify'); From bb839a36f0f3ffbfe424cc4d4601d00d15728fa3 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 31 Aug 2022 11:53:39 -0400 Subject: [PATCH 38/67] Add a header --- src/aggregate.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/aggregate.ts b/src/aggregate.ts index 6f0ea2046..2b26e47a4 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -1,3 +1,21 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + abstract class AggregateField { alias_?: string; From 5f5a81582900454c06e9efd00a0aafc1e5a453a5 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 31 Aug 2022 13:01:12 -0400 Subject: [PATCH 39/67] change the unit test --- test/query.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/query.ts b/test/query.ts index 25d6a9412..624c5afc3 100644 --- a/test/query.ts +++ b/test/query.ts @@ -62,8 +62,8 @@ describe('Query', () => { .aggregate(AggregateField.count().upTo(4).alias('total')) .aggregate(AggregateField.count().upTo(6).alias('total2')); assert.deepStrictEqual(query.aggregations, [ - {alias: 'total', count: {up_to: 4}}, - {alias: 'total2', count: {up_to: 6}}, + {alias: 'total', count: {upTo: {value: 4}}}, + {alias: 'total2', count: {upTo: {value: 6}}}, ]); }); }); From bd9789548fb18a5cfd6a87f55845f57bf7333e7d Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 2 Sep 2022 11:18:39 -0400 Subject: [PATCH 40/67] Architecture changes --- src/aggregate.ts | 29 ++++++- src/index.ts | 7 ++ src/query.ts | 15 +--- src/request.ts | 183 +++++++++++++++++---------------------- system-test/datastore.ts | 34 +++++--- 5 files changed, 140 insertions(+), 128 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index 2b26e47a4..be57cb48d 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -16,6 +16,33 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +import {Query} from './index'; +const AGGREGATE_QUERY = Symbol('AGGREGATE_QUERY'); + +class AggregateQuery { + type = AGGREGATE_QUERY + aggregations: Array + query: Query | undefined; + + constructor(aggregate: AggregateField) { + this.aggregations = [aggregate]; + } + + aggregate(aggregate: AggregateField): AggregateQuery { + this.aggregations.push(aggregate); + return this; + } + + over(query: Query): AggregateQuery { + this.query = query; + return this; + } + + toProto(): any { + return this.aggregations.map(aggregation => aggregation.toProto()) + } +} + abstract class AggregateField { alias_?: string; @@ -46,4 +73,4 @@ class Count extends AggregateField { } } -export {AggregateField}; +export {AggregateField, AggregateQuery, AGGREGATE_QUERY}; diff --git a/src/index.ts b/src/index.ts index 48ec56d95..fb2a17657 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,6 +64,7 @@ import { import {Transaction} from './transaction'; import {promisifyAll} from '@google-cloud/promisify'; import {google} from '../protos/protos'; +import {AggregateField, AggregateQuery} from './aggregate'; const {grpc} = new GrpcClient(); @@ -509,6 +510,10 @@ class Datastore extends DatastoreRequest { this.auth = new GoogleAuth(this.options); } + aggregate(aggregate: AggregateField): AggregateQuery { + return new AggregateQuery(aggregate); + } + /** * Export entities from this project to a Google Cloud Storage bucket. * @@ -1797,10 +1802,12 @@ class Datastore extends DatastoreRequest { */ promisifyAll(Datastore, { exclude: [ + 'aggregate', 'double', 'isDouble', 'geoPoint', 'getProjectId', + 'getSharedQueryOptions', 'isGeoPoint', 'index', 'int', diff --git a/src/query.ts b/src/query.ts index 2486d87fb..cbc464de7 100644 --- a/src/query.ts +++ b/src/query.ts @@ -21,7 +21,7 @@ import {Entity} from './entity'; import {Transaction} from './transaction'; import {CallOptions} from 'google-gax'; import {RunQueryStreamOptions} from '../src/request'; -import {AggregateField} from './aggregate'; +import {AggregateField, AggregateQuery} from './aggregate'; export type Operator = | '=' @@ -72,7 +72,6 @@ export interface Filter { * ``` */ class Query { - aggregations: Array; // TODO: Replace type with aggregation scope?: Datastore | Transaction; namespace?: string | null; kinds: string[]; @@ -161,16 +160,6 @@ class Query { * @type {number} */ this.offsetVal = -1; - /** - * @name Query#aggregations - * @type {array} - */ - this.aggregations = []; - } - - aggregate(aggregate: AggregateField) { - this.aggregations.push(aggregate.toProto()); - return this; } /** @@ -584,6 +573,8 @@ export interface RunQueryCallback { export type RunQueryResponse = [Entity[], RunQueryInfo]; +export type RunAggregateQueryResponse = any; + export interface RunQueryInfo { endCursor?: string; moreResults?: diff --git a/src/request.ts b/src/request.ts index 993c470c3..631c13faa 100644 --- a/src/request.ts +++ b/src/request.ts @@ -56,6 +56,7 @@ import { } from './query'; import {Datastore} from '.'; import ITimestamp = google.protobuf.ITimestamp; +import {AggregateQuery} from './aggregate'; /** * A map of read consistency values to proto codes. @@ -565,6 +566,59 @@ class DatastoreRequest { ); } + // TODO Change RunQueryOptions, RunQueryCallback, RunQueryResponse to right interface + runAggregateQuery(query: AggregateQuery, options?: RunQueryOptions): Promise; + runAggregateQuery( + query: AggregateQuery, + options: RunQueryOptions, + callback: RequestCallback + ): void; + runAggregateQuery(query: AggregateQuery, callback: RequestCallback): void; + runAggregateQuery( + query: AggregateQuery, + optionsOrCallback?: RunQueryOptions | RequestCallback, + cb?: RequestCallback + ): void | Promise { + // TODO: Check that the query was provided in `over`. + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + + query.query = extend(true, new Query(), query.query); + let queryProto: QueryProto; + try { + queryProto = entity.queryToQueryProto(query.query); + } catch (e) { + // using setImmediate here to make sure this doesn't throw a + // synchronous error + setImmediate(callback, e as Error); + return; + } + const sharedQueryOpts = this.getSharedQueryOptions(query.query, options); + const aggregationQueryOptions: AggregationQueryOptions = { + nestedQuery: queryProto, + aggregations: query.toProto(), + }; + const reqOpts: RunAggregationQueryRequest = Object.assign( + sharedQueryOpts, + { + aggregationQuery: aggregationQueryOptions, + } + ); + this.request_( + { + client: 'DatastoreClient', + method: 'runAggregationQuery', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (err, res) => { + callback(err, res); + } + ); + } + /** * Datastore allows you to query entities by kind, filter them by property * filters, and sort them by a property name. Projection and pagination are @@ -729,12 +783,9 @@ class DatastoreRequest { * ``` */ runQueryStream(query: Query, options: RunQueryStreamOptions = {}): Transform { - const self = this; query = extend(true, new Query(), query); const makeRequest = (query: Query) => { - const sharedQueryOpts = {} as SharedQueryOptions; let queryProto: QueryProto; - try { queryProto = entity.queryToQueryProto(query); } catch (e) { @@ -743,33 +794,11 @@ class DatastoreRequest { setImmediate(onResultSet, e as Error); return; } + const sharedQueryOpts = this.getSharedQueryOptions(query, options); - if (options.consistency) { - const code = CONSISTENCY_PROTO_CODE[options.consistency.toLowerCase()]; - sharedQueryOpts.readOptions = { - readConsistency: code, - }; - } - - if (query.namespace) { - sharedQueryOpts.partitionId = { - namespaceId: query.namespace, - }; - } - - if (query.aggregations.length === 0) { - runDataQuery(sharedQueryOpts, queryProto); - } else { - runAggregationQuery(sharedQueryOpts, queryProto); - } - - function runDataQuery( - sharedQueryOpts: SharedQueryOptions, - queryProto: QueryProto - ) { - const reqOpts: RequestOptions = sharedQueryOpts; - reqOpts.query = queryProto; - self.request_( + const reqOpts: RequestOptions = sharedQueryOpts; + reqOpts.query = queryProto; + this.request_( { client: 'DatastoreClient', method: 'runQuery', @@ -777,81 +806,9 @@ class DatastoreRequest { gaxOpts: options.gaxOptions, }, onResultSet - ); - } - function runAggregationQuery( - sharedQueryOpts: SharedQueryOptions, - queryProto: QueryProto - ) { - const aggregationQueryOptions: AggregationQueryOptions = { - nestedQuery: queryProto, - aggregations: query.aggregations, - }; - const reqOpts: RunAggregationQueryRequest = Object.assign( - sharedQueryOpts, - { - aggregationQuery: aggregationQueryOptions, - } - ); - self.request_( - { - client: 'DatastoreClient', - method: 'runAggregationQuery', - reqOpts, - gaxOpts: options.gaxOptions, - }, - onAggregateResultSet - ); - } + ); }; - function onAggregateResultSet(err?: Error | null, resp?: Entity) { - if (err) { - stream.destroy(err); - return; - } - const info: RunQueryInfo = { - moreResults: resp.batch.moreResults, - }; - if (resp.batch.endCursor) { - info.endCursor = resp.batch.endCursor.toString('base64'); - } - if (resp.batch.aggregationResults) { - try { - const results = resp.batch.aggregationResults; - const finalResults = results - .map( - (aggregationResult: any) => aggregationResult.aggregateProperties - ) - .map((aggregateProperties: any) => - Object.fromEntries( - new Map( - Object.keys(aggregateProperties).map(key => [ - key, - entity.decodeValueProto(aggregateProperties[key]), - ]) - ) - ) - ); - split(finalResults, stream).then(streamEnded => { - if (streamEnded) { - return; - } - if (resp.batch.moreResults !== 'NOT_FINISHED') { - stream.emit('info', info); - stream.push(null); - return; - } - stream.end(); - return; - }); - } catch (err) { - stream.destroy(err); - return; - } - } - } - function onResultSet(err?: Error | null, resp?: Entity) { if (err) { stream.destroy(err); @@ -913,6 +870,22 @@ class DatastoreRequest { return stream; } + private getSharedQueryOptions(query: Query, options: RunQueryStreamOptions = {}) : SharedQueryOptions { + const sharedQueryOpts = {} as SharedQueryOptions; + if (options.consistency) { + const code = CONSISTENCY_PROTO_CODE[options.consistency.toLowerCase()]; + sharedQueryOpts.readOptions = { + readConsistency: code, + }; + } + if (query.namespace) { + sharedQueryOpts.partitionId = { + namespaceId: query.namespace, + }; + } + return sharedQueryOpts; + } + /** * Merge the specified object(s). If a key is incomplete, its associated object * is inserted and the original Key object is updated to contain the generated ID. @@ -1197,7 +1170,11 @@ export type DeleteResponse = CommitResponse; * All async methods (except for streams) will return a Promise in the event * that a callback is omitted. */ -promisifyAll(DatastoreRequest); +promisifyAll(DatastoreRequest, { + exclude: [ + 'getSharedQueryOptions' + ] +}); /** * Reference to the {@link DatastoreRequest} class. diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 11e7153b4..7900299b8 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -20,7 +20,7 @@ import * as yaml from 'js-yaml'; import {Datastore, Index} from '../src'; import {google} from '../protos/protos'; import {Storage} from '@google-cloud/storage'; -import {AggregateField} from '../src/aggregate'; +import {AggregateField, AggregateQuery} from '../src/aggregate'; describe('Datastore', () => { const testKinds: string[] = []; @@ -799,18 +799,22 @@ describe('Datastore', () => { assert.strictEqual(entities!.length, 6); }); describe('with a count filter', () => { - it('should run a count aggregation', async () => { + it.only('should run a count aggregation', async () => { const q = datastore .createQuery('Character') - .aggregate(AggregateField.count()); - const [results] = await datastore.runQuery(q); + const aggregateNoOver = datastore + .aggregate(AggregateField.count()) + const aggregate = aggregateNoOver.over(q); + const results = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{property_1: 8}]); }); it('should run a count aggregation having a maximum', async () => { const q = datastore .createQuery('Character') - .aggregate(AggregateField.count().upTo(4).alias('total')); - const [results] = await datastore.runQuery(q); + const aggregate = datastore + .aggregate(AggregateField.count().upTo(4).alias('total')) + .over(q); + const results = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 4}]); }); it('should run a count aggregation having other filters', async () => { @@ -818,23 +822,29 @@ describe('Datastore', () => { .createQuery('Character') .filter('family', 'Stark') .filter('appearances', '>=', 20) - .aggregate(AggregateField.count().alias('total')); - const [results] = await datastore.runQuery(q); + const aggregate = datastore + .aggregate(AggregateField.count().alias('total')) + .over(q); + const results = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 6}]); }); it('should run a count aggregate filter with an alias', async () => { const q = datastore .createQuery('Character') - .aggregate(AggregateField.count().alias('total')); - const [results] = await datastore.runQuery(q); + const aggregate = datastore + .aggregate(AggregateField.count().alias('total')) + .over(q); + const results = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 8}]); }); it('should do multiple count aggregations', async () => { const q = datastore .createQuery('Character') + const aggregate = datastore .aggregate(AggregateField.count().alias('total')) - .aggregate(AggregateField.count().alias('total2')); - const [results] = await datastore.runQuery(q); + .aggregate(AggregateField.count().alias('total2')) + .over(q); + const results = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 8, total2: 8}]); }); }); From 9b0943cf0ea94d38c0474b9f0d08dde98137a199 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 2 Sep 2022 11:47:07 -0400 Subject: [PATCH 41/67] Getting closer --- src/request.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/request.ts b/src/request.ts index 631c13faa..9299eef5f 100644 --- a/src/request.ts +++ b/src/request.ts @@ -614,7 +614,11 @@ class DatastoreRequest { gaxOpts: options.gaxOptions, }, (err, res) => { - callback(err, res); + if (res && res.batch) { + callback(err, res.batch.aggregationResults); + } else { + callback(err, res); + } } ); } From 3ed910a8fd60ba717ea3eea1741f2fb38fd45586 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Fri, 2 Sep 2022 11:47:37 -0400 Subject: [PATCH 42/67] Add the right parsing --- src/request.ts | 17 ++++++++++++++++- system-test/datastore.ts | 12 ++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/request.ts b/src/request.ts index 9299eef5f..ac2906d77 100644 --- a/src/request.ts +++ b/src/request.ts @@ -615,7 +615,22 @@ class DatastoreRequest { }, (err, res) => { if (res && res.batch) { - callback(err, res.batch.aggregationResults); + const results = res.batch.aggregationResults; + const finalResults = results + .map( + (aggregationResult: any) => aggregationResult.aggregateProperties + ) + .map((aggregateProperties: any) => + Object.fromEntries( + new Map( + Object.keys(aggregateProperties).map(key => [ + key, + entity.decodeValueProto(aggregateProperties[key]), + ]) + ) + ) + ); + callback(err, finalResults); } else { callback(err, res); } diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 7900299b8..8f240b9f7 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -799,13 +799,13 @@ describe('Datastore', () => { assert.strictEqual(entities!.length, 6); }); describe('with a count filter', () => { - it.only('should run a count aggregation', async () => { + it('should run a count aggregation', async () => { const q = datastore .createQuery('Character') const aggregateNoOver = datastore .aggregate(AggregateField.count()) const aggregate = aggregateNoOver.over(q); - const results = await datastore.runAggregateQuery(aggregate); + const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{property_1: 8}]); }); it('should run a count aggregation having a maximum', async () => { @@ -814,7 +814,7 @@ describe('Datastore', () => { const aggregate = datastore .aggregate(AggregateField.count().upTo(4).alias('total')) .over(q); - const results = await datastore.runAggregateQuery(aggregate); + const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 4}]); }); it('should run a count aggregation having other filters', async () => { @@ -825,7 +825,7 @@ describe('Datastore', () => { const aggregate = datastore .aggregate(AggregateField.count().alias('total')) .over(q); - const results = await datastore.runAggregateQuery(aggregate); + const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 6}]); }); it('should run a count aggregate filter with an alias', async () => { @@ -834,7 +834,7 @@ describe('Datastore', () => { const aggregate = datastore .aggregate(AggregateField.count().alias('total')) .over(q); - const results = await datastore.runAggregateQuery(aggregate); + const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 8}]); }); it('should do multiple count aggregations', async () => { @@ -844,7 +844,7 @@ describe('Datastore', () => { .aggregate(AggregateField.count().alias('total')) .aggregate(AggregateField.count().alias('total2')) .over(q); - const results = await datastore.runAggregateQuery(aggregate); + const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 8, total2: 8}]); }); }); From 60a34868ec1e777ff709b1d6f43f5516a85a7906 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 14 Sep 2022 10:09:43 -0400 Subject: [PATCH 43/67] TODO message --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index fb2a17657..7ba58ebed 100644 --- a/src/index.ts +++ b/src/index.ts @@ -510,6 +510,7 @@ class Datastore extends DatastoreRequest { this.auth = new GoogleAuth(this.options); } + // TODO: Change this to accept an array instead aggregate(aggregate: AggregateField): AggregateQuery { return new AggregateQuery(aggregate); } From 83dad3bdc6576dca7130c1a0c7b7dda162316da4 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 14 Sep 2022 10:11:24 -0400 Subject: [PATCH 44/67] Remove and add array over for aggregate fields --- src/aggregate.ts | 14 +++++--------- src/index.ts | 4 ++-- system-test/datastore.ts | 23 +++++++++++------------ 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index be57cb48d..0b16693dc 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -24,17 +24,13 @@ class AggregateQuery { aggregations: Array query: Query | undefined; - constructor(aggregate: AggregateField) { - this.aggregations = [aggregate]; - } - - aggregate(aggregate: AggregateField): AggregateQuery { - this.aggregations.push(aggregate); - return this; + constructor(query: Query) { + this.query = query; + this.aggregations = []; } - over(query: Query): AggregateQuery { - this.query = query; + aggregate(aggregates: AggregateField[]): AggregateQuery { + aggregates.forEach(aggregate => this.aggregations.push(aggregate)); return this; } diff --git a/src/index.ts b/src/index.ts index 7ba58ebed..e883e40cf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -511,8 +511,8 @@ class Datastore extends DatastoreRequest { } // TODO: Change this to accept an array instead - aggregate(aggregate: AggregateField): AggregateQuery { - return new AggregateQuery(aggregate); + aggregate_query(query: Query): AggregateQuery { + return new AggregateQuery(query); } /** diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 8f240b9f7..77fa582ef 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -802,9 +802,9 @@ describe('Datastore', () => { it('should run a count aggregation', async () => { const q = datastore .createQuery('Character') - const aggregateNoOver = datastore - .aggregate(AggregateField.count()) - const aggregate = aggregateNoOver.over(q); + const aggregate = datastore + .aggregate_query(q) + .aggregate([AggregateField.count()]) const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{property_1: 8}]); }); @@ -812,8 +812,8 @@ describe('Datastore', () => { const q = datastore .createQuery('Character') const aggregate = datastore - .aggregate(AggregateField.count().upTo(4).alias('total')) - .over(q); + .aggregate_query(q) + .aggregate([AggregateField.count().upTo(4).alias('total')]) const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 4}]); }); @@ -823,8 +823,8 @@ describe('Datastore', () => { .filter('family', 'Stark') .filter('appearances', '>=', 20) const aggregate = datastore - .aggregate(AggregateField.count().alias('total')) - .over(q); + .aggregate_query(q) + .aggregate([AggregateField.count().alias('total')]) const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 6}]); }); @@ -832,8 +832,8 @@ describe('Datastore', () => { const q = datastore .createQuery('Character') const aggregate = datastore - .aggregate(AggregateField.count().alias('total')) - .over(q); + .aggregate_query(q) + .aggregate([AggregateField.count().alias('total')]) const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 8}]); }); @@ -841,9 +841,8 @@ describe('Datastore', () => { const q = datastore .createQuery('Character') const aggregate = datastore - .aggregate(AggregateField.count().alias('total')) - .aggregate(AggregateField.count().alias('total2')) - .over(q); + .aggregate_query(q) + .aggregate([AggregateField.count().alias('total'), AggregateField.count().alias('total2')]) const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 8, total2: 8}]); }); From 5370810f686b721c4ce2b11f12e63581522a9573 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 14 Sep 2022 10:12:09 -0400 Subject: [PATCH 45/67] unit test and count function --- src/aggregate.ts | 4 ++++ test/query.ts | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index 0b16693dc..d17a4c3f6 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -29,6 +29,10 @@ class AggregateQuery { this.aggregations = []; } + count(alias: string, upTo: number) { + this.aggregations.push(AggregateField.count().upTo(upTo).alias(alias)); + } + aggregate(aggregates: AggregateField[]): AggregateQuery { aggregates.forEach(aggregate => this.aggregations.push(aggregate)); return this; diff --git a/test/query.ts b/test/query.ts index 624c5afc3..32b5825c0 100644 --- a/test/query.ts +++ b/test/query.ts @@ -18,7 +18,7 @@ import {beforeEach, describe, it} from 'mocha'; const {Query} = require('../src/query'); // eslint-disable-next-line @typescript-eslint/no-var-requires import {Datastore} from '../src'; -import {AggregateField} from '../src/aggregate'; +import {AggregateField, AggregateQuery} from '../src/aggregate'; describe('Query', () => { const SCOPE = {} as Datastore; @@ -59,9 +59,9 @@ describe('Query', () => { it('should create a query with a count aggregation', () => { const query = new Query(['kind1']) - .aggregate(AggregateField.count().upTo(4).alias('total')) - .aggregate(AggregateField.count().upTo(6).alias('total2')); - assert.deepStrictEqual(query.aggregations, [ + const aggregate = new AggregateQuery(query) + .aggregate([AggregateField.count().upTo(4).alias('total'), AggregateField.count().upTo(6).alias('total2')]); + assert.deepStrictEqual(aggregate.aggregations, [ {alias: 'total', count: {upTo: {value: 4}}}, {alias: 'total2', count: {upTo: {value: 6}}}, ]); From b6278b3c2e8f5224e6527c59f909479f70b1c503 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 21 Sep 2022 17:29:05 -0400 Subject: [PATCH 46/67] fix unit test as result of new changes --- test/query.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/query.ts b/test/query.ts index 32b5825c0..9890c33f2 100644 --- a/test/query.ts +++ b/test/query.ts @@ -59,11 +59,13 @@ describe('Query', () => { it('should create a query with a count aggregation', () => { const query = new Query(['kind1']) + const firstAggregation = AggregateField.count().upTo(4).alias('total'); + const secondAggregation = AggregateField.count().upTo(6).alias('total2') const aggregate = new AggregateQuery(query) - .aggregate([AggregateField.count().upTo(4).alias('total'), AggregateField.count().upTo(6).alias('total2')]); + .aggregate([firstAggregation, secondAggregation]); assert.deepStrictEqual(aggregate.aggregations, [ - {alias: 'total', count: {upTo: {value: 4}}}, - {alias: 'total2', count: {upTo: {value: 6}}}, + firstAggregation, + secondAggregation, ]); }); }); From eca8b33be7e26dfee9dd8ff0350f03bbb1aaa424 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 21 Sep 2022 17:30:18 -0400 Subject: [PATCH 47/67] linting fix --- src/aggregate.ts | 6 +-- src/request.ts | 105 ++++++++++++++++++++------------------- system-test/datastore.ts | 29 ++++++----- test/query.ts | 10 ++-- 4 files changed, 76 insertions(+), 74 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index d17a4c3f6..57ef6ae0a 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -20,8 +20,8 @@ import {Query} from './index'; const AGGREGATE_QUERY = Symbol('AGGREGATE_QUERY'); class AggregateQuery { - type = AGGREGATE_QUERY - aggregations: Array + type = AGGREGATE_QUERY; + aggregations: Array; query: Query | undefined; constructor(query: Query) { @@ -39,7 +39,7 @@ class AggregateQuery { } toProto(): any { - return this.aggregations.map(aggregation => aggregation.toProto()) + return this.aggregations.map(aggregation => aggregation.toProto()); } } diff --git a/src/request.ts b/src/request.ts index ac2906d77..dea4cbf41 100644 --- a/src/request.ts +++ b/src/request.ts @@ -567,23 +567,26 @@ class DatastoreRequest { } // TODO Change RunQueryOptions, RunQueryCallback, RunQueryResponse to right interface - runAggregateQuery(query: AggregateQuery, options?: RunQueryOptions): Promise; runAggregateQuery( - query: AggregateQuery, - options: RunQueryOptions, - callback: RequestCallback + query: AggregateQuery, + options?: RunQueryOptions + ): Promise; + runAggregateQuery( + query: AggregateQuery, + options: RunQueryOptions, + callback: RequestCallback ): void; runAggregateQuery(query: AggregateQuery, callback: RequestCallback): void; runAggregateQuery( - query: AggregateQuery, - optionsOrCallback?: RunQueryOptions | RequestCallback, - cb?: RequestCallback + query: AggregateQuery, + optionsOrCallback?: RunQueryOptions | RequestCallback, + cb?: RequestCallback ): void | Promise { // TODO: Check that the query was provided in `over`. const options = - typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; const callback = - typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; query.query = extend(true, new Query(), query.query); let queryProto: QueryProto; @@ -600,41 +603,38 @@ class DatastoreRequest { nestedQuery: queryProto, aggregations: query.toProto(), }; - const reqOpts: RunAggregationQueryRequest = Object.assign( - sharedQueryOpts, - { - aggregationQuery: aggregationQueryOptions, - } - ); + const reqOpts: RunAggregationQueryRequest = Object.assign(sharedQueryOpts, { + aggregationQuery: aggregationQueryOptions, + }); this.request_( - { - client: 'DatastoreClient', - method: 'runAggregationQuery', - reqOpts, - gaxOpts: options.gaxOptions, - }, - (err, res) => { - if (res && res.batch) { - const results = res.batch.aggregationResults; - const finalResults = results - .map( - (aggregationResult: any) => aggregationResult.aggregateProperties + { + client: 'DatastoreClient', + method: 'runAggregationQuery', + reqOpts, + gaxOpts: options.gaxOptions, + }, + (err, res) => { + if (res && res.batch) { + const results = res.batch.aggregationResults; + const finalResults = results + .map( + (aggregationResult: any) => aggregationResult.aggregateProperties + ) + .map((aggregateProperties: any) => + Object.fromEntries( + new Map( + Object.keys(aggregateProperties).map(key => [ + key, + entity.decodeValueProto(aggregateProperties[key]), + ]) ) - .map((aggregateProperties: any) => - Object.fromEntries( - new Map( - Object.keys(aggregateProperties).map(key => [ - key, - entity.decodeValueProto(aggregateProperties[key]), - ]) - ) - ) - ); - callback(err, finalResults); - } else { - callback(err, res); - } + ) + ); + callback(err, finalResults); + } else { + callback(err, res); } + } ); } @@ -818,13 +818,13 @@ class DatastoreRequest { const reqOpts: RequestOptions = sharedQueryOpts; reqOpts.query = queryProto; this.request_( - { - client: 'DatastoreClient', - method: 'runQuery', - reqOpts, - gaxOpts: options.gaxOptions, - }, - onResultSet + { + client: 'DatastoreClient', + method: 'runQuery', + reqOpts, + gaxOpts: options.gaxOptions, + }, + onResultSet ); }; @@ -889,7 +889,10 @@ class DatastoreRequest { return stream; } - private getSharedQueryOptions(query: Query, options: RunQueryStreamOptions = {}) : SharedQueryOptions { + private getSharedQueryOptions( + query: Query, + options: RunQueryStreamOptions = {} + ): SharedQueryOptions { const sharedQueryOpts = {} as SharedQueryOptions; if (options.consistency) { const code = CONSISTENCY_PROTO_CODE[options.consistency.toLowerCase()]; @@ -1190,9 +1193,7 @@ export type DeleteResponse = CommitResponse; * that a callback is omitted. */ promisifyAll(DatastoreRequest, { - exclude: [ - 'getSharedQueryOptions' - ] + exclude: ['getSharedQueryOptions'], }); /** diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 77fa582ef..22226e27a 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -800,20 +800,18 @@ describe('Datastore', () => { }); describe('with a count filter', () => { it('should run a count aggregation', async () => { - const q = datastore - .createQuery('Character') + const q = datastore.createQuery('Character'); const aggregate = datastore - .aggregate_query(q) - .aggregate([AggregateField.count()]) + .aggregate_query(q) + .aggregate([AggregateField.count()]); const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{property_1: 8}]); }); it('should run a count aggregation having a maximum', async () => { - const q = datastore - .createQuery('Character') + const q = datastore.createQuery('Character'); const aggregate = datastore .aggregate_query(q) - .aggregate([AggregateField.count().upTo(4).alias('total')]) + .aggregate([AggregateField.count().upTo(4).alias('total')]); const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 4}]); }); @@ -821,28 +819,29 @@ describe('Datastore', () => { const q = datastore .createQuery('Character') .filter('family', 'Stark') - .filter('appearances', '>=', 20) + .filter('appearances', '>=', 20); const aggregate = datastore .aggregate_query(q) - .aggregate([AggregateField.count().alias('total')]) + .aggregate([AggregateField.count().alias('total')]); const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 6}]); }); it('should run a count aggregate filter with an alias', async () => { - const q = datastore - .createQuery('Character') + const q = datastore.createQuery('Character'); const aggregate = datastore .aggregate_query(q) - .aggregate([AggregateField.count().alias('total')]) + .aggregate([AggregateField.count().alias('total')]); const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 8}]); }); it('should do multiple count aggregations', async () => { - const q = datastore - .createQuery('Character') + const q = datastore.createQuery('Character'); const aggregate = datastore .aggregate_query(q) - .aggregate([AggregateField.count().alias('total'), AggregateField.count().alias('total2')]) + .aggregate([ + AggregateField.count().alias('total'), + AggregateField.count().alias('total2'), + ]); const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 8, total2: 8}]); }); diff --git a/test/query.ts b/test/query.ts index 9890c33f2..8c5e274c1 100644 --- a/test/query.ts +++ b/test/query.ts @@ -58,11 +58,13 @@ describe('Query', () => { }); it('should create a query with a count aggregation', () => { - const query = new Query(['kind1']) + const query = new Query(['kind1']); const firstAggregation = AggregateField.count().upTo(4).alias('total'); - const secondAggregation = AggregateField.count().upTo(6).alias('total2') - const aggregate = new AggregateQuery(query) - .aggregate([firstAggregation, secondAggregation]); + const secondAggregation = AggregateField.count().upTo(6).alias('total2'); + const aggregate = new AggregateQuery(query).aggregate([ + firstAggregation, + secondAggregation, + ]); assert.deepStrictEqual(aggregate.aggregations, [ firstAggregation, secondAggregation, From 8fa14af834e1bd4eb44bc2ad2c69c6b7badf45d2 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Thu, 22 Sep 2022 13:04:24 -0400 Subject: [PATCH 48/67] Added a test for encoding using a count function --- src/aggregate.ts | 3 ++- test/query.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index 57ef6ae0a..cf621fb6c 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -29,8 +29,9 @@ class AggregateQuery { this.aggregations = []; } - count(alias: string, upTo: number) { + count(alias: string, upTo: number): AggregateQuery { this.aggregations.push(AggregateField.count().upTo(upTo).alias(alias)); + return this; } aggregate(aggregates: AggregateField[]): AggregateQuery { diff --git a/test/query.ts b/test/query.ts index 8c5e274c1..a3cbe90fe 100644 --- a/test/query.ts +++ b/test/query.ts @@ -65,6 +65,8 @@ describe('Query', () => { firstAggregation, secondAggregation, ]); + const aggregate2 = new AggregateQuery(query).count('total', 4).count('total2', 6); + assert.deepStrictEqual(aggregate.aggregations, aggregate2.aggregations); assert.deepStrictEqual(aggregate.aggregations, [ firstAggregation, secondAggregation, From 5acff03553370b1b9c7dfbe51c843f1e49ef38d3 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Thu, 22 Sep 2022 13:09:34 -0400 Subject: [PATCH 49/67] lint fix --- test/query.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/query.ts b/test/query.ts index a3cbe90fe..8e8b4ce70 100644 --- a/test/query.ts +++ b/test/query.ts @@ -65,7 +65,9 @@ describe('Query', () => { firstAggregation, secondAggregation, ]); - const aggregate2 = new AggregateQuery(query).count('total', 4).count('total2', 6); + const aggregate2 = new AggregateQuery(query) + .count('total', 4) + .count('total2', 6); assert.deepStrictEqual(aggregate.aggregations, aggregate2.aggregations); assert.deepStrictEqual(aggregate.aggregations, [ firstAggregation, From 6766066055ddb53b52ce276fb606d5f19f0d3ab6 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Thu, 6 Oct 2022 10:07:29 -0700 Subject: [PATCH 50/67] removed upTo --- src/aggregate.ts | 14 +++----------- system-test/datastore.ts | 2 +- test/query.ts | 8 ++++---- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index cf621fb6c..e0b99e237 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -29,8 +29,8 @@ class AggregateQuery { this.aggregations = []; } - count(alias: string, upTo: number): AggregateQuery { - this.aggregations.push(AggregateField.count().upTo(upTo).alias(alias)); + count(alias: string): AggregateQuery { + this.aggregations.push(AggregateField.count().alias(alias)); return this; } @@ -60,16 +60,8 @@ abstract class AggregateField { } class Count extends AggregateField { - upTo_?: number; - - upTo(upTo: number): AggregateField { - this.upTo_ = upTo; - return this; - } - toProto(): any { - const convertedUpTo = this.upTo_ ? {upTo: {value: this.upTo_}} : null; - const count = Object.assign({}, convertedUpTo); + const count = Object.assign({}); return Object.assign({count}, this.alias_ ? {alias: this.alias_} : null); } } diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 22226e27a..3c5ab4e4d 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -811,7 +811,7 @@ describe('Datastore', () => { const q = datastore.createQuery('Character'); const aggregate = datastore .aggregate_query(q) - .aggregate([AggregateField.count().upTo(4).alias('total')]); + .aggregate([AggregateField.count().alias('total')]); const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{total: 4}]); }); diff --git a/test/query.ts b/test/query.ts index 8e8b4ce70..9477558da 100644 --- a/test/query.ts +++ b/test/query.ts @@ -59,15 +59,15 @@ describe('Query', () => { it('should create a query with a count aggregation', () => { const query = new Query(['kind1']); - const firstAggregation = AggregateField.count().upTo(4).alias('total'); - const secondAggregation = AggregateField.count().upTo(6).alias('total2'); + const firstAggregation = AggregateField.count().alias('total'); + const secondAggregation = AggregateField.count().alias('total2'); const aggregate = new AggregateQuery(query).aggregate([ firstAggregation, secondAggregation, ]); const aggregate2 = new AggregateQuery(query) - .count('total', 4) - .count('total2', 6); + .count('total') + .count('total2'); assert.deepStrictEqual(aggregate.aggregations, aggregate2.aggregations); assert.deepStrictEqual(aggregate.aggregations, [ firstAggregation, From 881a8003e2bdacf61280cd3f3f2aa772a1aa2e10 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Tue, 18 Oct 2022 11:13:18 -0700 Subject: [PATCH 51/67] merge --- package.json | 2 +- protos/protos.d.ts | 2 +- protos/protos.js | 3876 +++++++++++++++++++++++++++++++++++--- system-test/datastore.ts | 8 - 4 files changed, 3603 insertions(+), 285 deletions(-) diff --git a/package.json b/package.json index 9faa6d51f..c0d3877d6 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "prepare": "npm run compile-protos && npm run compile", "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", "presystem-test": "npm run compile", - "system-test": "mocha build/system-test --timeout 600000", + "system-test": "mocha build/system-test --inspect-brk", "pretest": "npm run compile", "test": "c8 mocha build/test", "precompile": "gts clean" diff --git a/protos/protos.d.ts b/protos/protos.d.ts index efdba35c4..827262b9d 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Long = require("long"); import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); /** Namespace google. */ export namespace google { diff --git a/protos/protos.js b/protos/protos.js index 08de14235..7fe9ed2c2 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -580,6 +580,12 @@ message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } switch (object.operationType) { + default: + if (typeof object.operationType === "number") { + message.operationType = object.operationType; + break; + } + break; case "OPERATION_TYPE_UNSPECIFIED": case 0: message.operationType = 0; @@ -609,6 +615,12 @@ message.labels[keys[i]] = String(object.labels[keys[i]]); } switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -671,7 +683,7 @@ if (message.endTime != null && message.hasOwnProperty("endTime")) object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.datastore.admin.v1.OperationType[message.operationType] : message.operationType; + object.operationType = options.enums === String ? $root.google.datastore.admin.v1.OperationType[message.operationType] === undefined ? message.operationType : $root.google.datastore.admin.v1.OperationType[message.operationType] : message.operationType; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; @@ -679,7 +691,7 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.CommonMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.datastore.admin.v1.CommonMetadata.State[message.state] === undefined ? message.state : $root.google.datastore.admin.v1.CommonMetadata.State[message.state] : message.state; return object; }; @@ -4368,6 +4380,12 @@ return object; var message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); switch (object.migrationState) { + default: + if (typeof object.migrationState === "number") { + message.migrationState = object.migrationState; + break; + } + break; case "MIGRATION_STATE_UNSPECIFIED": case 0: message.migrationState = 0; @@ -4386,6 +4404,12 @@ break; } switch (object.migrationStep) { + default: + if (typeof object.migrationStep === "number") { + message.migrationStep = object.migrationStep; + break; + } + break; case "MIGRATION_STEP_UNSPECIFIED": case 0: message.migrationStep = 0; @@ -4440,9 +4464,9 @@ object.migrationStep = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; } if (message.migrationState != null && message.hasOwnProperty("migrationState")) - object.migrationState = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.migrationState] : message.migrationState; + object.migrationState = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.migrationState] === undefined ? message.migrationState : $root.google.datastore.admin.v1.MigrationState[message.migrationState] : message.migrationState; if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) - object.migrationStep = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] : message.migrationStep; + object.migrationStep = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] === undefined ? message.migrationStep : $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] : message.migrationStep; return object; }; @@ -4765,6 +4789,12 @@ if (object.kind != null) message.kind = String(object.kind); switch (object.ancestor) { + default: + if (typeof object.ancestor === "number") { + message.ancestor = object.ancestor; + break; + } + break; case "ANCESTOR_MODE_UNSPECIFIED": case 0: message.ancestor = 0; @@ -4789,6 +4819,12 @@ } } switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -4842,14 +4878,14 @@ if (message.kind != null && message.hasOwnProperty("kind")) object.kind = message.kind; if (message.ancestor != null && message.hasOwnProperty("ancestor")) - object.ancestor = options.enums === String ? $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] : message.ancestor; + object.ancestor = options.enums === String ? $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] === undefined ? message.ancestor : $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] : message.ancestor; if (message.properties && message.properties.length) { object.properties = []; for (var j = 0; j < message.properties.length; ++j) object.properties[j] = $root.google.datastore.admin.v1.Index.IndexedProperty.toObject(message.properties[j], options); } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.Index.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.datastore.admin.v1.Index.State[message.state] === undefined ? message.state : $root.google.datastore.admin.v1.Index.State[message.state] : message.state; return object; }; @@ -5087,6 +5123,12 @@ if (object.name != null) message.name = String(object.name); switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; case "DIRECTION_UNSPECIFIED": case 0: message.direction = 0; @@ -5123,7 +5165,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.datastore.admin.v1.Index.Direction[message.direction] : message.direction; + object.direction = options.enums === String ? $root.google.datastore.admin.v1.Index.Direction[message.direction] === undefined ? message.direction : $root.google.datastore.admin.v1.Index.Direction[message.direction] : message.direction; return object; }; @@ -5336,6 +5378,12 @@ return object; var message = new $root.google.datastore.admin.v1.MigrationStateEvent(); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "MIGRATION_STATE_UNSPECIFIED": case 0: message.state = 0; @@ -5372,7 +5420,7 @@ if (options.defaults) object.state = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.state] : message.state; + object.state = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.state] === undefined ? message.state : $root.google.datastore.admin.v1.MigrationState[message.state] : message.state; return object; }; @@ -5629,6 +5677,12 @@ return object; var message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); switch (object.step) { + default: + if (typeof object.step === "number") { + message.step = object.step; + break; + } + break; case "MIGRATION_STEP_UNSPECIFIED": case 0: message.step = 0; @@ -5691,7 +5745,7 @@ if (options.defaults) object.step = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; if (message.step != null && message.hasOwnProperty("step")) - object.step = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.step] : message.step; + object.step = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.step] === undefined ? message.step : $root.google.datastore.admin.v1.MigrationStep[message.step] : message.step; if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { object.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.toObject(message.prepareStepDetails, options); if (options.oneofs) @@ -5906,6 +5960,12 @@ return object; var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); switch (object.concurrencyMode) { + default: + if (typeof object.concurrencyMode === "number") { + message.concurrencyMode = object.concurrencyMode; + break; + } + break; case "CONCURRENCY_MODE_UNSPECIFIED": case 0: message.concurrencyMode = 0; @@ -5942,7 +6002,7 @@ if (options.defaults) object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; + object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] === undefined ? message.concurrencyMode : $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; return object; }; @@ -6132,6 +6192,12 @@ return object; var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); switch (object.concurrencyMode) { + default: + if (typeof object.concurrencyMode === "number") { + message.concurrencyMode = object.concurrencyMode; + break; + } + break; case "CONCURRENCY_MODE_UNSPECIFIED": case 0: message.concurrencyMode = 0; @@ -6168,7 +6234,7 @@ if (options.defaults) object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; + object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] === undefined ? message.concurrencyMode : $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; return object; }; @@ -6360,26 +6426,19 @@ var tag = reader.uint32(); switch (tag >>> 3) { case 2: { - if (message.aggregateProperties === $util.emptyObject) - message.aggregateProperties = {}; - 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.datastore.v1.Value.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.aggregateProperties[key] = value; + if (!(message.missing && message.missing.length)) + message.missing = []; + message.missing.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.deferred && message.deferred.length)) + message.deferred = []; + message.deferred.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + break; + } + case 7: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -6391,144 +6450,209 @@ }; /** - * Decodes an AggregationResult message from the specified reader or buffer, length delimited. + * Decodes a LookupResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.LookupResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationResult} AggregationResult + * @returns {google.datastore.v1.LookupResponse} LookupResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AggregationResult.decodeDelimited = function decodeDelimited(reader) { + LookupResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AggregationResult message. + * Verifies a LookupResponse message. * @function verify - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.LookupResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AggregationResult.verify = function verify(message) { + LookupResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.aggregateProperties != null && message.hasOwnProperty("aggregateProperties")) { - if (!$util.isObject(message.aggregateProperties)) - return "aggregateProperties: object expected"; - var key = Object.keys(message.aggregateProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.datastore.v1.Value.verify(message.aggregateProperties[key[i]]); + if (message.found != null && message.hasOwnProperty("found")) { + if (!Array.isArray(message.found)) + return "found: array expected"; + for (var i = 0; i < message.found.length; ++i) { + var error = $root.google.datastore.v1.EntityResult.verify(message.found[i]); if (error) - return "aggregateProperties." + error; + return "found." + error; + } + } + if (message.missing != null && message.hasOwnProperty("missing")) { + if (!Array.isArray(message.missing)) + return "missing: array expected"; + for (var i = 0; i < message.missing.length; ++i) { + var error = $root.google.datastore.v1.EntityResult.verify(message.missing[i]); + if (error) + return "missing." + error; + } + } + if (message.deferred != null && message.hasOwnProperty("deferred")) { + if (!Array.isArray(message.deferred)) + return "deferred: array expected"; + for (var i = 0; i < message.deferred.length; ++i) { + var error = $root.google.datastore.v1.Key.verify(message.deferred[i]); + if (error) + return "deferred." + error; } } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } return null; }; /** - * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. + * Creates a LookupResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.LookupResponse * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationResult} AggregationResult + * @returns {google.datastore.v1.LookupResponse} LookupResponse */ - AggregationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AggregationResult) + LookupResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.LookupResponse) return object; - var message = new $root.google.datastore.v1.AggregationResult(); - if (object.aggregateProperties) { - if (typeof object.aggregateProperties !== "object") - throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); - message.aggregateProperties = {}; - for (var keys = Object.keys(object.aggregateProperties), i = 0; i < keys.length; ++i) { - if (typeof object.aggregateProperties[keys[i]] !== "object") - throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); - message.aggregateProperties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.aggregateProperties[keys[i]]); + var message = new $root.google.datastore.v1.LookupResponse(); + if (object.found) { + if (!Array.isArray(object.found)) + throw TypeError(".google.datastore.v1.LookupResponse.found: array expected"); + message.found = []; + for (var i = 0; i < object.found.length; ++i) { + if (typeof object.found[i] !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.found: object expected"); + message.found[i] = $root.google.datastore.v1.EntityResult.fromObject(object.found[i]); + } + } + if (object.missing) { + if (!Array.isArray(object.missing)) + throw TypeError(".google.datastore.v1.LookupResponse.missing: array expected"); + message.missing = []; + for (var i = 0; i < object.missing.length; ++i) { + if (typeof object.missing[i] !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.missing: object expected"); + message.missing[i] = $root.google.datastore.v1.EntityResult.fromObject(object.missing[i]); + } + } + if (object.deferred) { + if (!Array.isArray(object.deferred)) + throw TypeError(".google.datastore.v1.LookupResponse.deferred: array expected"); + message.deferred = []; + for (var i = 0; i < object.deferred.length; ++i) { + if (typeof object.deferred[i] !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.deferred: object expected"); + message.deferred[i] = $root.google.datastore.v1.Key.fromObject(object.deferred[i]); } } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.LookupResponse.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } return message; }; /** - * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. + * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.LookupResponse * @static - * @param {google.datastore.v1.AggregationResult} message AggregationResult + * @param {google.datastore.v1.LookupResponse} message LookupResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AggregationResult.toObject = function toObject(message, options) { + LookupResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.aggregateProperties = {}; - var keys2; - if (message.aggregateProperties && (keys2 = Object.keys(message.aggregateProperties)).length) { - object.aggregateProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.aggregateProperties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.aggregateProperties[keys2[j]], options); + if (options.arrays || options.defaults) { + object.found = []; + object.missing = []; + object.deferred = []; + } + if (options.defaults) + object.readTime = null; + if (message.found && message.found.length) { + object.found = []; + for (var j = 0; j < message.found.length; ++j) + object.found[j] = $root.google.datastore.v1.EntityResult.toObject(message.found[j], options); + } + if (message.missing && message.missing.length) { + object.missing = []; + for (var j = 0; j < message.missing.length; ++j) + object.missing[j] = $root.google.datastore.v1.EntityResult.toObject(message.missing[j], options); } + if (message.deferred && message.deferred.length) { + object.deferred = []; + for (var j = 0; j < message.deferred.length; ++j) + object.deferred[j] = $root.google.datastore.v1.Key.toObject(message.deferred[j], options); + } + if (message.readTime != null && message.hasOwnProperty("readTime")) + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); return object; }; /** - * Converts this AggregationResult to JSON. + * Converts this LookupResponse to JSON. * @function toJSON - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.LookupResponse * @instance * @returns {Object.} JSON object */ - AggregationResult.prototype.toJSON = function toJSON() { + LookupResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AggregationResult + * Gets the default type url for LookupResponse * @function getTypeUrl - * @memberof google.datastore.v1.AggregationResult + * @memberof google.datastore.v1.LookupResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AggregationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + LookupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.datastore.v1.AggregationResult"; + return typeUrlPrefix + "/google.datastore.v1.LookupResponse"; }; - return AggregationResult; + return LookupResponse; })(); - v1.AggregationResultBatch = (function() { + v1.RunQueryRequest = (function() { /** - * Properties of an AggregationResultBatch. + * Properties of a RunQueryRequest. * @memberof google.datastore.v1 - * @interface IAggregationResultBatch - * @property {Array.|null} [aggregationResults] AggregationResultBatch aggregationResults - * @property {google.datastore.v1.QueryResultBatch.MoreResultsType|null} [moreResults] AggregationResultBatch moreResults - * @property {google.protobuf.ITimestamp|null} [readTime] AggregationResultBatch readTime + * @interface IRunQueryRequest + * @property {string|null} [projectId] RunQueryRequest projectId + * @property {string|null} [databaseId] RunQueryRequest databaseId + * @property {google.datastore.v1.IPartitionId|null} [partitionId] RunQueryRequest partitionId + * @property {google.datastore.v1.IReadOptions|null} [readOptions] RunQueryRequest readOptions + * @property {google.datastore.v1.IQuery|null} [query] RunQueryRequest query + * @property {google.datastore.v1.IGqlQuery|null} [gqlQuery] RunQueryRequest gqlQuery */ /** - * Constructs a new AggregationResultBatch. + * Constructs a new RunQueryRequest. * @memberof google.datastore.v1 - * @classdesc Represents an AggregationResultBatch. - * @implements IAggregationResultBatch + * @classdesc Represents a RunQueryRequest. + * @implements IRunQueryRequest * @constructor - * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set + * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set */ - function AggregationResultBatch(properties) { - this.aggregationResults = []; + function RunQueryRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6536,222 +6660,3336 @@ } /** - * AggregationResultBatch aggregationResults. - * @member {Array.} aggregationResults - * @memberof google.datastore.v1.AggregationResultBatch + * RunQueryRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.RunQueryRequest * @instance */ - AggregationResultBatch.prototype.aggregationResults = $util.emptyArray; + RunQueryRequest.prototype.projectId = ""; /** - * AggregationResultBatch moreResults. - * @member {google.datastore.v1.QueryResultBatch.MoreResultsType} moreResults - * @memberof google.datastore.v1.AggregationResultBatch + * RunQueryRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.RunQueryRequest * @instance */ - AggregationResultBatch.prototype.moreResults = 0; + RunQueryRequest.prototype.databaseId = ""; /** - * AggregationResultBatch readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.AggregationResultBatch + * RunQueryRequest partitionId. + * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId + * @memberof google.datastore.v1.RunQueryRequest * @instance */ - AggregationResultBatch.prototype.readTime = null; + RunQueryRequest.prototype.partitionId = null; /** - * Creates a new AggregationResultBatch instance using the specified properties. + * RunQueryRequest readOptions. + * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.readOptions = null; + + /** + * RunQueryRequest query. + * @member {google.datastore.v1.IQuery|null|undefined} query + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.query = null; + + /** + * RunQueryRequest gqlQuery. + * @member {google.datastore.v1.IGqlQuery|null|undefined} gqlQuery + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + RunQueryRequest.prototype.gqlQuery = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RunQueryRequest queryType. + * @member {"query"|"gqlQuery"|undefined} queryType + * @memberof google.datastore.v1.RunQueryRequest + * @instance + */ + Object.defineProperty(RunQueryRequest.prototype, "queryType", { + get: $util.oneOfGetter($oneOfFields = ["query", "gqlQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RunQueryRequest instance using the specified properties. * @function create - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.RunQueryRequest * @static - * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch instance + * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest instance */ - AggregationResultBatch.create = function create(properties) { - return new AggregationResultBatch(properties); + RunQueryRequest.create = function create(properties) { + return new RunQueryRequest(properties); }; /** - * Encodes the specified AggregationResultBatch message. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.RunQueryRequest * @static - * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode + * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AggregationResultBatch.encode = function encode(message, writer) { + RunQueryRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.aggregationResults != null && message.aggregationResults.length) - for (var i = 0; i < message.aggregationResults.length; ++i) - $root.google.datastore.v1.AggregationResult.encode(message.aggregationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.moreResults != null && Object.hasOwnProperty.call(message, "moreResults")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.moreResults); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) + $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) + $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gqlQuery != null && Object.hasOwnProperty.call(message, "gqlQuery")) + $root.google.datastore.v1.GqlQuery.encode(message.gqlQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); return writer; }; /** - * Encodes the specified AggregationResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.AggregationResultBatch + * @memberof google.datastore.v1.RunQueryRequest * @static - * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode + * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AggregationResultBatch.encodeDelimited = function encodeDelimited(message, writer) { + RunQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; - /** - * Decodes an AggregationResultBatch message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AggregationResultBatch.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationResultBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.aggregationResults && message.aggregationResults.length)) - message.aggregationResults = []; - message.aggregationResults.push($root.google.datastore.v1.AggregationResult.decode(reader, reader.uint32())); - break; - } - case 2: { - message.moreResults = reader.int32(); - break; - } - case 3: { - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + /** + * Decodes a RunQueryRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.projectId = reader.string(); + break; + } + case 9: { + message.databaseId = reader.string(); + break; + } + case 2: { + message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); + break; + } + case 1: { + message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); + break; + } + case 3: { + message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); + break; + } + case 7: { + message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunQueryRequest message. + * @function verify + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunQueryRequest.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.databaseId != null && message.hasOwnProperty("databaseId")) + if (!$util.isString(message.databaseId)) + return "databaseId: string expected"; + if (message.partitionId != null && message.hasOwnProperty("partitionId")) { + var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); + if (error) + return "partitionId." + error; + } + if (message.readOptions != null && message.hasOwnProperty("readOptions")) { + var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); + if (error) + return "readOptions." + error; + } + if (message.query != null && message.hasOwnProperty("query")) { + properties.queryType = 1; + { + var error = $root.google.datastore.v1.Query.verify(message.query); + if (error) + return "query." + error; + } + } + if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { + if (properties.queryType === 1) + return "queryType: multiple values"; + properties.queryType = 1; + { + var error = $root.google.datastore.v1.GqlQuery.verify(message.gqlQuery); + if (error) + return "gqlQuery." + error; + } + } + return null; + }; + + /** + * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest + */ + RunQueryRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RunQueryRequest) + return object; + var message = new $root.google.datastore.v1.RunQueryRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.partitionId != null) { + if (typeof object.partitionId !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.partitionId: object expected"); + message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); + } + if (object.readOptions != null) { + if (typeof object.readOptions !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.readOptions: object expected"); + message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.query: object expected"); + message.query = $root.google.datastore.v1.Query.fromObject(object.query); + } + if (object.gqlQuery != null) { + if (typeof object.gqlQuery !== "object") + throw TypeError(".google.datastore.v1.RunQueryRequest.gqlQuery: object expected"); + message.gqlQuery = $root.google.datastore.v1.GqlQuery.fromObject(object.gqlQuery); + } + return message; + }; + + /** + * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {google.datastore.v1.RunQueryRequest} message RunQueryRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunQueryRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.readOptions = null; + object.partitionId = null; + object.projectId = ""; + object.databaseId = ""; + } + if (message.readOptions != null && message.hasOwnProperty("readOptions")) + object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); + if (message.partitionId != null && message.hasOwnProperty("partitionId")) + object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); + if (message.query != null && message.hasOwnProperty("query")) { + object.query = $root.google.datastore.v1.Query.toObject(message.query, options); + if (options.oneofs) + object.queryType = "query"; + } + if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { + object.gqlQuery = $root.google.datastore.v1.GqlQuery.toObject(message.gqlQuery, options); + if (options.oneofs) + object.queryType = "gqlQuery"; + } + 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 RunQueryRequest to JSON. + * @function toJSON + * @memberof google.datastore.v1.RunQueryRequest + * @instance + * @returns {Object.} JSON object + */ + RunQueryRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunQueryRequest + * @function getTypeUrl + * @memberof google.datastore.v1.RunQueryRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.datastore.v1.RunQueryRequest"; + }; + + return RunQueryRequest; + })(); + + v1.RunQueryResponse = (function() { + + /** + * Properties of a RunQueryResponse. + * @memberof google.datastore.v1 + * @interface IRunQueryResponse + * @property {google.datastore.v1.IQueryResultBatch|null} [batch] RunQueryResponse batch + * @property {google.datastore.v1.IQuery|null} [query] RunQueryResponse query + */ + + /** + * Constructs a new RunQueryResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a RunQueryResponse. + * @implements IRunQueryResponse + * @constructor + * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set + */ + function RunQueryResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RunQueryResponse batch. + * @member {google.datastore.v1.IQueryResultBatch|null|undefined} batch + * @memberof google.datastore.v1.RunQueryResponse + * @instance + */ + RunQueryResponse.prototype.batch = null; + + /** + * RunQueryResponse query. + * @member {google.datastore.v1.IQuery|null|undefined} query + * @memberof google.datastore.v1.RunQueryResponse + * @instance + */ + RunQueryResponse.prototype.query = null; + + /** + * Creates a new RunQueryResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse instance + */ + RunQueryResponse.create = function create(properties) { + return new RunQueryResponse(properties); + }; + + /** + * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) + $root.google.datastore.v1.QueryResultBatch.encode(message.batch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RunQueryResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.batch = $root.google.datastore.v1.QueryResultBatch.decode(reader, reader.uint32()); + break; + } + case 2: { + message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunQueryResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RunQueryResponse message. + * @function verify + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunQueryResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.batch != null && message.hasOwnProperty("batch")) { + var error = $root.google.datastore.v1.QueryResultBatch.verify(message.batch); + if (error) + return "batch." + error; + } + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.google.datastore.v1.Query.verify(message.query); + if (error) + return "query." + error; + } + return null; + }; + + /** + * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse + */ + RunQueryResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RunQueryResponse) + return object; + var message = new $root.google.datastore.v1.RunQueryResponse(); + if (object.batch != null) { + if (typeof object.batch !== "object") + throw TypeError(".google.datastore.v1.RunQueryResponse.batch: object expected"); + message.batch = $root.google.datastore.v1.QueryResultBatch.fromObject(object.batch); + } + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.datastore.v1.RunQueryResponse.query: object expected"); + message.query = $root.google.datastore.v1.Query.fromObject(object.query); + } + return message; + }; + + /** + * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {google.datastore.v1.RunQueryResponse} message RunQueryResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunQueryResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.batch = null; + object.query = null; + } + if (message.batch != null && message.hasOwnProperty("batch")) + object.batch = $root.google.datastore.v1.QueryResultBatch.toObject(message.batch, options); + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.google.datastore.v1.Query.toObject(message.query, options); + return object; + }; + + /** + * Converts this RunQueryResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.RunQueryResponse + * @instance + * @returns {Object.} JSON object + */ + RunQueryResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RunQueryResponse + * @function getTypeUrl + * @memberof google.datastore.v1.RunQueryResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.datastore.v1.RunQueryResponse"; + }; + + return RunQueryResponse; + })(); + + v1.BeginTransactionRequest = (function() { + + /** + * Properties of a BeginTransactionRequest. + * @memberof google.datastore.v1 + * @interface IBeginTransactionRequest + * @property {string|null} [projectId] BeginTransactionRequest projectId + * @property {string|null} [databaseId] BeginTransactionRequest databaseId + * @property {google.datastore.v1.ITransactionOptions|null} [transactionOptions] BeginTransactionRequest transactionOptions + */ + + /** + * Constructs a new BeginTransactionRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a BeginTransactionRequest. + * @implements IBeginTransactionRequest + * @constructor + * @param {google.datastore.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 projectId. + * @member {string} projectId + * @memberof google.datastore.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.projectId = ""; + + /** + * BeginTransactionRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.databaseId = ""; + + /** + * BeginTransactionRequest transactionOptions. + * @member {google.datastore.v1.ITransactionOptions|null|undefined} transactionOptions + * @memberof google.datastore.v1.BeginTransactionRequest + * @instance + */ + BeginTransactionRequest.prototype.transactionOptions = null; + + /** + * Creates a new BeginTransactionRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {google.datastore.v1.IBeginTransactionRequest=} [properties] Properties to set + * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest instance + */ + BeginTransactionRequest.create = function create(properties) { + return new BeginTransactionRequest(properties); + }; + + /** + * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {google.datastore.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + if (message.transactionOptions != null && Object.hasOwnProperty.call(message, "transactionOptions")) + $root.google.datastore.v1.TransactionOptions.encode(message.transactionOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {google.datastore.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.datastore.v1.BeginTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.projectId = reader.string(); + break; + } + case 9: { + message.databaseId = reader.string(); + break; + } + case 10: { + message.transactionOptions = $root.google.datastore.v1.TransactionOptions.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.datastore.v1.BeginTransactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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.datastore.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.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.transactionOptions != null && message.hasOwnProperty("transactionOptions")) { + var error = $root.google.datastore.v1.TransactionOptions.verify(message.transactionOptions); + if (error) + return "transactionOptions." + error; + } + return null; + }; + + /** + * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest + */ + BeginTransactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.BeginTransactionRequest) + return object; + var message = new $root.google.datastore.v1.BeginTransactionRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.transactionOptions != null) { + if (typeof object.transactionOptions !== "object") + throw TypeError(".google.datastore.v1.BeginTransactionRequest.transactionOptions: object expected"); + message.transactionOptions = $root.google.datastore.v1.TransactionOptions.fromObject(object.transactionOptions); + } + return message; + }; + + /** + * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.BeginTransactionRequest + * @static + * @param {google.datastore.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.projectId = ""; + object.databaseId = ""; + object.transactionOptions = null; + } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.databaseId != null && message.hasOwnProperty("databaseId")) + object.databaseId = message.databaseId; + if (message.transactionOptions != null && message.hasOwnProperty("transactionOptions")) + object.transactionOptions = $root.google.datastore.v1.TransactionOptions.toObject(message.transactionOptions, options); + return object; + }; + + /** + * Converts this BeginTransactionRequest to JSON. + * @function toJSON + * @memberof google.datastore.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.datastore.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.datastore.v1.BeginTransactionRequest"; + }; + + return BeginTransactionRequest; + })(); + + v1.BeginTransactionResponse = (function() { + + /** + * Properties of a BeginTransactionResponse. + * @memberof google.datastore.v1 + * @interface IBeginTransactionResponse + * @property {Uint8Array|null} [transaction] BeginTransactionResponse transaction + */ + + /** + * Constructs a new BeginTransactionResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a BeginTransactionResponse. + * @implements IBeginTransactionResponse + * @constructor + * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set + */ + function BeginTransactionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BeginTransactionResponse transaction. + * @member {Uint8Array} transaction + * @memberof google.datastore.v1.BeginTransactionResponse + * @instance + */ + BeginTransactionResponse.prototype.transaction = $util.newBuffer([]); + + /** + * Creates a new BeginTransactionResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse instance + */ + BeginTransactionResponse.create = function create(properties) { + return new BeginTransactionResponse(properties); + }; + + /** + * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + return writer; + }; + + /** + * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BeginTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.transaction = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BeginTransactionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BeginTransactionResponse message. + * @function verify + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BeginTransactionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + return null; + }; + + /** + * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse + */ + BeginTransactionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.BeginTransactionResponse) + return object; + var message = new $root.google.datastore.v1.BeginTransactionResponse(); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length >= 0) + message.transaction = object.transaction; + return message; + }; + + /** + * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {google.datastore.v1.BeginTransactionResponse} message BeginTransactionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BeginTransactionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.transaction = ""; + else { + object.transaction = []; + if (options.bytes !== Array) + object.transaction = $util.newBuffer(object.transaction); + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + return object; + }; + + /** + * Converts this BeginTransactionResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.BeginTransactionResponse + * @instance + * @returns {Object.} JSON object + */ + BeginTransactionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BeginTransactionResponse + * @function getTypeUrl + * @memberof google.datastore.v1.BeginTransactionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BeginTransactionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.datastore.v1.BeginTransactionResponse"; + }; + + return BeginTransactionResponse; + })(); + + v1.RollbackRequest = (function() { + + /** + * Properties of a RollbackRequest. + * @memberof google.datastore.v1 + * @interface IRollbackRequest + * @property {string|null} [projectId] RollbackRequest projectId + * @property {string|null} [databaseId] RollbackRequest databaseId + * @property {Uint8Array|null} [transaction] RollbackRequest transaction + */ + + /** + * Constructs a new RollbackRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a RollbackRequest. + * @implements IRollbackRequest + * @constructor + * @param {google.datastore.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 projectId. + * @member {string} projectId + * @memberof google.datastore.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.projectId = ""; + + /** + * RollbackRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.databaseId = ""; + + /** + * RollbackRequest transaction. + * @member {Uint8Array} transaction + * @memberof google.datastore.v1.RollbackRequest + * @instance + */ + RollbackRequest.prototype.transaction = $util.newBuffer([]); + + /** + * Creates a new RollbackRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.v1.IRollbackRequest=} [properties] Properties to set + * @returns {google.datastore.v1.RollbackRequest} RollbackRequest instance + */ + RollbackRequest.create = function create(properties) { + return new RollbackRequest(properties); + }; + + /** + * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + return writer; + }; + + /** + * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.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.datastore.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.projectId = reader.string(); + break; + } + case 9: { + message.databaseId = reader.string(); + break; + } + case 1: { + message.transaction = 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.datastore.v1.RollbackRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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.datastore.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.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.transaction != null && message.hasOwnProperty("transaction")) + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + return null; + }; + + /** + * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RollbackRequest} RollbackRequest + */ + RollbackRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RollbackRequest) + return object; + var message = new $root.google.datastore.v1.RollbackRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length >= 0) + message.transaction = object.transaction; + return message; + }; + + /** + * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RollbackRequest + * @static + * @param {google.datastore.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) { + if (options.bytes === String) + object.transaction = ""; + else { + object.transaction = []; + if (options.bytes !== Array) + object.transaction = $util.newBuffer(object.transaction); + } + object.projectId = ""; + object.databaseId = ""; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + 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 RollbackRequest to JSON. + * @function toJSON + * @memberof google.datastore.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.datastore.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.datastore.v1.RollbackRequest"; + }; + + return RollbackRequest; + })(); + + v1.RollbackResponse = (function() { + + /** + * Properties of a RollbackResponse. + * @memberof google.datastore.v1 + * @interface IRollbackResponse + */ + + /** + * Constructs a new RollbackResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a RollbackResponse. + * @implements IRollbackResponse + * @constructor + * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set + */ + function RollbackResponse(properties) { + if (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 RollbackResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse instance + */ + RollbackResponse.create = function create(properties) { + return new RollbackResponse(properties); + }; + + /** + * Encodes the specified RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RollbackResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RollbackResponse message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RollbackResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RollbackResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RollbackResponse message. + * @function verify + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RollbackResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RollbackResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.RollbackResponse} RollbackResponse + */ + RollbackResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.RollbackResponse) + return object; + return new $root.google.datastore.v1.RollbackResponse(); + }; + + /** + * Creates a plain object from a RollbackResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {google.datastore.v1.RollbackResponse} message RollbackResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RollbackResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RollbackResponse to JSON. + * @function toJSON + * @memberof google.datastore.v1.RollbackResponse + * @instance + * @returns {Object.} JSON object + */ + RollbackResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RollbackResponse + * @function getTypeUrl + * @memberof google.datastore.v1.RollbackResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RollbackResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.datastore.v1.RollbackResponse"; + }; + + return RollbackResponse; + })(); + + v1.CommitRequest = (function() { + + /** + * Properties of a CommitRequest. + * @memberof google.datastore.v1 + * @interface ICommitRequest + * @property {string|null} [projectId] CommitRequest projectId + * @property {string|null} [databaseId] CommitRequest databaseId + * @property {google.datastore.v1.CommitRequest.Mode|null} [mode] CommitRequest mode + * @property {Uint8Array|null} [transaction] CommitRequest transaction + * @property {Array.|null} [mutations] CommitRequest mutations + */ + + /** + * Constructs a new CommitRequest. + * @memberof google.datastore.v1 + * @classdesc Represents a CommitRequest. + * @implements ICommitRequest + * @constructor + * @param {google.datastore.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 projectId. + * @member {string} projectId + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.projectId = ""; + + /** + * CommitRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.databaseId = ""; + + /** + * CommitRequest mode. + * @member {google.datastore.v1.CommitRequest.Mode} mode + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.mode = 0; + + /** + * CommitRequest transaction. + * @member {Uint8Array|null|undefined} transaction + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.transaction = null; + + /** + * CommitRequest mutations. + * @member {Array.} mutations + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + CommitRequest.prototype.mutations = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CommitRequest transactionSelector. + * @member {"transaction"|undefined} transactionSelector + * @memberof google.datastore.v1.CommitRequest + * @instance + */ + Object.defineProperty(CommitRequest.prototype, "transactionSelector", { + get: $util.oneOfGetter($oneOfFields = ["transaction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CommitRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {google.datastore.v1.ICommitRequest=} [properties] Properties to set + * @returns {google.datastore.v1.CommitRequest} CommitRequest instance + */ + CommitRequest.create = function create(properties) { + return new CommitRequest(properties); + }; + + /** + * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.mode); + if (message.mutations != null && message.mutations.length) + for (var i = 0; i < message.mutations.length; ++i) + $root.google.datastore.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + return writer; + }; + + /** + * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {google.datastore.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.datastore.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.projectId = reader.string(); + break; + } + case 9: { + message.databaseId = reader.string(); + break; + } + case 5: { + message.mode = reader.int32(); + break; + } + case 1: { + message.transaction = reader.bytes(); + break; + } + case 6: { + if (!(message.mutations && message.mutations.length)) + message.mutations = []; + message.mutations.push($root.google.datastore.v1.Mutation.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.datastore.v1.CommitRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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.datastore.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.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.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + properties.transactionSelector = 1; + if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) + return "transaction: buffer expected"; + } + if (message.mutations != null && message.hasOwnProperty("mutations")) { + if (!Array.isArray(message.mutations)) + return "mutations: array expected"; + for (var i = 0; i < message.mutations.length; ++i) { + var error = $root.google.datastore.v1.Mutation.verify(message.mutations[i]); + if (error) + return "mutations." + error; + } + } + return null; + }; + + /** + * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.CommitRequest} CommitRequest + */ + CommitRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.CommitRequest) + return object; + var message = new $root.google.datastore.v1.CommitRequest(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.databaseId != null) + message.databaseId = String(object.databaseId); + 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 "TRANSACTIONAL": + case 1: + message.mode = 1; + break; + case "NON_TRANSACTIONAL": + case 2: + message.mode = 2; + break; + } + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length >= 0) + message.transaction = object.transaction; + if (object.mutations) { + if (!Array.isArray(object.mutations)) + throw TypeError(".google.datastore.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.datastore.v1.CommitRequest.mutations: object expected"); + message.mutations[i] = $root.google.datastore.v1.Mutation.fromObject(object.mutations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.CommitRequest + * @static + * @param {google.datastore.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.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; + object.projectId = ""; + object.databaseId = ""; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (options.oneofs) + object.transactionSelector = "transaction"; + } + if (message.mode != null && message.hasOwnProperty("mode")) + object.mode = options.enums === String ? $root.google.datastore.v1.CommitRequest.Mode[message.mode] === undefined ? message.mode : $root.google.datastore.v1.CommitRequest.Mode[message.mode] : message.mode; + if (message.mutations && message.mutations.length) { + object.mutations = []; + for (var j = 0; j < message.mutations.length; ++j) + object.mutations[j] = $root.google.datastore.v1.Mutation.toObject(message.mutations[j], options); + } + 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 CommitRequest to JSON. + * @function toJSON + * @memberof google.datastore.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.datastore.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.datastore.v1.CommitRequest"; + }; + + /** + * Mode enum. + * @name google.datastore.v1.CommitRequest.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} TRANSACTIONAL=1 TRANSACTIONAL value + * @property {number} NON_TRANSACTIONAL=2 NON_TRANSACTIONAL value + */ + CommitRequest.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRANSACTIONAL"] = 1; + values[valuesById[2] = "NON_TRANSACTIONAL"] = 2; + return values; + })(); + + return CommitRequest; + })(); + + v1.CommitResponse = (function() { + + /** + * Properties of a CommitResponse. + * @memberof google.datastore.v1 + * @interface ICommitResponse + * @property {Array.|null} [mutationResults] CommitResponse mutationResults + * @property {number|null} [indexUpdates] CommitResponse indexUpdates + * @property {google.protobuf.ITimestamp|null} [commitTime] CommitResponse commitTime + */ + + /** + * Constructs a new CommitResponse. + * @memberof google.datastore.v1 + * @classdesc Represents a CommitResponse. + * @implements ICommitResponse + * @constructor + * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set + */ + function CommitResponse(properties) { + this.mutationResults = []; + if (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 mutationResults. + * @member {Array.} mutationResults + * @memberof google.datastore.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.mutationResults = $util.emptyArray; + + /** + * CommitResponse indexUpdates. + * @member {number} indexUpdates + * @memberof google.datastore.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.indexUpdates = 0; + + /** + * CommitResponse commitTime. + * @member {google.protobuf.ITimestamp|null|undefined} commitTime + * @memberof google.datastore.v1.CommitResponse + * @instance + */ + CommitResponse.prototype.commitTime = null; + + /** + * Creates a new CommitResponse instance using the specified properties. + * @function create + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set + * @returns {google.datastore.v1.CommitResponse} CommitResponse instance + */ + CommitResponse.create = function create(properties) { + return new CommitResponse(properties); + }; + + /** + * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {google.datastore.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.mutationResults != null && message.mutationResults.length) + for (var i = 0; i < message.mutationResults.length; ++i) + $root.google.datastore.v1.MutationResult.encode(message.mutationResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.indexUpdates != null && Object.hasOwnProperty.call(message, "indexUpdates")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.indexUpdates); + if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) + $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {google.datastore.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.datastore.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (!(message.mutationResults && message.mutationResults.length)) + message.mutationResults = []; + message.mutationResults.push($root.google.datastore.v1.MutationResult.decode(reader, reader.uint32())); + break; + } + case 4: { + message.indexUpdates = reader.int32(); + break; + } + case 8: { + message.commitTime = $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.datastore.v1.CommitResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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.datastore.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"; + if (message.mutationResults != null && message.hasOwnProperty("mutationResults")) { + if (!Array.isArray(message.mutationResults)) + return "mutationResults: array expected"; + for (var i = 0; i < message.mutationResults.length; ++i) { + var error = $root.google.datastore.v1.MutationResult.verify(message.mutationResults[i]); + if (error) + return "mutationResults." + error; + } + } + if (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) + if (!$util.isInteger(message.indexUpdates)) + return "indexUpdates: integer expected"; + if (message.commitTime != null && message.hasOwnProperty("commitTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.commitTime); + if (error) + return "commitTime." + error; + } + return null; + }; + + /** + * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.CommitResponse} CommitResponse + */ + CommitResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.CommitResponse) + return object; + var message = new $root.google.datastore.v1.CommitResponse(); + if (object.mutationResults) { + if (!Array.isArray(object.mutationResults)) + throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: array expected"); + message.mutationResults = []; + for (var i = 0; i < object.mutationResults.length; ++i) { + if (typeof object.mutationResults[i] !== "object") + throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: object expected"); + message.mutationResults[i] = $root.google.datastore.v1.MutationResult.fromObject(object.mutationResults[i]); + } + } + if (object.indexUpdates != null) + message.indexUpdates = object.indexUpdates | 0; + if (object.commitTime != null) { + if (typeof object.commitTime !== "object") + throw TypeError(".google.datastore.v1.CommitResponse.commitTime: object expected"); + message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); + } + return message; + }; + + /** + * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.CommitResponse + * @static + * @param {google.datastore.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.arrays || options.defaults) + object.mutationResults = []; + if (options.defaults) { + object.indexUpdates = 0; + object.commitTime = null; + } + if (message.mutationResults && message.mutationResults.length) { + object.mutationResults = []; + for (var j = 0; j < message.mutationResults.length; ++j) + object.mutationResults[j] = $root.google.datastore.v1.MutationResult.toObject(message.mutationResults[j], options); + } + if (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) + object.indexUpdates = message.indexUpdates; + if (message.commitTime != null && message.hasOwnProperty("commitTime")) + object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); + return object; + }; + + /** + * Converts this CommitResponse to JSON. + * @function toJSON + * @memberof google.datastore.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.datastore.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.datastore.v1.CommitResponse"; + }; + + return CommitResponse; + })(); + + v1.AllocateIdsRequest = (function() { + + /** + * Properties of an AllocateIdsRequest. + * @memberof google.datastore.v1 + * @interface IAllocateIdsRequest + * @property {string|null} [projectId] AllocateIdsRequest projectId + * @property {string|null} [databaseId] AllocateIdsRequest databaseId + * @property {Array.|null} [keys] AllocateIdsRequest keys + */ + + /** + * Constructs a new AllocateIdsRequest. + * @memberof google.datastore.v1 + * @classdesc Represents an AllocateIdsRequest. + * @implements IAllocateIdsRequest + * @constructor + * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set + */ + function AllocateIdsRequest(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]]; + } + + /** + * AllocateIdsRequest projectId. + * @member {string} projectId + * @memberof google.datastore.v1.AllocateIdsRequest + * @instance + */ + AllocateIdsRequest.prototype.projectId = ""; + + /** + * AllocateIdsRequest databaseId. + * @member {string} databaseId + * @memberof google.datastore.v1.AllocateIdsRequest + * @instance + */ + AllocateIdsRequest.prototype.databaseId = ""; + + /** + * AllocateIdsRequest keys. + * @member {Array.} keys + * @memberof google.datastore.v1.AllocateIdsRequest + * @instance + */ + AllocateIdsRequest.prototype.keys = $util.emptyArray; + + /** + * Creates a new AllocateIdsRequest instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AllocateIdsRequest + * @static + * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest instance + */ + AllocateIdsRequest.create = function create(properties) { + return new AllocateIdsRequest(properties); + }; + + /** + * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AllocateIdsRequest + * @static + * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocateIdsRequest.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); + if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + return writer; + }; + + /** + * Encodes the specified AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AllocateIdsRequest + * @static + * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocateIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocateIdsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AllocateIdsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocateIdsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.projectId = reader.string(); + break; + } + case 9: { + message.databaseId = reader.string(); + break; + } + case 1: { + if (!(message.keys && message.keys.length)) + message.keys = []; + message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AggregationResult} AggregationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregationResult message. + * @function verify + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aggregateProperties != null && message.hasOwnProperty("aggregateProperties")) { + if (!$util.isObject(message.aggregateProperties)) + return "aggregateProperties: object expected"; + var key = Object.keys(message.aggregateProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.datastore.v1.Value.verify(message.aggregateProperties[key[i]]); + if (error) + return "aggregateProperties." + error; + } + } + return null; + }; + + /** + * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationResult} AggregationResult + */ + AggregationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationResult) + return object; + var message = new $root.google.datastore.v1.AggregationResult(); + if (object.aggregateProperties) { + if (typeof object.aggregateProperties !== "object") + throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); + message.aggregateProperties = {}; + for (var keys = Object.keys(object.aggregateProperties), i = 0; i < keys.length; ++i) { + if (typeof object.aggregateProperties[keys[i]] !== "object") + throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); + message.aggregateProperties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.aggregateProperties[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {google.datastore.v1.AggregationResult} message AggregationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AggregationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.aggregateProperties = {}; + var keys2; + if (message.aggregateProperties && (keys2 = Object.keys(message.aggregateProperties)).length) { + object.aggregateProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.aggregateProperties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.aggregateProperties[keys2[j]], options); + } + return object; + }; + + /** + * Converts this AggregationResult to JSON. + * @function toJSON + * @memberof google.datastore.v1.AggregationResult + * @instance + * @returns {Object.} JSON object + */ + AggregationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AggregationResult + * @function getTypeUrl + * @memberof google.datastore.v1.AggregationResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AggregationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.datastore.v1.AggregationResult"; + }; + + return AggregationResult; + })(); + + v1.AggregationResultBatch = (function() { + + /** + * Properties of an AggregationResultBatch. + * @memberof google.datastore.v1 + * @interface IAggregationResultBatch + * @property {Array.|null} [aggregationResults] AggregationResultBatch aggregationResults + * @property {google.datastore.v1.QueryResultBatch.MoreResultsType|null} [moreResults] AggregationResultBatch moreResults + * @property {google.protobuf.ITimestamp|null} [readTime] AggregationResultBatch readTime + */ + + /** + * Constructs a new AggregationResultBatch. + * @memberof google.datastore.v1 + * @classdesc Represents an AggregationResultBatch. + * @implements IAggregationResultBatch + * @constructor + * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set + */ + function AggregationResultBatch(properties) { + this.aggregationResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AggregationResultBatch aggregationResults. + * @member {Array.} aggregationResults + * @memberof google.datastore.v1.AggregationResultBatch + * @instance + */ + AggregationResultBatch.prototype.aggregationResults = $util.emptyArray; + + /** + * AggregationResultBatch moreResults. + * @member {google.datastore.v1.QueryResultBatch.MoreResultsType} moreResults + * @memberof google.datastore.v1.AggregationResultBatch + * @instance + */ + AggregationResultBatch.prototype.moreResults = 0; + + /** + * AggregationResultBatch readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.AggregationResultBatch + * @instance + */ + AggregationResultBatch.prototype.readTime = null; + + /** + * Creates a new AggregationResultBatch instance using the specified properties. + * @function create + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch instance + */ + AggregationResultBatch.create = function create(properties) { + return new AggregationResultBatch(properties); + }; + + /** + * Encodes the specified AggregationResultBatch message. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationResultBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aggregationResults != null && message.aggregationResults.length) + for (var i = 0; i < message.aggregationResults.length; ++i) + $root.google.datastore.v1.AggregationResult.encode(message.aggregationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.moreResults != null && Object.hasOwnProperty.call(message, "moreResults")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.moreResults); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AggregationResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AggregationResultBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AggregationResultBatch message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResultBatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationResultBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.aggregationResults && message.aggregationResults.length)) + message.aggregationResults = []; + message.aggregationResults.push($root.google.datastore.v1.AggregationResult.decode(reader, reader.uint32())); + break; + } + case 2: { + message.moreResults = reader.int32(); + break; + } + case 3: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AggregationResultBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResultBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AggregationResultBatch message. + * @function verify + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregationResultBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aggregationResults != null && message.hasOwnProperty("aggregationResults")) { + if (!Array.isArray(message.aggregationResults)) + return "aggregationResults: array expected"; + for (var i = 0; i < message.aggregationResults.length; ++i) { + var error = $root.google.datastore.v1.AggregationResult.verify(message.aggregationResults[i]); + if (error) + return "aggregationResults." + error; + } + } + if (message.moreResults != null && message.hasOwnProperty("moreResults")) + switch (message.moreResults) { + default: + return "moreResults: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 3: + break; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; + }; + + /** + * Creates an AggregationResultBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + */ + AggregationResultBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationResultBatch) + return object; + var message = new $root.google.datastore.v1.ReadOptions(); + switch (object.readConsistency) { + default: + if (typeof object.readConsistency === "number") { + message.readConsistency = object.readConsistency; + break; + } + break; + case "READ_CONSISTENCY_UNSPECIFIED": + case 0: + message.moreResults = 0; + break; + case "NOT_FINISHED": + case 1: + message.moreResults = 1; + break; + case "MORE_RESULTS_AFTER_LIMIT": + case 2: + message.moreResults = 2; + break; + } + if (object.transaction != null) + if (typeof object.transaction === "string") + $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); + else if (object.transaction.length >= 0) + message.transaction = object.transaction; + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.ReadOptions.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + return message; + }; + + /** + * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {google.datastore.v1.ReadOptions} message ReadOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { + object.readConsistency = options.enums === String ? $root.google.datastore.v1.ReadOptions.ReadConsistency[message.readConsistency] === undefined ? message.readConsistency : $root.google.datastore.v1.ReadOptions.ReadConsistency[message.readConsistency] : message.readConsistency; + if (options.oneofs) + object.consistencyType = "readConsistency"; + } + if (message.transaction != null && message.hasOwnProperty("transaction")) { + object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; + if (options.oneofs) + object.consistencyType = "transaction"; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); + if (options.oneofs) + object.consistencyType = "readTime"; + } + return object; + }; + + /** + * Converts this ReadOptions to JSON. + * @function toJSON + * @memberof google.datastore.v1.ReadOptions + * @instance + * @returns {Object.} JSON object + */ + ReadOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReadOptions + * @function getTypeUrl + * @memberof google.datastore.v1.ReadOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.datastore.v1.ReadOptions"; + }; + + /** + * ReadConsistency enum. + * @name google.datastore.v1.ReadOptions.ReadConsistency + * @enum {number} + * @property {number} READ_CONSISTENCY_UNSPECIFIED=0 READ_CONSISTENCY_UNSPECIFIED value + * @property {number} STRONG=1 STRONG value + * @property {number} EVENTUAL=2 EVENTUAL value + */ + ReadOptions.ReadConsistency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "READ_CONSISTENCY_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRONG"] = 1; + values[valuesById[2] = "EVENTUAL"] = 2; + return values; + })(); + + return ReadOptions; + })(); + + v1.TransactionOptions = (function() { + + /** + * Properties of a TransactionOptions. + * @memberof google.datastore.v1 + * @interface ITransactionOptions + * @property {google.datastore.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite + * @property {google.datastore.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly + */ + + /** + * Constructs a new TransactionOptions. + * @memberof google.datastore.v1 + * @classdesc Represents a TransactionOptions. + * @implements ITransactionOptions + * @constructor + * @param {google.datastore.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.datastore.v1.TransactionOptions.IReadWrite|null|undefined} readWrite + * @memberof google.datastore.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.readWrite = null; + + /** + * TransactionOptions readOnly. + * @member {google.datastore.v1.TransactionOptions.IReadOnly|null|undefined} readOnly + * @memberof google.datastore.v1.TransactionOptions + * @instance + */ + TransactionOptions.prototype.readOnly = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TransactionOptions mode. + * @member {"readWrite"|"readOnly"|undefined} mode + * @memberof google.datastore.v1.TransactionOptions + * @instance + */ + Object.defineProperty(TransactionOptions.prototype, "mode", { + get: $util.oneOfGetter($oneOfFields = ["readWrite", "readOnly"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TransactionOptions instance using the specified properties. + * @function create + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {google.datastore.v1.ITransactionOptions=} [properties] Properties to set + * @returns {google.datastore.v1.TransactionOptions} TransactionOptions instance + */ + TransactionOptions.create = function create(properties) { + return new TransactionOptions(properties); + }; + + /** + * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {google.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {google.datastore.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.datastore.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); + break; + } + case 2: { + message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); + 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.datastore.v1.TransactionOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadWrite.verify(message.readWrite); + if (error) + return "readWrite." + error; + } + } + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + if (properties.mode === 1) + return "mode: multiple values"; + properties.mode = 1; + { + var error = $root.google.datastore.v1.TransactionOptions.ReadOnly.verify(message.readOnly); + if (error) + return "readOnly." + error; + } + } + return null; + }; + + /** + * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.TransactionOptions} TransactionOptions + */ + TransactionOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.TransactionOptions) + return object; + var message = new $root.google.datastore.v1.TransactionOptions(); + if (object.readWrite != null) { + if (typeof object.readWrite !== "object") + throw TypeError(".google.datastore.v1.TransactionOptions.readWrite: object expected"); + message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); + } + if (object.readOnly != null) { + if (typeof object.readOnly !== "object") + throw TypeError(".google.datastore.v1.TransactionOptions.readOnly: object expected"); + message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); + } + return message; + }; + + /** + * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.TransactionOptions + * @static + * @param {google.datastore.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 (message.readWrite != null && message.hasOwnProperty("readWrite")) { + object.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); + if (options.oneofs) + object.mode = "readWrite"; + } + if (message.readOnly != null && message.hasOwnProperty("readOnly")) { + object.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); + if (options.oneofs) + object.mode = "readOnly"; + } + return object; + }; + + /** + * Converts this TransactionOptions to JSON. + * @function toJSON + * @memberof google.datastore.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.datastore.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.datastore.v1.TransactionOptions"; + }; + + TransactionOptions.ReadWrite = (function() { + + /** + * Properties of a ReadWrite. + * @memberof google.datastore.v1.TransactionOptions + * @interface IReadWrite + * @property {Uint8Array|null} [previousTransaction] ReadWrite previousTransaction + */ + + /** + * Constructs a new ReadWrite. + * @memberof google.datastore.v1.TransactionOptions + * @classdesc Represents a ReadWrite. + * @implements IReadWrite + * @constructor + * @param {google.datastore.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 previousTransaction. + * @member {Uint8Array} previousTransaction + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @instance + */ + ReadWrite.prototype.previousTransaction = $util.newBuffer([]); + + /** + * Creates a new ReadWrite instance using the specified properties. + * @function create + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set + * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite instance + */ + ReadWrite.create = function create(properties) { + return new ReadWrite(properties); + }; + + /** + * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.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.previousTransaction != null && Object.hasOwnProperty.call(message, "previousTransaction")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.previousTransaction); + return writer; + }; + + /** + * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.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.datastore.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.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.previousTransaction = 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.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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.datastore.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.previousTransaction != null && message.hasOwnProperty("previousTransaction")) + if (!(message.previousTransaction && typeof message.previousTransaction.length === "number" || $util.isString(message.previousTransaction))) + return "previousTransaction: buffer expected"; + return null; + }; + + /** + * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite + */ + ReadWrite.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadWrite) + return object; + var message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); + if (object.previousTransaction != null) + if (typeof object.previousTransaction === "string") + $util.base64.decode(object.previousTransaction, message.previousTransaction = $util.newBuffer($util.base64.length(object.previousTransaction)), 0); + else if (object.previousTransaction.length >= 0) + message.previousTransaction = object.previousTransaction; + return message; + }; + + /** + * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. + * @function toObject + * @memberof google.datastore.v1.TransactionOptions.ReadWrite + * @static + * @param {google.datastore.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) + if (options.bytes === String) + object.previousTransaction = ""; + else { + object.previousTransaction = []; + if (options.bytes !== Array) + object.previousTransaction = $util.newBuffer(object.previousTransaction); + } + if (message.previousTransaction != null && message.hasOwnProperty("previousTransaction")) + object.previousTransaction = options.bytes === String ? $util.base64.encode(message.previousTransaction, 0, message.previousTransaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.previousTransaction) : message.previousTransaction; + return object; + }; + + /** + * Converts this ReadWrite to JSON. + * @function toJSON + * @memberof google.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadWrite"; + }; + + return ReadWrite; + })(); + + TransactionOptions.ReadOnly = (function() { + + /** + * Properties of a ReadOnly. + * @memberof google.datastore.v1.TransactionOptions + * @interface IReadOnly + * @property {google.protobuf.ITimestamp|null} [readTime] ReadOnly readTime + */ + + /** + * Constructs a new ReadOnly. + * @memberof google.datastore.v1.TransactionOptions + * @classdesc Represents a ReadOnly. + * @implements IReadOnly + * @constructor + * @param {google.datastore.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 readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @instance + */ + ReadOnly.prototype.readTime = null; + + /** + * Creates a new ReadOnly instance using the specified properties. + * @function create + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.datastore.v1.TransactionOptions.IReadOnly=} [properties] Properties to set + * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly instance + */ + ReadOnly.create = function create(properties) { + return new ReadOnly(properties); + }; + + /** + * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encode + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.datastore.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.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {google.datastore.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.datastore.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.datastore.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) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes an AggregationResultBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AggregationResultBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ReadOnly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.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 an AggregationResultBatch message. - * @function verify - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AggregationResultBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.aggregationResults != null && message.hasOwnProperty("aggregationResults")) { - if (!Array.isArray(message.aggregationResults)) - return "aggregationResults: array expected"; - for (var i = 0; i < message.aggregationResults.length; ++i) { - var error = $root.google.datastore.v1.AggregationResult.verify(message.aggregationResults[i]); + /** + * Verifies a ReadOnly message. + * @function verify + * @memberof google.datastore.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"; + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); if (error) - return "aggregationResults." + error; - } - } - if (message.moreResults != null && message.hasOwnProperty("moreResults")) - switch (message.moreResults) { - default: - return "moreResults: enum value expected"; - case 0: - case 1: - case 2: - case 4: - case 3: - break; + return "readTime." + error; } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - return null; - }; + return null; + }; - /** - * Creates an AggregationResultBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch - */ - AggregationResultBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AggregationResultBatch) - return object; - var message = new $root.google.datastore.v1.AggregationResultBatch(); - if (object.aggregationResults) { - if (!Array.isArray(object.aggregationResults)) - throw TypeError(".google.datastore.v1.AggregationResultBatch.aggregationResults: array expected"); - message.aggregationResults = []; - for (var i = 0; i < object.aggregationResults.length; ++i) { - if (typeof object.aggregationResults[i] !== "object") - throw TypeError(".google.datastore.v1.AggregationResultBatch.aggregationResults: object expected"); - message.aggregationResults[i] = $root.google.datastore.v1.AggregationResult.fromObject(object.aggregationResults[i]); + /** + * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.TransactionOptions.ReadOnly + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly + */ + ReadOnly.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadOnly) + return object; + var message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.TransactionOptions.ReadOnly.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); } - } - switch (object.moreResults) { - case "MORE_RESULTS_TYPE_UNSPECIFIED": - case 0: - message.moreResults = 0; - break; - case "NOT_FINISHED": - case 1: - message.moreResults = 1; - break; - case "MORE_RESULTS_AFTER_LIMIT": - case 2: - message.moreResults = 2; - break; - case "MORE_RESULTS_AFTER_CURSOR": - case 4: - message.moreResults = 4; - break; - case "NO_MORE_RESULTS": - case 3: - message.moreResults = 3; - break; - } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.AggregationResultBatch.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - return message; - }; + return message; + }; /** * Creates a plain object from an AggregationResultBatch message. Also converts values to other types if specified. @@ -8266,6 +11504,12 @@ return object; var message = new $root.google.datastore.v1.Value(); switch (object.nullValue) { + default: + if (typeof object.nullValue === "number") { + message.nullValue = object.nullValue; + break; + } + break; case "NULL_VALUE": case 0: message.nullValue = 0; @@ -8384,7 +11628,7 @@ object.valueType = "timestampValue"; } if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.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.valueType = "nullValue"; } @@ -11060,6 +14304,12 @@ message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); } switch (object.direction) { + default: + if (typeof object.direction === "number") { + message.direction = object.direction; + break; + } + break; case "DIRECTION_UNSPECIFIED": case 0: message.direction = 0; @@ -11096,7 +14346,7 @@ if (message.property != null && message.hasOwnProperty("property")) object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.datastore.v1.PropertyOrder.Direction[message.direction] : message.direction; + object.direction = options.enums === String ? $root.google.datastore.v1.PropertyOrder.Direction[message.direction] === undefined ? message.direction : $root.google.datastore.v1.PropertyOrder.Direction[message.direction] : message.direction; return object; }; @@ -11590,6 +14840,12 @@ return object; var message = new $root.google.datastore.v1.CompositeFilter(); switch (object.op) { + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; case "OPERATOR_UNSPECIFIED": case 0: message.op = 0; @@ -11630,7 +14886,7 @@ if (options.defaults) object.op = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; if (message.op != null && message.hasOwnProperty("op")) - object.op = options.enums === String ? $root.google.datastore.v1.CompositeFilter.Operator[message.op] : message.op; + object.op = options.enums === String ? $root.google.datastore.v1.CompositeFilter.Operator[message.op] === undefined ? message.op : $root.google.datastore.v1.CompositeFilter.Operator[message.op] : message.op; if (message.filters && message.filters.length) { object.filters = []; for (var j = 0; j < message.filters.length; ++j) @@ -11890,6 +15146,12 @@ message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); } switch (object.op) { + default: + if (typeof object.op === "number") { + message.op = object.op; + break; + } + break; case "OPERATOR_UNSPECIFIED": case 0: message.op = 0; @@ -11960,7 +15222,7 @@ if (message.property != null && message.hasOwnProperty("property")) object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); if (message.op != null && message.hasOwnProperty("op")) - object.op = options.enums === String ? $root.google.datastore.v1.PropertyFilter.Operator[message.op] : message.op; + object.op = options.enums === String ? $root.google.datastore.v1.PropertyFilter.Operator[message.op] === undefined ? message.op : $root.google.datastore.v1.PropertyFilter.Operator[message.op] : message.op; if (message.value != null && message.hasOwnProperty("value")) object.value = $root.google.datastore.v1.Value.toObject(message.value, options); return object; @@ -12932,6 +16194,12 @@ else if (object.skippedCursor.length >= 0) message.skippedCursor = object.skippedCursor; switch (object.entityResultType) { + default: + if (typeof object.entityResultType === "number") { + message.entityResultType = object.entityResultType; + break; + } + break; case "RESULT_TYPE_UNSPECIFIED": case 0: message.entityResultType = 0; @@ -12965,6 +16233,12 @@ else if (object.endCursor.length >= 0) message.endCursor = object.endCursor; switch (object.moreResults) { + default: + if (typeof object.moreResults === "number") { + message.moreResults = object.moreResults; + break; + } + break; case "MORE_RESULTS_TYPE_UNSPECIFIED": case 0: message.moreResults = 0; @@ -13044,7 +16318,7 @@ object.readTime = null; } if (message.entityResultType != null && message.hasOwnProperty("entityResultType")) - object.entityResultType = options.enums === String ? $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] : message.entityResultType; + object.entityResultType = options.enums === String ? $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] === undefined ? message.entityResultType : $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] : message.entityResultType; if (message.entityResults && message.entityResults.length) { object.entityResults = []; for (var j = 0; j < message.entityResults.length; ++j) @@ -13055,7 +16329,7 @@ if (message.endCursor != null && message.hasOwnProperty("endCursor")) object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; if (message.moreResults != null && message.hasOwnProperty("moreResults")) - object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; + object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] === undefined ? message.moreResults : $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; if (message.skippedResults != null && message.hasOwnProperty("skippedResults")) object.skippedResults = message.skippedResults; if (message.snapshotVersion != null && message.hasOwnProperty("snapshotVersion")) @@ -22999,6 +26273,12 @@ if (object.number != null) message.number = object.number | 0; switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; case "LABEL_OPTIONAL": case 1: message.label = 1; @@ -23013,6 +26293,12 @@ break; } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -23139,9 +26425,9 @@ if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) @@ -25460,6 +28746,12 @@ if (object.javaStringCheckUtf8 != null) message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; case "SPEED": case 1: message.optimizeFor = 1; @@ -25556,7 +28848,7 @@ if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) @@ -26305,6 +29597,12 @@ return object; var message = new $root.google.protobuf.FieldOptions(); switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; case "STRING": case 0: message.ctype = 0; @@ -26321,6 +29619,12 @@ if (object.packed != null) message.packed = Boolean(object.packed); switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; case "JS_NORMAL": case 0: message.jstype = 0; @@ -26359,6 +29663,10 @@ for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) switch (object[".google.api.fieldBehavior"][i]) { default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } case "FIELD_BEHAVIOR_UNSPECIFIED": case 0: message[".google.api.fieldBehavior"][i] = 0; @@ -26423,7 +29731,7 @@ object.unverifiedLazy = false; } if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -26431,7 +29739,7 @@ if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) @@ -26444,7 +29752,7 @@ if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { object[".google.api.fieldBehavior"] = []; for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } return object; }; @@ -27819,6 +31127,12 @@ if (object.deprecated != null) message.deprecated = Boolean(object.deprecated); switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; case "IDEMPOTENCY_UNKNOWN": case 0: message.idempotencyLevel = 0; @@ -27888,7 +31202,7 @@ if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -29643,6 +32957,12 @@ if (object.end != null) message.end = object.end | 0; switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; case "NONE": case 0: message.semantic = 0; @@ -29692,7 +33012,7 @@ if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; @@ -31169,6 +34489,12 @@ 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; @@ -31207,7 +34533,7 @@ options = {}; var object = {}; if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.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"; } diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 3c5ab4e4d..cd3a261c5 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -807,14 +807,6 @@ describe('Datastore', () => { const [results] = await datastore.runAggregateQuery(aggregate); assert.deepStrictEqual(results, [{property_1: 8}]); }); - it('should run a count aggregation having a maximum', async () => { - const q = datastore.createQuery('Character'); - const aggregate = datastore - .aggregate_query(q) - .aggregate([AggregateField.count().alias('total')]); - const [results] = await datastore.runAggregateQuery(aggregate); - assert.deepStrictEqual(results, [{total: 4}]); - }); it('should run a count aggregation having other filters', async () => { const q = datastore .createQuery('Character') From c09d548df06f20f2fd8f47d150b0c1f7deb6a377 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Tue, 18 Oct 2022 14:25:57 -0700 Subject: [PATCH 52/67] undid local changes to package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c0d3877d6..9faa6d51f 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "prepare": "npm run compile-protos && npm run compile", "samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../", "presystem-test": "npm run compile", - "system-test": "mocha build/system-test --inspect-brk", + "system-test": "mocha build/system-test --timeout 600000", "pretest": "npm run compile", "test": "c8 mocha build/test", "precompile": "gts clean" From 794314ee83e86011432af091a6dd06cee90765b8 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 19 Oct 2022 18:20:29 +0000 Subject: [PATCH 53/67] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-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 --- protos/protos.d.ts | 2 +- protos/protos.js | 3882 ++++---------------------------------------- 2 files changed, 279 insertions(+), 3605 deletions(-) diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 827262b9d..efdba35c4 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -12,8 +12,8 @@ // 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"); +import type {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/protos/protos.js b/protos/protos.js index 7fe9ed2c2..08de14235 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -580,12 +580,6 @@ message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); } switch (object.operationType) { - default: - if (typeof object.operationType === "number") { - message.operationType = object.operationType; - break; - } - break; case "OPERATION_TYPE_UNSPECIFIED": case 0: message.operationType = 0; @@ -615,12 +609,6 @@ message.labels[keys[i]] = String(object.labels[keys[i]]); } switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -683,7 +671,7 @@ if (message.endTime != null && message.hasOwnProperty("endTime")) object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); if (message.operationType != null && message.hasOwnProperty("operationType")) - object.operationType = options.enums === String ? $root.google.datastore.admin.v1.OperationType[message.operationType] === undefined ? message.operationType : $root.google.datastore.admin.v1.OperationType[message.operationType] : message.operationType; + object.operationType = options.enums === String ? $root.google.datastore.admin.v1.OperationType[message.operationType] : message.operationType; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; @@ -691,7 +679,7 @@ object.labels[keys2[j]] = message.labels[keys2[j]]; } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.CommonMetadata.State[message.state] === undefined ? message.state : $root.google.datastore.admin.v1.CommonMetadata.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.datastore.admin.v1.CommonMetadata.State[message.state] : message.state; return object; }; @@ -4380,12 +4368,6 @@ return object; var message = new $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata(); switch (object.migrationState) { - default: - if (typeof object.migrationState === "number") { - message.migrationState = object.migrationState; - break; - } - break; case "MIGRATION_STATE_UNSPECIFIED": case 0: message.migrationState = 0; @@ -4404,12 +4386,6 @@ break; } switch (object.migrationStep) { - default: - if (typeof object.migrationStep === "number") { - message.migrationStep = object.migrationStep; - break; - } - break; case "MIGRATION_STEP_UNSPECIFIED": case 0: message.migrationStep = 0; @@ -4464,9 +4440,9 @@ object.migrationStep = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; } if (message.migrationState != null && message.hasOwnProperty("migrationState")) - object.migrationState = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.migrationState] === undefined ? message.migrationState : $root.google.datastore.admin.v1.MigrationState[message.migrationState] : message.migrationState; + object.migrationState = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.migrationState] : message.migrationState; if (message.migrationStep != null && message.hasOwnProperty("migrationStep")) - object.migrationStep = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] === undefined ? message.migrationStep : $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] : message.migrationStep; + object.migrationStep = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] : message.migrationStep; return object; }; @@ -4789,12 +4765,6 @@ if (object.kind != null) message.kind = String(object.kind); switch (object.ancestor) { - default: - if (typeof object.ancestor === "number") { - message.ancestor = object.ancestor; - break; - } - break; case "ANCESTOR_MODE_UNSPECIFIED": case 0: message.ancestor = 0; @@ -4819,12 +4789,6 @@ } } switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -4878,14 +4842,14 @@ if (message.kind != null && message.hasOwnProperty("kind")) object.kind = message.kind; if (message.ancestor != null && message.hasOwnProperty("ancestor")) - object.ancestor = options.enums === String ? $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] === undefined ? message.ancestor : $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] : message.ancestor; + object.ancestor = options.enums === String ? $root.google.datastore.admin.v1.Index.AncestorMode[message.ancestor] : message.ancestor; if (message.properties && message.properties.length) { object.properties = []; for (var j = 0; j < message.properties.length; ++j) object.properties[j] = $root.google.datastore.admin.v1.Index.IndexedProperty.toObject(message.properties[j], options); } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.Index.State[message.state] === undefined ? message.state : $root.google.datastore.admin.v1.Index.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.datastore.admin.v1.Index.State[message.state] : message.state; return object; }; @@ -5123,12 +5087,6 @@ if (object.name != null) message.name = String(object.name); switch (object.direction) { - default: - if (typeof object.direction === "number") { - message.direction = object.direction; - break; - } - break; case "DIRECTION_UNSPECIFIED": case 0: message.direction = 0; @@ -5165,7 +5123,7 @@ if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.datastore.admin.v1.Index.Direction[message.direction] === undefined ? message.direction : $root.google.datastore.admin.v1.Index.Direction[message.direction] : message.direction; + object.direction = options.enums === String ? $root.google.datastore.admin.v1.Index.Direction[message.direction] : message.direction; return object; }; @@ -5378,12 +5336,6 @@ return object; var message = new $root.google.datastore.admin.v1.MigrationStateEvent(); switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; case "MIGRATION_STATE_UNSPECIFIED": case 0: message.state = 0; @@ -5420,7 +5372,7 @@ if (options.defaults) object.state = options.enums === String ? "MIGRATION_STATE_UNSPECIFIED" : 0; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.state] === undefined ? message.state : $root.google.datastore.admin.v1.MigrationState[message.state] : message.state; + object.state = options.enums === String ? $root.google.datastore.admin.v1.MigrationState[message.state] : message.state; return object; }; @@ -5677,12 +5629,6 @@ return object; var message = new $root.google.datastore.admin.v1.MigrationProgressEvent(); switch (object.step) { - default: - if (typeof object.step === "number") { - message.step = object.step; - break; - } - break; case "MIGRATION_STEP_UNSPECIFIED": case 0: message.step = 0; @@ -5745,7 +5691,7 @@ if (options.defaults) object.step = options.enums === String ? "MIGRATION_STEP_UNSPECIFIED" : 0; if (message.step != null && message.hasOwnProperty("step")) - object.step = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.step] === undefined ? message.step : $root.google.datastore.admin.v1.MigrationStep[message.step] : message.step; + object.step = options.enums === String ? $root.google.datastore.admin.v1.MigrationStep[message.step] : message.step; if (message.prepareStepDetails != null && message.hasOwnProperty("prepareStepDetails")) { object.prepareStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails.toObject(message.prepareStepDetails, options); if (options.oneofs) @@ -5960,12 +5906,6 @@ return object; var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails(); switch (object.concurrencyMode) { - default: - if (typeof object.concurrencyMode === "number") { - message.concurrencyMode = object.concurrencyMode; - break; - } - break; case "CONCURRENCY_MODE_UNSPECIFIED": case 0: message.concurrencyMode = 0; @@ -6002,7 +5942,7 @@ if (options.defaults) object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] === undefined ? message.concurrencyMode : $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; + object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; return object; }; @@ -6192,12 +6132,6 @@ return object; var message = new $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails(); switch (object.concurrencyMode) { - default: - if (typeof object.concurrencyMode === "number") { - message.concurrencyMode = object.concurrencyMode; - break; - } - break; case "CONCURRENCY_MODE_UNSPECIFIED": case 0: message.concurrencyMode = 0; @@ -6234,7 +6168,7 @@ if (options.defaults) object.concurrencyMode = options.enums === String ? "CONCURRENCY_MODE_UNSPECIFIED" : 0; if (message.concurrencyMode != null && message.hasOwnProperty("concurrencyMode")) - object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] === undefined ? message.concurrencyMode : $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; + object.concurrencyMode = options.enums === String ? $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; return object; }; @@ -6426,19 +6360,26 @@ var tag = reader.uint32(); switch (tag >>> 3) { case 2: { - if (!(message.missing && message.missing.length)) - message.missing = []; - message.missing.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.deferred && message.deferred.length)) - message.deferred = []; - message.deferred.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); - break; - } - case 7: { - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + if (message.aggregateProperties === $util.emptyObject) + message.aggregateProperties = {}; + 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.datastore.v1.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.aggregateProperties[key] = value; break; } default: @@ -6450,3546 +6391,367 @@ }; /** - * Decodes a LookupResponse message from the specified reader or buffer, length delimited. + * Decodes an AggregationResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.AggregationResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.LookupResponse} LookupResponse + * @returns {google.datastore.v1.AggregationResult} AggregationResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LookupResponse.decodeDelimited = function decodeDelimited(reader) { + AggregationResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LookupResponse message. + * Verifies an AggregationResult message. * @function verify - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.AggregationResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LookupResponse.verify = function verify(message) { + AggregationResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.found != null && message.hasOwnProperty("found")) { - if (!Array.isArray(message.found)) - return "found: array expected"; - for (var i = 0; i < message.found.length; ++i) { - var error = $root.google.datastore.v1.EntityResult.verify(message.found[i]); - if (error) - return "found." + error; - } - } - if (message.missing != null && message.hasOwnProperty("missing")) { - if (!Array.isArray(message.missing)) - return "missing: array expected"; - for (var i = 0; i < message.missing.length; ++i) { - var error = $root.google.datastore.v1.EntityResult.verify(message.missing[i]); - if (error) - return "missing." + error; - } - } - if (message.deferred != null && message.hasOwnProperty("deferred")) { - if (!Array.isArray(message.deferred)) - return "deferred: array expected"; - for (var i = 0; i < message.deferred.length; ++i) { - var error = $root.google.datastore.v1.Key.verify(message.deferred[i]); + if (message.aggregateProperties != null && message.hasOwnProperty("aggregateProperties")) { + if (!$util.isObject(message.aggregateProperties)) + return "aggregateProperties: object expected"; + var key = Object.keys(message.aggregateProperties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.datastore.v1.Value.verify(message.aggregateProperties[key[i]]); if (error) - return "deferred." + error; + return "aggregateProperties." + error; } } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } return null; }; /** - * Creates a LookupResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.AggregationResult * @static * @param {Object.} object Plain object - * @returns {google.datastore.v1.LookupResponse} LookupResponse + * @returns {google.datastore.v1.AggregationResult} AggregationResult */ - LookupResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.LookupResponse) + AggregationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationResult) return object; - var message = new $root.google.datastore.v1.LookupResponse(); - if (object.found) { - if (!Array.isArray(object.found)) - throw TypeError(".google.datastore.v1.LookupResponse.found: array expected"); - message.found = []; - for (var i = 0; i < object.found.length; ++i) { - if (typeof object.found[i] !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.found: object expected"); - message.found[i] = $root.google.datastore.v1.EntityResult.fromObject(object.found[i]); - } - } - if (object.missing) { - if (!Array.isArray(object.missing)) - throw TypeError(".google.datastore.v1.LookupResponse.missing: array expected"); - message.missing = []; - for (var i = 0; i < object.missing.length; ++i) { - if (typeof object.missing[i] !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.missing: object expected"); - message.missing[i] = $root.google.datastore.v1.EntityResult.fromObject(object.missing[i]); - } - } - if (object.deferred) { - if (!Array.isArray(object.deferred)) - throw TypeError(".google.datastore.v1.LookupResponse.deferred: array expected"); - message.deferred = []; - for (var i = 0; i < object.deferred.length; ++i) { - if (typeof object.deferred[i] !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.deferred: object expected"); - message.deferred[i] = $root.google.datastore.v1.Key.fromObject(object.deferred[i]); + var message = new $root.google.datastore.v1.AggregationResult(); + if (object.aggregateProperties) { + if (typeof object.aggregateProperties !== "object") + throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); + message.aggregateProperties = {}; + for (var keys = Object.keys(object.aggregateProperties), i = 0; i < keys.length; ++i) { + if (typeof object.aggregateProperties[keys[i]] !== "object") + throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); + message.aggregateProperties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.aggregateProperties[keys[i]]); } } - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.LookupResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } return message; }; /** - * Creates a plain object from a LookupResponse message. Also converts values to other types if specified. + * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.AggregationResult * @static - * @param {google.datastore.v1.LookupResponse} message LookupResponse + * @param {google.datastore.v1.AggregationResult} message AggregationResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LookupResponse.toObject = function toObject(message, options) { + AggregationResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.found = []; - object.missing = []; - object.deferred = []; - } - if (options.defaults) - object.readTime = null; - if (message.found && message.found.length) { - object.found = []; - for (var j = 0; j < message.found.length; ++j) - object.found[j] = $root.google.datastore.v1.EntityResult.toObject(message.found[j], options); - } - if (message.missing && message.missing.length) { - object.missing = []; - for (var j = 0; j < message.missing.length; ++j) - object.missing[j] = $root.google.datastore.v1.EntityResult.toObject(message.missing[j], options); - } - if (message.deferred && message.deferred.length) { - object.deferred = []; - for (var j = 0; j < message.deferred.length; ++j) - object.deferred[j] = $root.google.datastore.v1.Key.toObject(message.deferred[j], options); + if (options.objects || options.defaults) + object.aggregateProperties = {}; + var keys2; + if (message.aggregateProperties && (keys2 = Object.keys(message.aggregateProperties)).length) { + object.aggregateProperties = {}; + for (var j = 0; j < keys2.length; ++j) + object.aggregateProperties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.aggregateProperties[keys2[j]], options); } - if (message.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); return object; }; /** - * Converts this LookupResponse to JSON. + * Converts this AggregationResult to JSON. * @function toJSON - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.AggregationResult * @instance * @returns {Object.} JSON object */ - LookupResponse.prototype.toJSON = function toJSON() { + AggregationResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LookupResponse + * Gets the default type url for AggregationResult * @function getTypeUrl - * @memberof google.datastore.v1.LookupResponse + * @memberof google.datastore.v1.AggregationResult * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LookupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AggregationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.datastore.v1.LookupResponse"; + return typeUrlPrefix + "/google.datastore.v1.AggregationResult"; }; - return LookupResponse; + return AggregationResult; })(); - v1.RunQueryRequest = (function() { + v1.AggregationResultBatch = (function() { /** - * Properties of a RunQueryRequest. + * Properties of an AggregationResultBatch. * @memberof google.datastore.v1 - * @interface IRunQueryRequest - * @property {string|null} [projectId] RunQueryRequest projectId - * @property {string|null} [databaseId] RunQueryRequest databaseId - * @property {google.datastore.v1.IPartitionId|null} [partitionId] RunQueryRequest partitionId - * @property {google.datastore.v1.IReadOptions|null} [readOptions] RunQueryRequest readOptions - * @property {google.datastore.v1.IQuery|null} [query] RunQueryRequest query - * @property {google.datastore.v1.IGqlQuery|null} [gqlQuery] RunQueryRequest gqlQuery + * @interface IAggregationResultBatch + * @property {Array.|null} [aggregationResults] AggregationResultBatch aggregationResults + * @property {google.datastore.v1.QueryResultBatch.MoreResultsType|null} [moreResults] AggregationResultBatch moreResults + * @property {google.protobuf.ITimestamp|null} [readTime] AggregationResultBatch readTime */ /** - * Constructs a new RunQueryRequest. + * Constructs a new AggregationResultBatch. * @memberof google.datastore.v1 - * @classdesc Represents a RunQueryRequest. - * @implements IRunQueryRequest + * @classdesc Represents an AggregationResultBatch. + * @implements IAggregationResultBatch * @constructor - * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set + * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set */ - function RunQueryRequest(properties) { - if (properties) + function AggregationResultBatch(properties) { + this.aggregationResults = []; + if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; } /** - * RunQueryRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.projectId = ""; - - /** - * RunQueryRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.databaseId = ""; - - /** - * RunQueryRequest partitionId. - * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.partitionId = null; - - /** - * RunQueryRequest readOptions. - * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.readOptions = null; - - /** - * RunQueryRequest query. - * @member {google.datastore.v1.IQuery|null|undefined} query - * @memberof google.datastore.v1.RunQueryRequest + * AggregationResultBatch aggregationResults. + * @member {Array.} aggregationResults + * @memberof google.datastore.v1.AggregationResultBatch * @instance */ - RunQueryRequest.prototype.query = null; + AggregationResultBatch.prototype.aggregationResults = $util.emptyArray; /** - * RunQueryRequest gqlQuery. - * @member {google.datastore.v1.IGqlQuery|null|undefined} gqlQuery - * @memberof google.datastore.v1.RunQueryRequest + * AggregationResultBatch moreResults. + * @member {google.datastore.v1.QueryResultBatch.MoreResultsType} moreResults + * @memberof google.datastore.v1.AggregationResultBatch * @instance */ - RunQueryRequest.prototype.gqlQuery = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + AggregationResultBatch.prototype.moreResults = 0; /** - * RunQueryRequest queryType. - * @member {"query"|"gqlQuery"|undefined} queryType - * @memberof google.datastore.v1.RunQueryRequest + * AggregationResultBatch readTime. + * @member {google.protobuf.ITimestamp|null|undefined} readTime + * @memberof google.datastore.v1.AggregationResultBatch * @instance */ - Object.defineProperty(RunQueryRequest.prototype, "queryType", { - get: $util.oneOfGetter($oneOfFields = ["query", "gqlQuery"]), - set: $util.oneOfSetter($oneOfFields) - }); + AggregationResultBatch.prototype.readTime = null; /** - * Creates a new RunQueryRequest instance using the specified properties. + * Creates a new AggregationResultBatch instance using the specified properties. * @function create - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.AggregationResultBatch * @static - * @param {google.datastore.v1.IRunQueryRequest=} [properties] Properties to set - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest instance + * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch instance */ - RunQueryRequest.create = function create(properties) { - return new RunQueryRequest(properties); + AggregationResultBatch.create = function create(properties) { + return new AggregationResultBatch(properties); }; /** - * Encodes the specified RunQueryRequest message. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * Encodes the specified AggregationResultBatch message. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. * @function encode - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.AggregationResultBatch * @static - * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunQueryRequest.encode = function encode(message, writer) { + AggregationResultBatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readOptions != null && Object.hasOwnProperty.call(message, "readOptions")) - $root.google.datastore.v1.ReadOptions.encode(message.readOptions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.partitionId != null && Object.hasOwnProperty.call(message, "partitionId")) - $root.google.datastore.v1.PartitionId.encode(message.partitionId, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.gqlQuery != null && Object.hasOwnProperty.call(message, "gqlQuery")) - $root.google.datastore.v1.GqlQuery.encode(message.gqlQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); + if (message.aggregationResults != null && message.aggregationResults.length) + for (var i = 0; i < message.aggregationResults.length; ++i) + $root.google.datastore.v1.AggregationResult.encode(message.aggregationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.moreResults != null && Object.hasOwnProperty.call(message, "moreResults")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.moreResults); + if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) + $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified RunQueryRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryRequest.verify|verify} messages. + * Encodes the specified AggregationResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. * @function encodeDelimited - * @memberof google.datastore.v1.RunQueryRequest + * @memberof google.datastore.v1.AggregationResultBatch * @static - * @param {google.datastore.v1.IRunQueryRequest} message RunQueryRequest message or plain object to encode + * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunQueryRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunQueryRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunQueryRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: { - message.projectId = reader.string(); - break; - } - case 9: { - message.databaseId = reader.string(); - break; - } - case 2: { - message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32()); - break; - } - case 1: { - message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32()); - break; - } - case 3: { - message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); - break; - } - case 7: { - message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunQueryRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunQueryRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunQueryRequest message. - * @function verify - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunQueryRequest.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.databaseId != null && message.hasOwnProperty("databaseId")) - if (!$util.isString(message.databaseId)) - return "databaseId: string expected"; - if (message.partitionId != null && message.hasOwnProperty("partitionId")) { - var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId); - if (error) - return "partitionId." + error; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions); - if (error) - return "readOptions." + error; - } - if (message.query != null && message.hasOwnProperty("query")) { - properties.queryType = 1; - { - var error = $root.google.datastore.v1.Query.verify(message.query); - if (error) - return "query." + error; - } - } - if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { - if (properties.queryType === 1) - return "queryType: multiple values"; - properties.queryType = 1; - { - var error = $root.google.datastore.v1.GqlQuery.verify(message.gqlQuery); - if (error) - return "gqlQuery." + error; - } - } - return null; - }; - - /** - * Creates a RunQueryRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RunQueryRequest} RunQueryRequest - */ - RunQueryRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RunQueryRequest) - return object; - var message = new $root.google.datastore.v1.RunQueryRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.partitionId != null) { - if (typeof object.partitionId !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.partitionId: object expected"); - message.partitionId = $root.google.datastore.v1.PartitionId.fromObject(object.partitionId); - } - if (object.readOptions != null) { - if (typeof object.readOptions !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.readOptions: object expected"); - message.readOptions = $root.google.datastore.v1.ReadOptions.fromObject(object.readOptions); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.query: object expected"); - message.query = $root.google.datastore.v1.Query.fromObject(object.query); - } - if (object.gqlQuery != null) { - if (typeof object.gqlQuery !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.gqlQuery: object expected"); - message.gqlQuery = $root.google.datastore.v1.GqlQuery.fromObject(object.gqlQuery); - } - return message; - }; - - /** - * Creates a plain object from a RunQueryRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {google.datastore.v1.RunQueryRequest} message RunQueryRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunQueryRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.readOptions = null; - object.partitionId = null; - object.projectId = ""; - object.databaseId = ""; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) - object.readOptions = $root.google.datastore.v1.ReadOptions.toObject(message.readOptions, options); - if (message.partitionId != null && message.hasOwnProperty("partitionId")) - object.partitionId = $root.google.datastore.v1.PartitionId.toObject(message.partitionId, options); - if (message.query != null && message.hasOwnProperty("query")) { - object.query = $root.google.datastore.v1.Query.toObject(message.query, options); - if (options.oneofs) - object.queryType = "query"; - } - if (message.gqlQuery != null && message.hasOwnProperty("gqlQuery")) { - object.gqlQuery = $root.google.datastore.v1.GqlQuery.toObject(message.gqlQuery, options); - if (options.oneofs) - object.queryType = "gqlQuery"; - } - 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 RunQueryRequest to JSON. - * @function toJSON - * @memberof google.datastore.v1.RunQueryRequest - * @instance - * @returns {Object.} JSON object - */ - RunQueryRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunQueryRequest - * @function getTypeUrl - * @memberof google.datastore.v1.RunQueryRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.RunQueryRequest"; - }; - - return RunQueryRequest; - })(); - - v1.RunQueryResponse = (function() { - - /** - * Properties of a RunQueryResponse. - * @memberof google.datastore.v1 - * @interface IRunQueryResponse - * @property {google.datastore.v1.IQueryResultBatch|null} [batch] RunQueryResponse batch - * @property {google.datastore.v1.IQuery|null} [query] RunQueryResponse query - */ - - /** - * Constructs a new RunQueryResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a RunQueryResponse. - * @implements IRunQueryResponse - * @constructor - * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set - */ - function RunQueryResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunQueryResponse batch. - * @member {google.datastore.v1.IQueryResultBatch|null|undefined} batch - * @memberof google.datastore.v1.RunQueryResponse - * @instance - */ - RunQueryResponse.prototype.batch = null; - - /** - * RunQueryResponse query. - * @member {google.datastore.v1.IQuery|null|undefined} query - * @memberof google.datastore.v1.RunQueryResponse - * @instance - */ - RunQueryResponse.prototype.query = null; - - /** - * Creates a new RunQueryResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {google.datastore.v1.IRunQueryResponse=} [properties] Properties to set - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse instance - */ - RunQueryResponse.create = function create(properties) { - return new RunQueryResponse(properties); - }; - - /** - * Encodes the specified RunQueryResponse message. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunQueryResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.batch != null && Object.hasOwnProperty.call(message, "batch")) - $root.google.datastore.v1.QueryResultBatch.encode(message.batch, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.query != null && Object.hasOwnProperty.call(message, "query")) - $root.google.datastore.v1.Query.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RunQueryResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RunQueryResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {google.datastore.v1.IRunQueryResponse} message RunQueryResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RunQueryResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RunQueryResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunQueryResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.batch = $root.google.datastore.v1.QueryResultBatch.decode(reader, reader.uint32()); - break; - } - case 2: { - message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RunQueryResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RunQueryResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RunQueryResponse message. - * @function verify - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RunQueryResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.batch != null && message.hasOwnProperty("batch")) { - var error = $root.google.datastore.v1.QueryResultBatch.verify(message.batch); - if (error) - return "batch." + error; - } - if (message.query != null && message.hasOwnProperty("query")) { - var error = $root.google.datastore.v1.Query.verify(message.query); - if (error) - return "query." + error; - } - return null; - }; - - /** - * Creates a RunQueryResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RunQueryResponse} RunQueryResponse - */ - RunQueryResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RunQueryResponse) - return object; - var message = new $root.google.datastore.v1.RunQueryResponse(); - if (object.batch != null) { - if (typeof object.batch !== "object") - throw TypeError(".google.datastore.v1.RunQueryResponse.batch: object expected"); - message.batch = $root.google.datastore.v1.QueryResultBatch.fromObject(object.batch); - } - if (object.query != null) { - if (typeof object.query !== "object") - throw TypeError(".google.datastore.v1.RunQueryResponse.query: object expected"); - message.query = $root.google.datastore.v1.Query.fromObject(object.query); - } - return message; - }; - - /** - * Creates a plain object from a RunQueryResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {google.datastore.v1.RunQueryResponse} message RunQueryResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RunQueryResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.batch = null; - object.query = null; - } - if (message.batch != null && message.hasOwnProperty("batch")) - object.batch = $root.google.datastore.v1.QueryResultBatch.toObject(message.batch, options); - if (message.query != null && message.hasOwnProperty("query")) - object.query = $root.google.datastore.v1.Query.toObject(message.query, options); - return object; - }; - - /** - * Converts this RunQueryResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.RunQueryResponse - * @instance - * @returns {Object.} JSON object - */ - RunQueryResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RunQueryResponse - * @function getTypeUrl - * @memberof google.datastore.v1.RunQueryResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.RunQueryResponse"; - }; - - return RunQueryResponse; - })(); - - v1.BeginTransactionRequest = (function() { - - /** - * Properties of a BeginTransactionRequest. - * @memberof google.datastore.v1 - * @interface IBeginTransactionRequest - * @property {string|null} [projectId] BeginTransactionRequest projectId - * @property {string|null} [databaseId] BeginTransactionRequest databaseId - * @property {google.datastore.v1.ITransactionOptions|null} [transactionOptions] BeginTransactionRequest transactionOptions - */ - - /** - * Constructs a new BeginTransactionRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a BeginTransactionRequest. - * @implements IBeginTransactionRequest - * @constructor - * @param {google.datastore.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 projectId. - * @member {string} projectId - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.projectId = ""; - - /** - * BeginTransactionRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.databaseId = ""; - - /** - * BeginTransactionRequest transactionOptions. - * @member {google.datastore.v1.ITransactionOptions|null|undefined} transactionOptions - * @memberof google.datastore.v1.BeginTransactionRequest - * @instance - */ - BeginTransactionRequest.prototype.transactionOptions = null; - - /** - * Creates a new BeginTransactionRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.v1.IBeginTransactionRequest=} [properties] Properties to set - * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest instance - */ - BeginTransactionRequest.create = function create(properties) { - return new BeginTransactionRequest(properties); - }; - - /** - * Encodes the specified BeginTransactionRequest message. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.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.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - if (message.transactionOptions != null && Object.hasOwnProperty.call(message, "transactionOptions")) - $root.google.datastore.v1.TransactionOptions.encode(message.transactionOptions, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BeginTransactionRequest message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.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.datastore.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: { - message.projectId = reader.string(); - break; - } - case 9: { - message.databaseId = reader.string(); - break; - } - case 10: { - message.transactionOptions = $root.google.datastore.v1.TransactionOptions.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.datastore.v1.BeginTransactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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.datastore.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.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.transactionOptions != null && message.hasOwnProperty("transactionOptions")) { - var error = $root.google.datastore.v1.TransactionOptions.verify(message.transactionOptions); - if (error) - return "transactionOptions." + error; - } - return null; - }; - - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.BeginTransactionRequest} BeginTransactionRequest - */ - BeginTransactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.BeginTransactionRequest) - return object; - var message = new $root.google.datastore.v1.BeginTransactionRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.transactionOptions != null) { - if (typeof object.transactionOptions !== "object") - throw TypeError(".google.datastore.v1.BeginTransactionRequest.transactionOptions: object expected"); - message.transactionOptions = $root.google.datastore.v1.TransactionOptions.fromObject(object.transactionOptions); - } - return message; - }; - - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.BeginTransactionRequest - * @static - * @param {google.datastore.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.projectId = ""; - object.databaseId = ""; - object.transactionOptions = null; - } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.databaseId != null && message.hasOwnProperty("databaseId")) - object.databaseId = message.databaseId; - if (message.transactionOptions != null && message.hasOwnProperty("transactionOptions")) - object.transactionOptions = $root.google.datastore.v1.TransactionOptions.toObject(message.transactionOptions, options); - return object; - }; - - /** - * Converts this BeginTransactionRequest to JSON. - * @function toJSON - * @memberof google.datastore.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.datastore.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.datastore.v1.BeginTransactionRequest"; - }; - - return BeginTransactionRequest; - })(); - - v1.BeginTransactionResponse = (function() { - - /** - * Properties of a BeginTransactionResponse. - * @memberof google.datastore.v1 - * @interface IBeginTransactionResponse - * @property {Uint8Array|null} [transaction] BeginTransactionResponse transaction - */ - - /** - * Constructs a new BeginTransactionResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a BeginTransactionResponse. - * @implements IBeginTransactionResponse - * @constructor - * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set - */ - function BeginTransactionResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BeginTransactionResponse transaction. - * @member {Uint8Array} transaction - * @memberof google.datastore.v1.BeginTransactionResponse - * @instance - */ - BeginTransactionResponse.prototype.transaction = $util.newBuffer([]); - - /** - * Creates a new BeginTransactionResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.IBeginTransactionResponse=} [properties] Properties to set - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse instance - */ - BeginTransactionResponse.create = function create(properties) { - return new BeginTransactionResponse(properties); - }; - - /** - * Encodes the specified BeginTransactionResponse message. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - return writer; - }; - - /** - * Encodes the specified BeginTransactionResponse message, length delimited. Does not implicitly {@link google.datastore.v1.BeginTransactionResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.IBeginTransactionResponse} message BeginTransactionResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BeginTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.transaction = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BeginTransactionResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BeginTransactionResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BeginTransactionResponse message. - * @function verify - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BeginTransactionResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - return null; - }; - - /** - * Creates a BeginTransactionResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.BeginTransactionResponse} BeginTransactionResponse - */ - BeginTransactionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.BeginTransactionResponse) - return object; - var message = new $root.google.datastore.v1.BeginTransactionResponse(); - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length >= 0) - message.transaction = object.transaction; - return message; - }; - - /** - * Creates a plain object from a BeginTransactionResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {google.datastore.v1.BeginTransactionResponse} message BeginTransactionResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BeginTransactionResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - return object; - }; - - /** - * Converts this BeginTransactionResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.BeginTransactionResponse - * @instance - * @returns {Object.} JSON object - */ - BeginTransactionResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BeginTransactionResponse - * @function getTypeUrl - * @memberof google.datastore.v1.BeginTransactionResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BeginTransactionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.BeginTransactionResponse"; - }; - - return BeginTransactionResponse; - })(); - - v1.RollbackRequest = (function() { - - /** - * Properties of a RollbackRequest. - * @memberof google.datastore.v1 - * @interface IRollbackRequest - * @property {string|null} [projectId] RollbackRequest projectId - * @property {string|null} [databaseId] RollbackRequest databaseId - * @property {Uint8Array|null} [transaction] RollbackRequest transaction - */ - - /** - * Constructs a new RollbackRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a RollbackRequest. - * @implements IRollbackRequest - * @constructor - * @param {google.datastore.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 projectId. - * @member {string} projectId - * @memberof google.datastore.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.projectId = ""; - - /** - * RollbackRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.databaseId = ""; - - /** - * RollbackRequest transaction. - * @member {Uint8Array} transaction - * @memberof google.datastore.v1.RollbackRequest - * @instance - */ - RollbackRequest.prototype.transaction = $util.newBuffer([]); - - /** - * Creates a new RollbackRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.v1.IRollbackRequest=} [properties] Properties to set - * @returns {google.datastore.v1.RollbackRequest} RollbackRequest instance - */ - RollbackRequest.create = function create(properties) { - return new RollbackRequest(properties); - }; - - /** - * Encodes the specified RollbackRequest message. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - return writer; - }; - - /** - * Encodes the specified RollbackRequest message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.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.datastore.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: { - message.projectId = reader.string(); - break; - } - case 9: { - message.databaseId = reader.string(); - break; - } - case 1: { - message.transaction = 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.datastore.v1.RollbackRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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.datastore.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.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.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - return null; - }; - - /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RollbackRequest} RollbackRequest - */ - RollbackRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RollbackRequest) - return object; - var message = new $root.google.datastore.v1.RollbackRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length >= 0) - message.transaction = object.transaction; - return message; - }; - - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RollbackRequest - * @static - * @param {google.datastore.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) { - if (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - object.projectId = ""; - object.databaseId = ""; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - 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 RollbackRequest to JSON. - * @function toJSON - * @memberof google.datastore.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.datastore.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.datastore.v1.RollbackRequest"; - }; - - return RollbackRequest; - })(); - - v1.RollbackResponse = (function() { - - /** - * Properties of a RollbackResponse. - * @memberof google.datastore.v1 - * @interface IRollbackResponse - */ - - /** - * Constructs a new RollbackResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a RollbackResponse. - * @implements IRollbackResponse - * @constructor - * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set - */ - function RollbackResponse(properties) { - if (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 RollbackResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {google.datastore.v1.IRollbackResponse=} [properties] Properties to set - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse instance - */ - RollbackResponse.create = function create(properties) { - return new RollbackResponse(properties); - }; - - /** - * Encodes the specified RollbackResponse message. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified RollbackResponse message, length delimited. Does not implicitly {@link google.datastore.v1.RollbackResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {google.datastore.v1.IRollbackResponse} message RollbackResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RollbackResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RollbackResponse message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RollbackResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RollbackResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RollbackResponse message. - * @function verify - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RollbackResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a RollbackResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.RollbackResponse} RollbackResponse - */ - RollbackResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.RollbackResponse) - return object; - return new $root.google.datastore.v1.RollbackResponse(); - }; - - /** - * Creates a plain object from a RollbackResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {google.datastore.v1.RollbackResponse} message RollbackResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RollbackResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this RollbackResponse to JSON. - * @function toJSON - * @memberof google.datastore.v1.RollbackResponse - * @instance - * @returns {Object.} JSON object - */ - RollbackResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RollbackResponse - * @function getTypeUrl - * @memberof google.datastore.v1.RollbackResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RollbackResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.RollbackResponse"; - }; - - return RollbackResponse; - })(); - - v1.CommitRequest = (function() { - - /** - * Properties of a CommitRequest. - * @memberof google.datastore.v1 - * @interface ICommitRequest - * @property {string|null} [projectId] CommitRequest projectId - * @property {string|null} [databaseId] CommitRequest databaseId - * @property {google.datastore.v1.CommitRequest.Mode|null} [mode] CommitRequest mode - * @property {Uint8Array|null} [transaction] CommitRequest transaction - * @property {Array.|null} [mutations] CommitRequest mutations - */ - - /** - * Constructs a new CommitRequest. - * @memberof google.datastore.v1 - * @classdesc Represents a CommitRequest. - * @implements ICommitRequest - * @constructor - * @param {google.datastore.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 projectId. - * @member {string} projectId - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.projectId = ""; - - /** - * CommitRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.databaseId = ""; - - /** - * CommitRequest mode. - * @member {google.datastore.v1.CommitRequest.Mode} mode - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.mode = 0; - - /** - * CommitRequest transaction. - * @member {Uint8Array|null|undefined} transaction - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.transaction = null; - - /** - * CommitRequest mutations. - * @member {Array.} mutations - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.mutations = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CommitRequest transactionSelector. - * @member {"transaction"|undefined} transactionSelector - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - Object.defineProperty(CommitRequest.prototype, "transactionSelector", { - get: $util.oneOfGetter($oneOfFields = ["transaction"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CommitRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {google.datastore.v1.ICommitRequest=} [properties] Properties to set - * @returns {google.datastore.v1.CommitRequest} CommitRequest instance - */ - CommitRequest.create = function create(properties) { - return new CommitRequest(properties); - }; - - /** - * Encodes the specified CommitRequest message. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {google.datastore.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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transaction); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.mode); - if (message.mutations != null && message.mutations.length) - for (var i = 0; i < message.mutations.length; ++i) - $root.google.datastore.v1.Mutation.encode(message.mutations[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - return writer; - }; - - /** - * Encodes the specified CommitRequest message, length delimited. Does not implicitly {@link google.datastore.v1.CommitRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {google.datastore.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.datastore.v1.CommitRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: { - message.projectId = reader.string(); - break; - } - case 9: { - message.databaseId = reader.string(); - break; - } - case 5: { - message.mode = reader.int32(); - break; - } - case 1: { - message.transaction = reader.bytes(); - break; - } - case 6: { - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.google.datastore.v1.Mutation.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.datastore.v1.CommitRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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.datastore.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.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.mode != null && message.hasOwnProperty("mode")) - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - properties.transactionSelector = 1; - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - } - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.google.datastore.v1.Mutation.verify(message.mutations[i]); - if (error) - return "mutations." + error; - } - } - return null; - }; - - /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.CommitRequest} CommitRequest - */ - CommitRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.CommitRequest) - return object; - var message = new $root.google.datastore.v1.CommitRequest(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.databaseId != null) - message.databaseId = String(object.databaseId); - 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 "TRANSACTIONAL": - case 1: - message.mode = 1; - break; - case "NON_TRANSACTIONAL": - case 2: - message.mode = 2; - break; - } - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length >= 0) - message.transaction = object.transaction; - if (object.mutations) { - if (!Array.isArray(object.mutations)) - throw TypeError(".google.datastore.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.datastore.v1.CommitRequest.mutations: object expected"); - message.mutations[i] = $root.google.datastore.v1.Mutation.fromObject(object.mutations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.CommitRequest - * @static - * @param {google.datastore.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.mode = options.enums === String ? "MODE_UNSPECIFIED" : 0; - object.projectId = ""; - object.databaseId = ""; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (options.oneofs) - object.transactionSelector = "transaction"; - } - if (message.mode != null && message.hasOwnProperty("mode")) - object.mode = options.enums === String ? $root.google.datastore.v1.CommitRequest.Mode[message.mode] === undefined ? message.mode : $root.google.datastore.v1.CommitRequest.Mode[message.mode] : message.mode; - if (message.mutations && message.mutations.length) { - object.mutations = []; - for (var j = 0; j < message.mutations.length; ++j) - object.mutations[j] = $root.google.datastore.v1.Mutation.toObject(message.mutations[j], options); - } - 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 CommitRequest to JSON. - * @function toJSON - * @memberof google.datastore.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.datastore.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.datastore.v1.CommitRequest"; - }; - - /** - * Mode enum. - * @name google.datastore.v1.CommitRequest.Mode - * @enum {number} - * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value - * @property {number} TRANSACTIONAL=1 TRANSACTIONAL value - * @property {number} NON_TRANSACTIONAL=2 NON_TRANSACTIONAL value - */ - CommitRequest.Mode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TRANSACTIONAL"] = 1; - values[valuesById[2] = "NON_TRANSACTIONAL"] = 2; - return values; - })(); - - return CommitRequest; - })(); - - v1.CommitResponse = (function() { - - /** - * Properties of a CommitResponse. - * @memberof google.datastore.v1 - * @interface ICommitResponse - * @property {Array.|null} [mutationResults] CommitResponse mutationResults - * @property {number|null} [indexUpdates] CommitResponse indexUpdates - * @property {google.protobuf.ITimestamp|null} [commitTime] CommitResponse commitTime - */ - - /** - * Constructs a new CommitResponse. - * @memberof google.datastore.v1 - * @classdesc Represents a CommitResponse. - * @implements ICommitResponse - * @constructor - * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set - */ - function CommitResponse(properties) { - this.mutationResults = []; - if (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 mutationResults. - * @member {Array.} mutationResults - * @memberof google.datastore.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.mutationResults = $util.emptyArray; - - /** - * CommitResponse indexUpdates. - * @member {number} indexUpdates - * @memberof google.datastore.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.indexUpdates = 0; - - /** - * CommitResponse commitTime. - * @member {google.protobuf.ITimestamp|null|undefined} commitTime - * @memberof google.datastore.v1.CommitResponse - * @instance - */ - CommitResponse.prototype.commitTime = null; - - /** - * Creates a new CommitResponse instance using the specified properties. - * @function create - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {google.datastore.v1.ICommitResponse=} [properties] Properties to set - * @returns {google.datastore.v1.CommitResponse} CommitResponse instance - */ - CommitResponse.create = function create(properties) { - return new CommitResponse(properties); - }; - - /** - * Encodes the specified CommitResponse message. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {google.datastore.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.mutationResults != null && message.mutationResults.length) - for (var i = 0; i < message.mutationResults.length; ++i) - $root.google.datastore.v1.MutationResult.encode(message.mutationResults[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.indexUpdates != null && Object.hasOwnProperty.call(message, "indexUpdates")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.indexUpdates); - if (message.commitTime != null && Object.hasOwnProperty.call(message, "commitTime")) - $root.google.protobuf.Timestamp.encode(message.commitTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommitResponse message, length delimited. Does not implicitly {@link google.datastore.v1.CommitResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {google.datastore.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.datastore.v1.CommitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 3: { - if (!(message.mutationResults && message.mutationResults.length)) - message.mutationResults = []; - message.mutationResults.push($root.google.datastore.v1.MutationResult.decode(reader, reader.uint32())); - break; - } - case 4: { - message.indexUpdates = reader.int32(); - break; - } - case 8: { - message.commitTime = $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.datastore.v1.CommitResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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.datastore.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"; - if (message.mutationResults != null && message.hasOwnProperty("mutationResults")) { - if (!Array.isArray(message.mutationResults)) - return "mutationResults: array expected"; - for (var i = 0; i < message.mutationResults.length; ++i) { - var error = $root.google.datastore.v1.MutationResult.verify(message.mutationResults[i]); - if (error) - return "mutationResults." + error; - } - } - if (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) - if (!$util.isInteger(message.indexUpdates)) - return "indexUpdates: integer expected"; - if (message.commitTime != null && message.hasOwnProperty("commitTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.commitTime); - if (error) - return "commitTime." + error; - } - return null; - }; - - /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.CommitResponse} CommitResponse - */ - CommitResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.CommitResponse) - return object; - var message = new $root.google.datastore.v1.CommitResponse(); - if (object.mutationResults) { - if (!Array.isArray(object.mutationResults)) - throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: array expected"); - message.mutationResults = []; - for (var i = 0; i < object.mutationResults.length; ++i) { - if (typeof object.mutationResults[i] !== "object") - throw TypeError(".google.datastore.v1.CommitResponse.mutationResults: object expected"); - message.mutationResults[i] = $root.google.datastore.v1.MutationResult.fromObject(object.mutationResults[i]); - } - } - if (object.indexUpdates != null) - message.indexUpdates = object.indexUpdates | 0; - if (object.commitTime != null) { - if (typeof object.commitTime !== "object") - throw TypeError(".google.datastore.v1.CommitResponse.commitTime: object expected"); - message.commitTime = $root.google.protobuf.Timestamp.fromObject(object.commitTime); - } - return message; - }; - - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.CommitResponse - * @static - * @param {google.datastore.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.arrays || options.defaults) - object.mutationResults = []; - if (options.defaults) { - object.indexUpdates = 0; - object.commitTime = null; - } - if (message.mutationResults && message.mutationResults.length) { - object.mutationResults = []; - for (var j = 0; j < message.mutationResults.length; ++j) - object.mutationResults[j] = $root.google.datastore.v1.MutationResult.toObject(message.mutationResults[j], options); - } - if (message.indexUpdates != null && message.hasOwnProperty("indexUpdates")) - object.indexUpdates = message.indexUpdates; - if (message.commitTime != null && message.hasOwnProperty("commitTime")) - object.commitTime = $root.google.protobuf.Timestamp.toObject(message.commitTime, options); - return object; - }; - - /** - * Converts this CommitResponse to JSON. - * @function toJSON - * @memberof google.datastore.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.datastore.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.datastore.v1.CommitResponse"; - }; - - return CommitResponse; - })(); - - v1.AllocateIdsRequest = (function() { - - /** - * Properties of an AllocateIdsRequest. - * @memberof google.datastore.v1 - * @interface IAllocateIdsRequest - * @property {string|null} [projectId] AllocateIdsRequest projectId - * @property {string|null} [databaseId] AllocateIdsRequest databaseId - * @property {Array.|null} [keys] AllocateIdsRequest keys - */ - - /** - * Constructs a new AllocateIdsRequest. - * @memberof google.datastore.v1 - * @classdesc Represents an AllocateIdsRequest. - * @implements IAllocateIdsRequest - * @constructor - * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set - */ - function AllocateIdsRequest(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]]; - } - - /** - * AllocateIdsRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - */ - AllocateIdsRequest.prototype.projectId = ""; - - /** - * AllocateIdsRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - */ - AllocateIdsRequest.prototype.databaseId = ""; - - /** - * AllocateIdsRequest keys. - * @member {Array.} keys - * @memberof google.datastore.v1.AllocateIdsRequest - * @instance - */ - AllocateIdsRequest.prototype.keys = $util.emptyArray; - - /** - * Creates a new AllocateIdsRequest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.IAllocateIdsRequest=} [properties] Properties to set - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest instance - */ - AllocateIdsRequest.create = function create(properties) { - return new AllocateIdsRequest(properties); - }; - - /** - * Encodes the specified AllocateIdsRequest message. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocateIdsRequest.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.datastore.v1.Key.encode(message.keys[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.projectId); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - return writer; - }; - - /** - * Encodes the specified AllocateIdsRequest message, length delimited. Does not implicitly {@link google.datastore.v1.AllocateIdsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {google.datastore.v1.IAllocateIdsRequest} message AllocateIdsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocateIdsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllocateIdsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AllocateIdsRequest} AllocateIdsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocateIdsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 8: { - message.projectId = reader.string(); - break; - } - case 9: { - message.databaseId = reader.string(); - break; - } - case 1: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AggregationResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AggregationResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationResult} AggregationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AggregationResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AggregationResult message. - * @function verify - * @memberof google.datastore.v1.AggregationResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AggregationResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.aggregateProperties != null && message.hasOwnProperty("aggregateProperties")) { - if (!$util.isObject(message.aggregateProperties)) - return "aggregateProperties: object expected"; - var key = Object.keys(message.aggregateProperties); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.datastore.v1.Value.verify(message.aggregateProperties[key[i]]); - if (error) - return "aggregateProperties." + error; - } - } - return null; - }; - - /** - * Creates an AggregationResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.AggregationResult - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationResult} AggregationResult - */ - AggregationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AggregationResult) - return object; - var message = new $root.google.datastore.v1.AggregationResult(); - if (object.aggregateProperties) { - if (typeof object.aggregateProperties !== "object") - throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); - message.aggregateProperties = {}; - for (var keys = Object.keys(object.aggregateProperties), i = 0; i < keys.length; ++i) { - if (typeof object.aggregateProperties[keys[i]] !== "object") - throw TypeError(".google.datastore.v1.AggregationResult.aggregateProperties: object expected"); - message.aggregateProperties[keys[i]] = $root.google.datastore.v1.Value.fromObject(object.aggregateProperties[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from an AggregationResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.AggregationResult - * @static - * @param {google.datastore.v1.AggregationResult} message AggregationResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AggregationResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.aggregateProperties = {}; - var keys2; - if (message.aggregateProperties && (keys2 = Object.keys(message.aggregateProperties)).length) { - object.aggregateProperties = {}; - for (var j = 0; j < keys2.length; ++j) - object.aggregateProperties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.aggregateProperties[keys2[j]], options); - } - return object; - }; - - /** - * Converts this AggregationResult to JSON. - * @function toJSON - * @memberof google.datastore.v1.AggregationResult - * @instance - * @returns {Object.} JSON object - */ - AggregationResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AggregationResult - * @function getTypeUrl - * @memberof google.datastore.v1.AggregationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AggregationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.AggregationResult"; - }; - - return AggregationResult; - })(); - - v1.AggregationResultBatch = (function() { - - /** - * Properties of an AggregationResultBatch. - * @memberof google.datastore.v1 - * @interface IAggregationResultBatch - * @property {Array.|null} [aggregationResults] AggregationResultBatch aggregationResults - * @property {google.datastore.v1.QueryResultBatch.MoreResultsType|null} [moreResults] AggregationResultBatch moreResults - * @property {google.protobuf.ITimestamp|null} [readTime] AggregationResultBatch readTime - */ - - /** - * Constructs a new AggregationResultBatch. - * @memberof google.datastore.v1 - * @classdesc Represents an AggregationResultBatch. - * @implements IAggregationResultBatch - * @constructor - * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set - */ - function AggregationResultBatch(properties) { - this.aggregationResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AggregationResultBatch aggregationResults. - * @member {Array.} aggregationResults - * @memberof google.datastore.v1.AggregationResultBatch - * @instance - */ - AggregationResultBatch.prototype.aggregationResults = $util.emptyArray; - - /** - * AggregationResultBatch moreResults. - * @member {google.datastore.v1.QueryResultBatch.MoreResultsType} moreResults - * @memberof google.datastore.v1.AggregationResultBatch - * @instance - */ - AggregationResultBatch.prototype.moreResults = 0; - - /** - * AggregationResultBatch readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.AggregationResultBatch - * @instance - */ - AggregationResultBatch.prototype.readTime = null; - - /** - * Creates a new AggregationResultBatch instance using the specified properties. - * @function create - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {google.datastore.v1.IAggregationResultBatch=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch instance - */ - AggregationResultBatch.create = function create(properties) { - return new AggregationResultBatch(properties); - }; - - /** - * Encodes the specified AggregationResultBatch message. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AggregationResultBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.aggregationResults != null && message.aggregationResults.length) - for (var i = 0; i < message.aggregationResults.length; ++i) - $root.google.datastore.v1.AggregationResult.encode(message.aggregationResults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.moreResults != null && Object.hasOwnProperty.call(message, "moreResults")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.moreResults); - if (message.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AggregationResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationResultBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {google.datastore.v1.IAggregationResultBatch} message AggregationResultBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AggregationResultBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AggregationResultBatch message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AggregationResultBatch.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationResultBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.aggregationResults && message.aggregationResults.length)) - message.aggregationResults = []; - message.aggregationResults.push($root.google.datastore.v1.AggregationResult.decode(reader, reader.uint32())); - break; - } - case 2: { - message.moreResults = reader.int32(); - break; - } - case 3: { - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AggregationResultBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AggregationResultBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AggregationResultBatch message. - * @function verify - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AggregationResultBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.aggregationResults != null && message.hasOwnProperty("aggregationResults")) { - if (!Array.isArray(message.aggregationResults)) - return "aggregationResults: array expected"; - for (var i = 0; i < message.aggregationResults.length; ++i) { - var error = $root.google.datastore.v1.AggregationResult.verify(message.aggregationResults[i]); - if (error) - return "aggregationResults." + error; - } - } - if (message.moreResults != null && message.hasOwnProperty("moreResults")) - switch (message.moreResults) { - default: - return "moreResults: enum value expected"; - case 0: - case 1: - case 2: - case 4: - case 3: - break; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); - if (error) - return "readTime." + error; - } - return null; - }; - - /** - * Creates an AggregationResultBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch - */ - AggregationResultBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.AggregationResultBatch) - return object; - var message = new $root.google.datastore.v1.ReadOptions(); - switch (object.readConsistency) { - default: - if (typeof object.readConsistency === "number") { - message.readConsistency = object.readConsistency; - break; - } - break; - case "READ_CONSISTENCY_UNSPECIFIED": - case 0: - message.moreResults = 0; - break; - case "NOT_FINISHED": - case 1: - message.moreResults = 1; - break; - case "MORE_RESULTS_AFTER_LIMIT": - case 2: - message.moreResults = 2; - break; - } - if (object.transaction != null) - if (typeof object.transaction === "string") - $util.base64.decode(object.transaction, message.transaction = $util.newBuffer($util.base64.length(object.transaction)), 0); - else if (object.transaction.length >= 0) - message.transaction = object.transaction; - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.ReadOptions.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); - } - return message; - }; - - /** - * Creates a plain object from a ReadOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {google.datastore.v1.ReadOptions} message ReadOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.readConsistency != null && message.hasOwnProperty("readConsistency")) { - object.readConsistency = options.enums === String ? $root.google.datastore.v1.ReadOptions.ReadConsistency[message.readConsistency] === undefined ? message.readConsistency : $root.google.datastore.v1.ReadOptions.ReadConsistency[message.readConsistency] : message.readConsistency; - if (options.oneofs) - object.consistencyType = "readConsistency"; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) { - object.transaction = options.bytes === String ? $util.base64.encode(message.transaction, 0, message.transaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.transaction) : message.transaction; - if (options.oneofs) - object.consistencyType = "transaction"; - } - if (message.readTime != null && message.hasOwnProperty("readTime")) { - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - if (options.oneofs) - object.consistencyType = "readTime"; - } - return object; - }; - - /** - * Converts this ReadOptions to JSON. - * @function toJSON - * @memberof google.datastore.v1.ReadOptions - * @instance - * @returns {Object.} JSON object - */ - ReadOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReadOptions - * @function getTypeUrl - * @memberof google.datastore.v1.ReadOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.ReadOptions"; - }; - - /** - * ReadConsistency enum. - * @name google.datastore.v1.ReadOptions.ReadConsistency - * @enum {number} - * @property {number} READ_CONSISTENCY_UNSPECIFIED=0 READ_CONSISTENCY_UNSPECIFIED value - * @property {number} STRONG=1 STRONG value - * @property {number} EVENTUAL=2 EVENTUAL value - */ - ReadOptions.ReadConsistency = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "READ_CONSISTENCY_UNSPECIFIED"] = 0; - values[valuesById[1] = "STRONG"] = 1; - values[valuesById[2] = "EVENTUAL"] = 2; - return values; - })(); - - return ReadOptions; - })(); - - v1.TransactionOptions = (function() { - - /** - * Properties of a TransactionOptions. - * @memberof google.datastore.v1 - * @interface ITransactionOptions - * @property {google.datastore.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite - * @property {google.datastore.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly - */ - - /** - * Constructs a new TransactionOptions. - * @memberof google.datastore.v1 - * @classdesc Represents a TransactionOptions. - * @implements ITransactionOptions - * @constructor - * @param {google.datastore.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.datastore.v1.TransactionOptions.IReadWrite|null|undefined} readWrite - * @memberof google.datastore.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readWrite = null; - - /** - * TransactionOptions readOnly. - * @member {google.datastore.v1.TransactionOptions.IReadOnly|null|undefined} readOnly - * @memberof google.datastore.v1.TransactionOptions - * @instance - */ - TransactionOptions.prototype.readOnly = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TransactionOptions mode. - * @member {"readWrite"|"readOnly"|undefined} mode - * @memberof google.datastore.v1.TransactionOptions - * @instance - */ - Object.defineProperty(TransactionOptions.prototype, "mode", { - get: $util.oneOfGetter($oneOfFields = ["readWrite", "readOnly"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TransactionOptions instance using the specified properties. - * @function create - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.v1.ITransactionOptions=} [properties] Properties to set - * @returns {google.datastore.v1.TransactionOptions} TransactionOptions instance - */ - TransactionOptions.create = function create(properties) { - return new TransactionOptions(properties); - }; - - /** - * Encodes the specified TransactionOptions message. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TransactionOptions message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.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.datastore.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32()); - break; - } - case 2: { - message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32()); - 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.datastore.v1.TransactionOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadWrite.verify(message.readWrite); - if (error) - return "readWrite." + error; - } - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - if (properties.mode === 1) - return "mode: multiple values"; - properties.mode = 1; - { - var error = $root.google.datastore.v1.TransactionOptions.ReadOnly.verify(message.readOnly); - if (error) - return "readOnly." + error; - } - } - return null; - }; - - /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.TransactionOptions} TransactionOptions - */ - TransactionOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.TransactionOptions) - return object; - var message = new $root.google.datastore.v1.TransactionOptions(); - if (object.readWrite != null) { - if (typeof object.readWrite !== "object") - throw TypeError(".google.datastore.v1.TransactionOptions.readWrite: object expected"); - message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.fromObject(object.readWrite); - } - if (object.readOnly != null) { - if (typeof object.readOnly !== "object") - throw TypeError(".google.datastore.v1.TransactionOptions.readOnly: object expected"); - message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly); - } - return message; - }; - - /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.TransactionOptions - * @static - * @param {google.datastore.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 (message.readWrite != null && message.hasOwnProperty("readWrite")) { - object.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options); - if (options.oneofs) - object.mode = "readWrite"; - } - if (message.readOnly != null && message.hasOwnProperty("readOnly")) { - object.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.toObject(message.readOnly, options); - if (options.oneofs) - object.mode = "readOnly"; - } - return object; - }; - - /** - * Converts this TransactionOptions to JSON. - * @function toJSON - * @memberof google.datastore.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.datastore.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.datastore.v1.TransactionOptions"; - }; - - TransactionOptions.ReadWrite = (function() { - - /** - * Properties of a ReadWrite. - * @memberof google.datastore.v1.TransactionOptions - * @interface IReadWrite - * @property {Uint8Array|null} [previousTransaction] ReadWrite previousTransaction - */ - - /** - * Constructs a new ReadWrite. - * @memberof google.datastore.v1.TransactionOptions - * @classdesc Represents a ReadWrite. - * @implements IReadWrite - * @constructor - * @param {google.datastore.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 previousTransaction. - * @member {Uint8Array} previousTransaction - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @instance - */ - ReadWrite.prototype.previousTransaction = $util.newBuffer([]); - - /** - * Creates a new ReadWrite instance using the specified properties. - * @function create - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.v1.TransactionOptions.IReadWrite=} [properties] Properties to set - * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite instance - */ - ReadWrite.create = function create(properties) { - return new ReadWrite(properties); - }; - - /** - * Encodes the specified ReadWrite message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.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.previousTransaction != null && Object.hasOwnProperty.call(message, "previousTransaction")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.previousTransaction); - return writer; - }; - - /** - * Encodes the specified ReadWrite message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadWrite.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.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.datastore.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.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.previousTransaction = 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.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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.datastore.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.previousTransaction != null && message.hasOwnProperty("previousTransaction")) - if (!(message.previousTransaction && typeof message.previousTransaction.length === "number" || $util.isString(message.previousTransaction))) - return "previousTransaction: buffer expected"; - return null; - }; - - /** - * Creates a ReadWrite message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.TransactionOptions.ReadWrite} ReadWrite - */ - ReadWrite.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadWrite) - return object; - var message = new $root.google.datastore.v1.TransactionOptions.ReadWrite(); - if (object.previousTransaction != null) - if (typeof object.previousTransaction === "string") - $util.base64.decode(object.previousTransaction, message.previousTransaction = $util.newBuffer($util.base64.length(object.previousTransaction)), 0); - else if (object.previousTransaction.length >= 0) - message.previousTransaction = object.previousTransaction; - return message; - }; - - /** - * Creates a plain object from a ReadWrite message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.TransactionOptions.ReadWrite - * @static - * @param {google.datastore.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) - if (options.bytes === String) - object.previousTransaction = ""; - else { - object.previousTransaction = []; - if (options.bytes !== Array) - object.previousTransaction = $util.newBuffer(object.previousTransaction); - } - if (message.previousTransaction != null && message.hasOwnProperty("previousTransaction")) - object.previousTransaction = options.bytes === String ? $util.base64.encode(message.previousTransaction, 0, message.previousTransaction.length) : options.bytes === Array ? Array.prototype.slice.call(message.previousTransaction) : message.previousTransaction; - return object; - }; - - /** - * Converts this ReadWrite to JSON. - * @function toJSON - * @memberof google.datastore.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.datastore.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.datastore.v1.TransactionOptions.ReadWrite"; - }; - - return ReadWrite; - })(); - - TransactionOptions.ReadOnly = (function() { - - /** - * Properties of a ReadOnly. - * @memberof google.datastore.v1.TransactionOptions - * @interface IReadOnly - * @property {google.protobuf.ITimestamp|null} [readTime] ReadOnly readTime - */ - - /** - * Constructs a new ReadOnly. - * @memberof google.datastore.v1.TransactionOptions - * @classdesc Represents a ReadOnly. - * @implements IReadOnly - * @constructor - * @param {google.datastore.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 readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @instance - */ - ReadOnly.prototype.readTime = null; - - /** - * Creates a new ReadOnly instance using the specified properties. - * @function create - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.v1.TransactionOptions.IReadOnly=} [properties] Properties to set - * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly instance - */ - ReadOnly.create = function create(properties) { - return new ReadOnly(properties); - }; - - /** - * Encodes the specified ReadOnly message. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.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.readTime != null && Object.hasOwnProperty.call(message, "readTime")) - $root.google.protobuf.Timestamp.encode(message.readTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReadOnly message, length delimited. Does not implicitly {@link google.datastore.v1.TransactionOptions.ReadOnly.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {google.datastore.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(); - }; + AggregationResultBatch.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.datastore.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.datastore.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) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes an AggregationResultBatch message from the specified reader or buffer. + * @function decode + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResultBatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationResultBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.aggregationResults && message.aggregationResults.length)) + message.aggregationResults = []; + message.aggregationResults.push($root.google.datastore.v1.AggregationResult.decode(reader, reader.uint32())); break; } + case 2: { + message.moreResults = reader.int32(); + break; + } + case 3: { + message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Decodes a ReadOnly message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.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()); - }; + /** + * Decodes an AggregationResultBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AggregationResultBatch.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.datastore.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"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime); + /** + * Verifies an AggregationResultBatch message. + * @function verify + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AggregationResultBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.aggregationResults != null && message.hasOwnProperty("aggregationResults")) { + if (!Array.isArray(message.aggregationResults)) + return "aggregationResults: array expected"; + for (var i = 0; i < message.aggregationResults.length; ++i) { + var error = $root.google.datastore.v1.AggregationResult.verify(message.aggregationResults[i]); if (error) - return "readTime." + error; + return "aggregationResults." + error; } - return null; - }; + } + if (message.moreResults != null && message.hasOwnProperty("moreResults")) + switch (message.moreResults) { + default: + return "moreResults: enum value expected"; + case 0: + case 1: + case 2: + case 4: + case 3: + break; + } + if (message.readTime != null && message.hasOwnProperty("readTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.readTime); + if (error) + return "readTime." + error; + } + return null; + }; - /** - * Creates a ReadOnly message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.TransactionOptions.ReadOnly} ReadOnly - */ - ReadOnly.fromObject = function fromObject(object) { - if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadOnly) - return object; - var message = new $root.google.datastore.v1.TransactionOptions.ReadOnly(); - if (object.readTime != null) { - if (typeof object.readTime !== "object") - throw TypeError(".google.datastore.v1.TransactionOptions.ReadOnly.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + /** + * Creates an AggregationResultBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.datastore.v1.AggregationResultBatch + * @static + * @param {Object.} object Plain object + * @returns {google.datastore.v1.AggregationResultBatch} AggregationResultBatch + */ + AggregationResultBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.datastore.v1.AggregationResultBatch) + return object; + var message = new $root.google.datastore.v1.AggregationResultBatch(); + if (object.aggregationResults) { + if (!Array.isArray(object.aggregationResults)) + throw TypeError(".google.datastore.v1.AggregationResultBatch.aggregationResults: array expected"); + message.aggregationResults = []; + for (var i = 0; i < object.aggregationResults.length; ++i) { + if (typeof object.aggregationResults[i] !== "object") + throw TypeError(".google.datastore.v1.AggregationResultBatch.aggregationResults: object expected"); + message.aggregationResults[i] = $root.google.datastore.v1.AggregationResult.fromObject(object.aggregationResults[i]); } - return message; - }; + } + switch (object.moreResults) { + case "MORE_RESULTS_TYPE_UNSPECIFIED": + case 0: + message.moreResults = 0; + break; + case "NOT_FINISHED": + case 1: + message.moreResults = 1; + break; + case "MORE_RESULTS_AFTER_LIMIT": + case 2: + message.moreResults = 2; + break; + case "MORE_RESULTS_AFTER_CURSOR": + case 4: + message.moreResults = 4; + break; + case "NO_MORE_RESULTS": + case 3: + message.moreResults = 3; + break; + } + if (object.readTime != null) { + if (typeof object.readTime !== "object") + throw TypeError(".google.datastore.v1.AggregationResultBatch.readTime: object expected"); + message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime); + } + return message; + }; /** * Creates a plain object from an AggregationResultBatch message. Also converts values to other types if specified. @@ -11504,12 +8266,6 @@ return object; var message = new $root.google.datastore.v1.Value(); switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; case "NULL_VALUE": case 0: message.nullValue = 0; @@ -11628,7 +8384,7 @@ object.valueType = "timestampValue"; } 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; + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; if (options.oneofs) object.valueType = "nullValue"; } @@ -14304,12 +11060,6 @@ message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); } switch (object.direction) { - default: - if (typeof object.direction === "number") { - message.direction = object.direction; - break; - } - break; case "DIRECTION_UNSPECIFIED": case 0: message.direction = 0; @@ -14346,7 +11096,7 @@ if (message.property != null && message.hasOwnProperty("property")) object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); if (message.direction != null && message.hasOwnProperty("direction")) - object.direction = options.enums === String ? $root.google.datastore.v1.PropertyOrder.Direction[message.direction] === undefined ? message.direction : $root.google.datastore.v1.PropertyOrder.Direction[message.direction] : message.direction; + object.direction = options.enums === String ? $root.google.datastore.v1.PropertyOrder.Direction[message.direction] : message.direction; return object; }; @@ -14840,12 +11590,6 @@ return object; var message = new $root.google.datastore.v1.CompositeFilter(); switch (object.op) { - default: - if (typeof object.op === "number") { - message.op = object.op; - break; - } - break; case "OPERATOR_UNSPECIFIED": case 0: message.op = 0; @@ -14886,7 +11630,7 @@ if (options.defaults) object.op = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; if (message.op != null && message.hasOwnProperty("op")) - object.op = options.enums === String ? $root.google.datastore.v1.CompositeFilter.Operator[message.op] === undefined ? message.op : $root.google.datastore.v1.CompositeFilter.Operator[message.op] : message.op; + object.op = options.enums === String ? $root.google.datastore.v1.CompositeFilter.Operator[message.op] : message.op; if (message.filters && message.filters.length) { object.filters = []; for (var j = 0; j < message.filters.length; ++j) @@ -15146,12 +11890,6 @@ message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property); } switch (object.op) { - default: - if (typeof object.op === "number") { - message.op = object.op; - break; - } - break; case "OPERATOR_UNSPECIFIED": case 0: message.op = 0; @@ -15222,7 +11960,7 @@ if (message.property != null && message.hasOwnProperty("property")) object.property = $root.google.datastore.v1.PropertyReference.toObject(message.property, options); if (message.op != null && message.hasOwnProperty("op")) - object.op = options.enums === String ? $root.google.datastore.v1.PropertyFilter.Operator[message.op] === undefined ? message.op : $root.google.datastore.v1.PropertyFilter.Operator[message.op] : message.op; + object.op = options.enums === String ? $root.google.datastore.v1.PropertyFilter.Operator[message.op] : message.op; if (message.value != null && message.hasOwnProperty("value")) object.value = $root.google.datastore.v1.Value.toObject(message.value, options); return object; @@ -16194,12 +12932,6 @@ else if (object.skippedCursor.length >= 0) message.skippedCursor = object.skippedCursor; switch (object.entityResultType) { - default: - if (typeof object.entityResultType === "number") { - message.entityResultType = object.entityResultType; - break; - } - break; case "RESULT_TYPE_UNSPECIFIED": case 0: message.entityResultType = 0; @@ -16233,12 +12965,6 @@ else if (object.endCursor.length >= 0) message.endCursor = object.endCursor; switch (object.moreResults) { - default: - if (typeof object.moreResults === "number") { - message.moreResults = object.moreResults; - break; - } - break; case "MORE_RESULTS_TYPE_UNSPECIFIED": case 0: message.moreResults = 0; @@ -16318,7 +13044,7 @@ object.readTime = null; } if (message.entityResultType != null && message.hasOwnProperty("entityResultType")) - object.entityResultType = options.enums === String ? $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] === undefined ? message.entityResultType : $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] : message.entityResultType; + object.entityResultType = options.enums === String ? $root.google.datastore.v1.EntityResult.ResultType[message.entityResultType] : message.entityResultType; if (message.entityResults && message.entityResults.length) { object.entityResults = []; for (var j = 0; j < message.entityResults.length; ++j) @@ -16329,7 +13055,7 @@ if (message.endCursor != null && message.hasOwnProperty("endCursor")) object.endCursor = options.bytes === String ? $util.base64.encode(message.endCursor, 0, message.endCursor.length) : options.bytes === Array ? Array.prototype.slice.call(message.endCursor) : message.endCursor; if (message.moreResults != null && message.hasOwnProperty("moreResults")) - object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] === undefined ? message.moreResults : $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; + object.moreResults = options.enums === String ? $root.google.datastore.v1.QueryResultBatch.MoreResultsType[message.moreResults] : message.moreResults; if (message.skippedResults != null && message.hasOwnProperty("skippedResults")) object.skippedResults = message.skippedResults; if (message.snapshotVersion != null && message.hasOwnProperty("snapshotVersion")) @@ -26273,12 +22999,6 @@ 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; @@ -26293,12 +23013,6 @@ break; } switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -26425,9 +23139,9 @@ if (message.number != null && message.hasOwnProperty("number")) object.number = message.number; if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; if (message.typeName != null && message.hasOwnProperty("typeName")) object.typeName = message.typeName; if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) @@ -28746,12 +25460,6 @@ 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; @@ -28848,7 +25556,7 @@ if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) object.javaOuterClassname = message.javaOuterClassname; if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) object.javaMultipleFiles = message.javaMultipleFiles; if (message.goPackage != null && message.hasOwnProperty("goPackage")) @@ -29597,12 +26305,6 @@ 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; @@ -29619,12 +26321,6 @@ 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; @@ -29663,10 +26359,6 @@ 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; @@ -29731,7 +26423,7 @@ object.unverifiedLazy = false; } 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; + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; if (message.packed != null && message.hasOwnProperty("packed")) object.packed = message.packed; if (message.deprecated != null && message.hasOwnProperty("deprecated")) @@ -29739,7 +26431,7 @@ if (message.lazy != null && message.hasOwnProperty("lazy")) object.lazy = message.lazy; if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; if (message.weak != null && message.hasOwnProperty("weak")) object.weak = message.weak; if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) @@ -29752,7 +26444,7 @@ 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]; + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; } return object; }; @@ -31127,12 +27819,6 @@ 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; @@ -31202,7 +27888,7 @@ if (message.deprecated != null && message.hasOwnProperty("deprecated")) object.deprecated = message.deprecated; if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; if (message.uninterpretedOption && message.uninterpretedOption.length) { object.uninterpretedOption = []; for (var j = 0; j < message.uninterpretedOption.length; ++j) @@ -32957,12 +29643,6 @@ 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; @@ -33012,7 +29692,7 @@ if (message.end != null && message.hasOwnProperty("end")) object.end = message.end; if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; return object; }; @@ -34489,12 +31169,6 @@ 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; @@ -34533,7 +31207,7 @@ 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; + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; if (options.oneofs) object.kind = "nullValue"; } From b13b5e9110a769cdab7bf3045193342487b838ea Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Thu, 20 Oct 2022 10:25:36 -0700 Subject: [PATCH 54/67] Update src/aggregate.ts Co-authored-by: Ruy Adorno --- src/aggregate.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index e0b99e237..1de0df21e 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -35,7 +35,9 @@ class AggregateQuery { } aggregate(aggregates: AggregateField[]): AggregateQuery { - aggregates.forEach(aggregate => this.aggregations.push(aggregate)); + for (const aggregate of aggregates) { + this.aggregations.push(aggregate); + } return this; } From 872675e2e1ea983b364566dfb2d5eb7001319530 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Thu, 20 Oct 2022 10:29:48 -0700 Subject: [PATCH 55/67] per reviewer --- src/aggregate.ts | 3 +++ src/index.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index 1de0df21e..cb3ab216c 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -41,6 +41,7 @@ class AggregateQuery { return this; } + // eslint-disable-next-line toProto(): any { return this.aggregations.map(aggregation => aggregation.toProto()); } @@ -58,10 +59,12 @@ abstract class AggregateField { return this; } + // eslint-disable-next-line abstract toProto(): any; } class Count extends AggregateField { + // eslint-disable-next-line toProto(): any { const count = Object.assign({}); return Object.assign({count}, this.alias_ ? {alias: this.alias_} : null); diff --git a/src/index.ts b/src/index.ts index e883e40cf..a737987ad 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,7 +64,7 @@ import { import {Transaction} from './transaction'; import {promisifyAll} from '@google-cloud/promisify'; import {google} from '../protos/protos'; -import {AggregateField, AggregateQuery} from './aggregate'; +import {AggregateQuery} from './aggregate'; const {grpc} = new GrpcClient(); From 2b08cb5f53a7da76d077c906a4f575cb2760c5c7 Mon Sep 17 00:00:00 2001 From: Kristen O'Leary Date: Tue, 22 Nov 2022 14:39:41 -0500 Subject: [PATCH 56/67] refactor and rename some methods --- src/aggregate.ts | 11 ++++++++--- src/index.ts | 5 ++--- src/request.ts | 8 ++++---- system-test/datastore.ts | 38 +++++++++++++++++++++++--------------- test/query.ts | 2 +- 5 files changed, 38 insertions(+), 26 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index cb3ab216c..e9b15f190 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -34,9 +34,14 @@ class AggregateQuery { return this; } - aggregate(aggregates: AggregateField[]): AggregateQuery { - for (const aggregate of aggregates) { - this.aggregations.push(aggregate); + addAggregation(aggregation: AggregateField): AggregateQuery { + this.aggregations.push(aggregation); + return this; + } + + addAggregations(aggregations: AggregateField[]): AggregateQuery { + for (const aggregation of aggregations) { + this.aggregations.push(aggregation); } return this; } diff --git a/src/index.ts b/src/index.ts index a737987ad..76fc27f2e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -510,8 +510,7 @@ class Datastore extends DatastoreRequest { this.auth = new GoogleAuth(this.options); } - // TODO: Change this to accept an array instead - aggregate_query(query: Query): AggregateQuery { + createAggregationQuery(query: Query): AggregateQuery { return new AggregateQuery(query); } @@ -1803,7 +1802,7 @@ class Datastore extends DatastoreRequest { */ promisifyAll(Datastore, { exclude: [ - 'aggregate', + 'createAggregationQuery', 'double', 'isDouble', 'geoPoint', diff --git a/src/request.ts b/src/request.ts index dea4cbf41..823b7f95a 100644 --- a/src/request.ts +++ b/src/request.ts @@ -567,17 +567,17 @@ class DatastoreRequest { } // TODO Change RunQueryOptions, RunQueryCallback, RunQueryResponse to right interface - runAggregateQuery( + runAggregationQuery( query: AggregateQuery, options?: RunQueryOptions ): Promise; - runAggregateQuery( + runAggregationQuery( query: AggregateQuery, options: RunQueryOptions, callback: RequestCallback ): void; - runAggregateQuery(query: AggregateQuery, callback: RequestCallback): void; - runAggregateQuery( + runAggregationQuery(query: AggregateQuery, callback: RequestCallback): void; + runAggregationQuery( query: AggregateQuery, optionsOrCallback?: RunQueryOptions | RequestCallback, cb?: RequestCallback diff --git a/system-test/datastore.ts b/system-test/datastore.ts index cd3a261c5..4ebef8f2b 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -15,12 +15,12 @@ import * as assert from 'assert'; import {readFileSync} from 'fs'; import * as path from 'path'; -import {before, after, describe, it} from 'mocha'; +import {after, before, describe, it} from 'mocha'; import * as yaml from 'js-yaml'; import {Datastore, Index} from '../src'; import {google} from '../protos/protos'; import {Storage} from '@google-cloud/storage'; -import {AggregateField, AggregateQuery} from '../src/aggregate'; +import {AggregateField} from '../src/aggregate'; describe('Datastore', () => { const testKinds: string[] = []; @@ -802,39 +802,47 @@ describe('Datastore', () => { it('should run a count aggregation', async () => { const q = datastore.createQuery('Character'); const aggregate = datastore - .aggregate_query(q) - .aggregate([AggregateField.count()]); - const [results] = await datastore.runAggregateQuery(aggregate); + .createAggregationQuery(q) + .addAggregation(AggregateField.count()); + const [results] = await datastore.runAggregationQuery(aggregate); assert.deepStrictEqual(results, [{property_1: 8}]); }); + it('should run a count aggregation with a list of aggregates', async () => { + const q = datastore.createQuery('Character'); + const aggregate = datastore + .createAggregationQuery(q) + .addAggregations([AggregateField.count(), AggregateField.count()]); + const [results] = await datastore.runAggregationQuery(aggregate); + assert.deepStrictEqual(results, [{property_1: 8, property_2: 8}]); + }); it('should run a count aggregation having other filters', async () => { const q = datastore .createQuery('Character') .filter('family', 'Stark') .filter('appearances', '>=', 20); const aggregate = datastore - .aggregate_query(q) - .aggregate([AggregateField.count().alias('total')]); - const [results] = await datastore.runAggregateQuery(aggregate); + .createAggregationQuery(q) + .addAggregation(AggregateField.count().alias('total')); + const [results] = await datastore.runAggregationQuery(aggregate); assert.deepStrictEqual(results, [{total: 6}]); }); it('should run a count aggregate filter with an alias', async () => { const q = datastore.createQuery('Character'); const aggregate = datastore - .aggregate_query(q) - .aggregate([AggregateField.count().alias('total')]); - const [results] = await datastore.runAggregateQuery(aggregate); + .createAggregationQuery(q) + .addAggregation(AggregateField.count().alias('total')); + const [results] = await datastore.runAggregationQuery(aggregate); assert.deepStrictEqual(results, [{total: 8}]); }); - it('should do multiple count aggregations', async () => { + it('should do multiple count aggregations with aliases', async () => { const q = datastore.createQuery('Character'); const aggregate = datastore - .aggregate_query(q) - .aggregate([ + .createAggregationQuery(q) + .addAggregations([ AggregateField.count().alias('total'), AggregateField.count().alias('total2'), ]); - const [results] = await datastore.runAggregateQuery(aggregate); + const [results] = await datastore.runAggregationQuery(aggregate); assert.deepStrictEqual(results, [{total: 8, total2: 8}]); }); }); diff --git a/test/query.ts b/test/query.ts index 9477558da..8e1b7b107 100644 --- a/test/query.ts +++ b/test/query.ts @@ -61,7 +61,7 @@ describe('Query', () => { const query = new Query(['kind1']); const firstAggregation = AggregateField.count().alias('total'); const secondAggregation = AggregateField.count().alias('total2'); - const aggregate = new AggregateQuery(query).aggregate([ + const aggregate = new AggregateQuery(query).addAggregations([ firstAggregation, secondAggregation, ]); From 27d13651b59459ed1670f5947c658a30a313e41d Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 9 Jan 2023 10:30:51 -0500 Subject: [PATCH 57/67] Add run method to aggregate query --- src/aggregate.ts | 15 +++++++++++++++ src/index.ts | 5 +++++ src/transaction.ts | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/src/aggregate.ts b/src/aggregate.ts index e9b15f190..599c0e202 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -17,6 +17,8 @@ // ** All changes to this file may be overwritten. ** import {Query} from './index'; +import {RunQueryOptions, RunQueryResponse} from './query'; +import {RequestCallback} from './request'; const AGGREGATE_QUERY = Symbol('AGGREGATE_QUERY'); class AggregateQuery { @@ -46,6 +48,19 @@ class AggregateQuery { return this; } + run( + optionsOrCallback?: RunQueryOptions | RequestCallback, + cb?: RequestCallback + ): void | Promise { + const options = + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + const callback = + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + const scope = this.query!.scope; + const runAggregationQuery = scope!.runAggregationQuery.bind(scope); + return runAggregationQuery(this, options, callback); + } + // eslint-disable-next-line toProto(): any { return this.aggregations.map(aggregation => aggregation.toProto()); diff --git a/src/index.ts b/src/index.ts index 76fc27f2e..03b71735c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -510,6 +510,11 @@ class Datastore extends DatastoreRequest { this.auth = new GoogleAuth(this.options); } + /** + * Create an aggregation query from a Query. + * + * @param {Query} query A Query object. + */ createAggregationQuery(query: Query): AggregateQuery { return new AggregateQuery(query); } diff --git a/src/transaction.ts b/src/transaction.ts index 3e4b99505..d51867f5f 100644 --- a/src/transaction.ts +++ b/src/transaction.ts @@ -30,6 +30,7 @@ import { RequestOptions, PrepareEntityObjectResponse, } from './request'; +import {AggregateQuery} from './aggregate'; /** * A transaction is a set of Datastore operations on one or more entities. Each @@ -341,6 +342,15 @@ class Transaction extends DatastoreRequest { ); } + /** + * Create an aggregation query from the query specified. See {module:datastore/query} for all + * of the available methods. + * + */ + createAggregationQuery(query: Query): AggregateQuery { + return new AggregateQuery(query); + } + /** * Delete all entities identified with the specified key(s) in the current * transaction. From 450a519e2681c9a6997c262d84990a640eeae9e3 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 9 Jan 2023 13:18:25 -0500 Subject: [PATCH 58/67] test update and return value change --- src/transaction.ts | 7 +++++-- system-test/datastore.ts | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/transaction.ts b/src/transaction.ts index d51867f5f..ece9bd902 100644 --- a/src/transaction.ts +++ b/src/transaction.ts @@ -348,7 +348,10 @@ class Transaction extends DatastoreRequest { * */ createAggregationQuery(query: Query): AggregateQuery { - return new AggregateQuery(query); + return this.datastore.createAggregationQuery.call( + this, + query + ); } /** @@ -805,7 +808,7 @@ export interface RunOptions { * that a callback is omitted. */ promisifyAll(Transaction, { - exclude: ['createQuery', 'delete', 'insert', 'save', 'update', 'upsert'], + exclude: ['createAggregationQuery', 'createQuery', 'delete', 'insert', 'save', 'update', 'upsert'], }); /** diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 4ebef8f2b..955c4b913 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -1049,6 +1049,22 @@ describe('Datastore', () => { await transaction.commit(); }); + it('should aggregate query within a transaction', async () => { + const transaction = datastore.transaction(); + await transaction.run(); + const query = transaction.createQuery('Company'); + const aggregateQuery = transaction.createAggregationQuery(query).count('total'); + let result; + try { + result = await aggregateQuery.run(); + } catch (e) { + await transaction.rollback(); + return; + } + // assert(entities!.length > 0); + await transaction.commit(); + }); + it('should read in a readOnly transaction', async () => { const transaction = datastore.transaction({readOnly: true}); const key = datastore.key(['Company', 'Google']); From f9acad7a20f963646ee18b7a0e5df897095ea19a Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Mon, 9 Jan 2023 13:36:42 -0500 Subject: [PATCH 59/67] compare aggregate results --- system-test/datastore.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 955c4b913..2c919d84c 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -1056,12 +1056,12 @@ describe('Datastore', () => { const aggregateQuery = transaction.createAggregationQuery(query).count('total'); let result; try { - result = await aggregateQuery.run(); + [result] = await aggregateQuery.run(); } catch (e) { await transaction.rollback(); return; } - // assert(entities!.length > 0); + assert.deepStrictEqual(result, [{'total': 2}]); await transaction.commit(); }); From 25e3b95143f6f469f23db5f97bc69cad66b779b4 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 10 Jan 2023 14:29:20 -0500 Subject: [PATCH 60/67] createAggregationQuery --- test/transaction.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/transaction.ts b/test/transaction.ts index 41e62be1d..71cb4bf71 100644 --- a/test/transaction.ts +++ b/test/transaction.ts @@ -39,6 +39,7 @@ const fakePfy = Object.assign({}, pfy, { } promisified = true; assert.deepStrictEqual(options.exclude, [ + 'createAggregationQuery', 'createQuery', 'delete', 'insert', From 5707db9c3cf34aeb4e92df2919c233c47f2fc673 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 10 Jan 2023 15:06:03 -0500 Subject: [PATCH 61/67] linter and header fix --- src/aggregate.ts | 10 +++++----- src/transaction.ts | 15 ++++++++++----- system-test/datastore.ts | 6 ++++-- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index 599c0e202..e76fb3b99 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -49,13 +49,13 @@ class AggregateQuery { } run( - optionsOrCallback?: RunQueryOptions | RequestCallback, - cb?: RequestCallback + optionsOrCallback?: RunQueryOptions | RequestCallback, + cb?: RequestCallback ): void | Promise { const options = - typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; + typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; const callback = - typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; + typeof optionsOrCallback === 'function' ? optionsOrCallback : cb!; const scope = this.query!.scope; const runAggregationQuery = scope!.runAggregationQuery.bind(scope); return runAggregationQuery(this, options, callback); diff --git a/src/transaction.ts b/src/transaction.ts index ece9bd902..6e2a5aea8 100644 --- a/src/transaction.ts +++ b/src/transaction.ts @@ -348,10 +348,7 @@ class Transaction extends DatastoreRequest { * */ createAggregationQuery(query: Query): AggregateQuery { - return this.datastore.createAggregationQuery.call( - this, - query - ); + return this.datastore.createAggregationQuery.call(this, query); } /** @@ -808,7 +805,15 @@ export interface RunOptions { * that a callback is omitted. */ promisifyAll(Transaction, { - exclude: ['createAggregationQuery', 'createQuery', 'delete', 'insert', 'save', 'update', 'upsert'], + exclude: [ + 'createAggregationQuery', + 'createQuery', + 'delete', + 'insert', + 'save', + 'update', + 'upsert', + ], }); /** diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 2c919d84c..8ff4f60e5 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -1053,7 +1053,9 @@ describe('Datastore', () => { const transaction = datastore.transaction(); await transaction.run(); const query = transaction.createQuery('Company'); - const aggregateQuery = transaction.createAggregationQuery(query).count('total'); + const aggregateQuery = transaction + .createAggregationQuery(query) + .count('total'); let result; try { [result] = await aggregateQuery.run(); @@ -1061,7 +1063,7 @@ describe('Datastore', () => { await transaction.rollback(); return; } - assert.deepStrictEqual(result, [{'total': 2}]); + assert.deepStrictEqual(result, [{total: 2}]); await transaction.commit(); }); From 08749350841cc4a45356afc5da58242113bfb537 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 10 Jan 2023 15:23:46 -0500 Subject: [PATCH 62/67] TODOs --- src/request.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/request.ts b/src/request.ts index 823b7f95a..35c50f09f 100644 --- a/src/request.ts +++ b/src/request.ts @@ -566,7 +566,6 @@ class DatastoreRequest { ); } - // TODO Change RunQueryOptions, RunQueryCallback, RunQueryResponse to right interface runAggregationQuery( query: AggregateQuery, options?: RunQueryOptions @@ -582,7 +581,6 @@ class DatastoreRequest { optionsOrCallback?: RunQueryOptions | RequestCallback, cb?: RequestCallback ): void | Promise { - // TODO: Check that the query was provided in `over`. const options = typeof optionsOrCallback === 'object' ? optionsOrCallback : {}; const callback = From 4af78aaf9aab6217466289be91f7a687ceb35698 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 10 Jan 2023 20:36:23 +0000 Subject: [PATCH 63/67] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-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 --- protos/protos.d.ts | 2 +- protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 827262b9d..e55f5da4a 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/protos/protos.js b/protos/protos.js index 27b7744e7..6751b3160 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From f8d771e96a554a1064f3301c449f855e8f1f6cc3 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Tue, 10 Jan 2023 17:00:43 -0500 Subject: [PATCH 64/67] Remove autogenerated comment --- src/aggregate.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/aggregate.ts b/src/aggregate.ts index e76fb3b99..8309a38ac 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -11,10 +11,6 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// -// ** 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 {Query} from './index'; import {RunQueryOptions, RunQueryResponse} from './query'; From 77f3e5972e10de55bd3fb0b42f545e48c7be18c3 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 11 Jan 2023 13:42:01 -0500 Subject: [PATCH 65/67] count aggregation with limit filter tests --- system-test/datastore.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/system-test/datastore.ts b/system-test/datastore.ts index 8ff4f60e5..fb00eee4c 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -845,6 +845,24 @@ describe('Datastore', () => { const [results] = await datastore.runAggregationQuery(aggregate); assert.deepStrictEqual(results, [{total: 8, total2: 8}]); }); + it('should run a count aggregation filter with a limit', async () => { + const q = datastore.createQuery('Character').limit(5); + const aggregate = datastore + .createAggregationQuery(q) + .addAggregation(AggregateField.count()); + const [results] = await datastore.runAggregationQuery(aggregate); + assert.deepStrictEqual(results, [{property_1: 5}]); + }); + it('should run a count aggregate filter with a limit and an alias', async () => { + const q = datastore.createQuery('Character').limit(7); + const aggregate = datastore + .createAggregationQuery(q) + .addAggregations([ + AggregateField.count().alias('total') + ]); + const [results] = await datastore.runAggregationQuery(aggregate); + assert.deepStrictEqual(results, [{total: 7}]); + }); }); it('should filter by ancestor', async () => { const q = datastore.createQuery('Character').hasAncestor(ancestor); From 088c8449343ec0e6066c06150aff5eaf77ebb918 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Wed, 11 Jan 2023 13:47:25 -0500 Subject: [PATCH 66/67] lint fix --- system-test/datastore.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/system-test/datastore.ts b/system-test/datastore.ts index fb00eee4c..ae0a473ac 100644 --- a/system-test/datastore.ts +++ b/system-test/datastore.ts @@ -848,18 +848,16 @@ describe('Datastore', () => { it('should run a count aggregation filter with a limit', async () => { const q = datastore.createQuery('Character').limit(5); const aggregate = datastore - .createAggregationQuery(q) - .addAggregation(AggregateField.count()); + .createAggregationQuery(q) + .addAggregation(AggregateField.count()); const [results] = await datastore.runAggregationQuery(aggregate); assert.deepStrictEqual(results, [{property_1: 5}]); }); it('should run a count aggregate filter with a limit and an alias', async () => { const q = datastore.createQuery('Character').limit(7); const aggregate = datastore - .createAggregationQuery(q) - .addAggregations([ - AggregateField.count().alias('total') - ]); + .createAggregationQuery(q) + .addAggregations([AggregateField.count().alias('total')]); const [results] = await datastore.runAggregationQuery(aggregate); assert.deepStrictEqual(results, [{total: 7}]); }); From 6c23ccb398d08ed42dac871b284d8f6a75e10447 Mon Sep 17 00:00:00 2001 From: Daniel Bruce Date: Thu, 12 Jan 2023 15:10:32 -0500 Subject: [PATCH 67/67] Commented functions and classes --- src/aggregate.ts | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/aggregate.ts b/src/aggregate.ts index 8309a38ac..fbef6e3ab 100644 --- a/src/aggregate.ts +++ b/src/aggregate.ts @@ -17,26 +17,57 @@ import {RunQueryOptions, RunQueryResponse} from './query'; import {RequestCallback} from './request'; const AGGREGATE_QUERY = Symbol('AGGREGATE_QUERY'); +/** + * An AggregateQuery is a class that can be used to obtain results from an + * aggregate query request. + * + * @see {@link https://cloud.google.com/datastore/docs/aggregation-queries| Aggregation queries Reference} + * + * @class + */ class AggregateQuery { type = AGGREGATE_QUERY; aggregations: Array; query: Query | undefined; + /** + * Build an AggregateQuery object. + * + * @param {Query} query + */ constructor(query: Query) { this.query = query; this.aggregations = []; } + /** + * Add a `count` aggregate query to the list of aggregations. + * + * @param {string} alias + * @returns {AggregateQuery} + */ count(alias: string): AggregateQuery { this.aggregations.push(AggregateField.count().alias(alias)); return this; } + /** + * Add a custom aggregation to the list of aggregations. + * + * @param {AggregateField} aggregation + * @returns {AggregateQuery} + */ addAggregation(aggregation: AggregateField): AggregateQuery { this.aggregations.push(aggregation); return this; } + /** + * Add a list of custom aggregations to the list of aggregations. + * + * @param {AggregateField[]} aggregation + * @returns {AggregateQuery} + */ addAggregations(aggregations: AggregateField[]): AggregateQuery { for (const aggregation of aggregations) { this.aggregations.push(aggregation); @@ -44,6 +75,13 @@ class AggregateQuery { return this; } + /** + * Run the aggregation query and return the results. + * + * @param {RunQueryOptions | RequestCallback} [optionsOrCallback] + * @param {function} cb The callback function. + * @returns {void | Promise} + */ run( optionsOrCallback?: RunQueryOptions | RequestCallback, cb?: RequestCallback @@ -57,30 +95,62 @@ class AggregateQuery { return runAggregationQuery(this, options, callback); } + /** + * Get the proto for the list of aggregations. + * + */ // eslint-disable-next-line toProto(): any { return this.aggregations.map(aggregation => aggregation.toProto()); } } +/** + * An AggregateField is a class that contains data that defines an aggregation. + * + */ abstract class AggregateField { alias_?: string; + /** + * Gets a copy of the Count aggregate field. + * + * @returns {Count} + */ static count(): Count { return new Count(); } + /** + * Gets a copy of the Count aggregate field. + * + * @param {string} alias The label used in the results to describe this + * aggregate field when a query is run. + * @returns {AggregateField} + */ alias(alias: string): AggregateField { this.alias_ = alias; return this; } + /** + * Gets the proto for the aggregate field. + * + */ // eslint-disable-next-line abstract toProto(): any; } +/** + * A Count is a class that contains data that defines a Count aggregation. + * + */ class Count extends AggregateField { // eslint-disable-next-line + /** + * Gets the proto for the count aggregate field. + * + */ toProto(): any { const count = Object.assign({}); return Object.assign({count}, this.alias_ ? {alias: this.alias_} : null);