diff --git a/handwritten/datastore/.OwlBot.yaml b/handwritten/datastore/.OwlBot.yaml deleted file mode 100644 index 7ed9b7b5cff3..000000000000 --- a/handwritten/datastore/.OwlBot.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -deep-copy-regex: - - source: /google/datastore/admin/google-datastore-admin-nodejs - dest: /owl-bot-staging/google-datastore-admin - -api-name: admin \ No newline at end of file diff --git a/handwritten/datastore/mock-server/datastore-server.ts b/handwritten/datastore/mock-server/datastore-server.ts index c2e1ee5f2d65..818d8801c7e2 100644 --- a/handwritten/datastore/mock-server/datastore-server.ts +++ b/handwritten/datastore/mock-server/datastore-server.ts @@ -12,10 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -const {dirname, resolve} = require('node:path'); +const {dirname, join, resolve} = require('node:path'); -const PROTO_PATH = __dirname + '/../protos/google/datastore/v1/datastore.proto'; -const DATASTORE_PROTOS = __dirname + '/../protos'; +const API_PATH = join(dirname(require.resolve('@google-cloud/datastore-api')), '..'); +const DATASTORE_PROTOS = join(API_PATH, 'protos'); + +const PROTO_PATH = join(DATASTORE_PROTOS, 'google/datastore/v1/datastore.proto'); const GAX_PROTOS_DIR = resolve( // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore diff --git a/handwritten/datastore/owlbot.py b/handwritten/datastore/owlbot.py deleted file mode 100644 index c3ff540fa70f..000000000000 --- a/handwritten/datastore/owlbot.py +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import synthtool as s -import synthtool.gcp as gcp -import synthtool.languages.node_mono_repo as node -import logging -from pathlib import Path -from synthtool import _tracked_paths -from synthtool import shell -import shutil - -logging.basicConfig(level=logging.DEBUG) - -staging = Path("owl-bot-staging/datastore") - -if staging.is_dir(): - logging.info(f"Copying files from staging directory ${staging}.") - - # Copy the datastore library. - for version in ['v1']: - library = staging / version - _tracked_paths.add(library) - s.copy([library], destination="handwritten/datastore", excludes=[ - 'package.json', 'README.md', 'src/index.ts', 'src/v1/index.ts']) - - # Copy the admin library. - for version in ['v1']: - library = staging / 'admin' / version - _tracked_paths.add(library) - s.copy([library], destination="handwritten/datastore", excludes=[ - 'package.json', 'README.md', 'src/index.ts', 'src/v1/index.ts', 'tsconfig.json', 'tslint.json', - 'system-test/fixtures/sample/src/index.ts', 'system-test/fixtures/sample/src/index.js', - '.jsdoc.js', 'webpack.config.js']) - - # Patch the code. - system_test_files = ['handwritten/datastore/system-test/fixtures/sample/src/index.ts', 'handwritten/datastore/system-test/fixtures/sample/src/index.js'] - for file in system_test_files: - s.replace(file, 'DatastoreClient', 'Datastore') - s.replace(file, 'client.close', '// client.close'); # does not work with the manual layer - - # The staging directory should never be merged into the main branch. - shutil.rmtree(staging) - -common_templates = gcp.CommonTemplates() -templates = common_templates.node_mono_repo_library(relative_dir="handwritten/datastore", source_location="build/src") -s.copy(templates, destination="handwritten/datastore", excludes=["README.md"]) - -node.postprocess_gapic_library_hermetic(relative_dir="handwritten/datastore") diff --git a/handwritten/datastore/package.json b/handwritten/datastore/package.json index 6ba66386354c..64e6853b8669 100644 --- a/handwritten/datastore/package.json +++ b/handwritten/datastore/package.json @@ -28,13 +28,12 @@ ], "scripts": { "clean": "gts clean", - "compile": "tsc -p . && cp -r proto* build/ && cp -r system-test/data build/system-test", - "compile-protos": "compileProtos src", + "compile": "tsc -p . && cp -r protos build && cp -r system-test/data build/system-test", "docs": "jsdoc -c .jsdoc.js", "fix": "gts fix", "prelint": "cd samples; npm link ../; npm install", "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", + "prepare": "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", @@ -43,6 +42,7 @@ "precompile": "gts clean" }, "dependencies": { + "@google-cloud/datastore-api": "^0.2.0", "@google-cloud/promisify": "^5.0.0", "arrify": "^2.0.0", "async-mutex": "^0.5.0", diff --git a/handwritten/datastore/protos/google/cloud/common_resources.proto b/handwritten/datastore/protos/google/cloud/common_resources.proto deleted file mode 100644 index 56c9f800d5e3..000000000000 --- a/handwritten/datastore/protos/google/cloud/common_resources.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file contains stub messages for common resources in GCP. -// It is not intended to be directly generated, and is instead used by -// other tooling to be able to match common resource patterns. -syntax = "proto3"; - -package google.cloud; - -import "google/api/resource.proto"; - - -option (google.api.resource_definition) = { - type: "cloudresourcemanager.googleapis.com/Project" - pattern: "projects/{project}" -}; - - -option (google.api.resource_definition) = { - type: "cloudresourcemanager.googleapis.com/Organization" - pattern: "organizations/{organization}" -}; - - -option (google.api.resource_definition) = { - type: "cloudresourcemanager.googleapis.com/Folder" - pattern: "folders/{folder}" -}; - - -option (google.api.resource_definition) = { - type: "cloudbilling.googleapis.com/BillingAccount" - pattern: "billingAccounts/{billing_account}" -}; - -option (google.api.resource_definition) = { - type: "locations.googleapis.com/Location" - pattern: "projects/{project}/locations/{location}" -}; - diff --git a/handwritten/datastore/protos/google/datastore/admin/v1/datastore_admin.proto b/handwritten/datastore/protos/google/datastore/admin/v1/datastore_admin.proto deleted file mode 100644 index 50c4d0cc87e3..000000000000 --- a/handwritten/datastore/protos/google/datastore/admin/v1/datastore_admin.proto +++ /dev/null @@ -1,506 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.datastore.admin.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/datastore/admin/v1/index.proto"; -import "google/datastore/admin/v1/migration.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Datastore.Admin.V1"; -option go_package = "cloud.google.com/go/datastore/admin/apiv1/adminpb;adminpb"; -option java_multiple_files = true; -option java_outer_classname = "DatastoreAdminProto"; -option java_package = "com.google.datastore.admin.v1"; -option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1"; -option ruby_package = "Google::Cloud::Datastore::Admin::V1"; - -// Google Cloud Datastore Admin API -// -// The Datastore Admin API provides several admin services for Cloud Datastore. -// -// Concepts: Project, namespace, kind, and entity as defined in the Google Cloud -// Datastore API. -// -// Operation: An Operation represents work being performed in the background. -// -// EntityFilter: Allows specifying a subset of entities in a project. This is -// specified as a combination of kinds and namespaces (either or both of which -// may be all). -// -// Export/Import Service: -// -// - The Export/Import service provides the ability to copy all or a subset of -// entities to/from Google Cloud Storage. -// - Exported data may be imported into Cloud Datastore for any Google Cloud -// Platform project. It is not restricted to the export source project. It is -// possible to export from one project and then import into another. -// - Exported data can also be loaded into Google BigQuery for analysis. -// - Exports and imports are performed asynchronously. An Operation resource is -// created for each export/import. The state (including any errors encountered) -// of the export/import may be queried via the Operation resource. -// -// Index Service: -// -// - The index service manages Cloud Datastore composite indexes. -// - Index creation and deletion are performed asynchronously. -// An Operation resource is created for each such asynchronous operation. -// The state of the operation (including any errors encountered) -// may be queried via the Operation resource. -// -// Operation Service: -// -// - The Operations collection provides a record of actions performed for the -// specified project (including any operations in progress). Operations are not -// created directly but through calls on other collections or resources. -// - An operation that is not yet done may be cancelled. The request to cancel -// is asynchronous and the operation may continue to run for some time after the -// request to cancel is made. -// - An operation that is done may be deleted so that it is no longer listed as -// part of the Operation collection. -// - ListOperations returns all pending operations, but not completed -// operations. -// - Operations are created by service DatastoreAdmin, but are accessed via -// service google.longrunning.Operations. -service DatastoreAdmin { - option (google.api.default_host) = "datastore.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/datastore"; - - // Exports a copy of all or a subset of entities from Google Cloud Datastore - // to another storage system, such as Google Cloud Storage. Recent updates to - // entities may not be reflected in the export. The export occurs in the - // background and its progress can be monitored and managed via the - // Operation resource that is created. The output of an export may only be - // used once the associated operation is done. If an export operation is - // cancelled before completion it may leave partial data behind in Google - // Cloud Storage. - rpc ExportEntities(ExportEntitiesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:export" - body: "*" - }; - option (google.api.method_signature) = - "project_id,labels,entity_filter,output_url_prefix"; - option (google.longrunning.operation_info) = { - response_type: "ExportEntitiesResponse" - metadata_type: "ExportEntitiesMetadata" - }; - } - - // Imports entities into Google Cloud Datastore. Existing entities with the - // same key are overwritten. The import occurs in the background and its - // progress can be monitored and managed via the Operation resource that is - // created. If an ImportEntities operation is cancelled, it is possible - // that a subset of the data has already been imported to Cloud Datastore. - rpc ImportEntities(ImportEntitiesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:import" - body: "*" - }; - option (google.api.method_signature) = - "project_id,labels,input_url,entity_filter"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "ImportEntitiesMetadata" - }; - } - - // Creates the specified index. - // A newly created index's initial state is `CREATING`. On completion of the - // returned [google.longrunning.Operation][google.longrunning.Operation], the - // state will be `READY`. If the index already exists, the call will return an - // `ALREADY_EXISTS` status. - // - // During index creation, the process could result in an error, in which - // case the index will move to the `ERROR` state. The process can be recovered - // by fixing the data that caused the error, removing the index with - // [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex], then - // re-creating the index with [create] - // [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. - // - // Indexes with a single property cannot be created. - rpc CreateIndex(CreateIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/projects/{project_id}/indexes" - body: "index" - }; - option (google.longrunning.operation_info) = { - response_type: "Index" - metadata_type: "IndexOperationMetadata" - }; - } - - // Deletes an existing index. - // An index can only be deleted if it is in a `READY` or `ERROR` state. On - // successful execution of the request, the index will be in a `DELETING` - // [state][google.datastore.admin.v1.Index.State]. And on completion of the - // returned [google.longrunning.Operation][google.longrunning.Operation], the - // index will be removed. - // - // During index deletion, the process could result in an error, in which - // case the index will move to the `ERROR` state. The process can be recovered - // by fixing the data that caused the error, followed by calling - // [delete][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex] again. - rpc DeleteIndex(DeleteIndexRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/projects/{project_id}/indexes/{index_id}" - }; - option (google.longrunning.operation_info) = { - response_type: "Index" - metadata_type: "IndexOperationMetadata" - }; - } - - // Gets an index. - rpc GetIndex(GetIndexRequest) returns (Index) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/indexes/{index_id}" - }; - } - - // Lists the indexes that match the specified filters. Datastore uses an - // eventually consistent query to fetch the list of indexes and may - // occasionally return stale results. - rpc ListIndexes(ListIndexesRequest) returns (ListIndexesResponse) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/indexes" - }; - } -} - -// Metadata common to all Datastore Admin operations. -message CommonMetadata { - // The various possible states for an ongoing Operation. - enum State { - // Unspecified. - STATE_UNSPECIFIED = 0; - - // Request is being prepared for processing. - INITIALIZING = 1; - - // Request is actively being processed. - PROCESSING = 2; - - // Request is in the process of being cancelled after user called - // google.longrunning.Operations.CancelOperation on the operation. - CANCELLING = 3; - - // Request has been processed and is in its finalization stage. - FINALIZING = 4; - - // Request has completed successfully. - SUCCESSFUL = 5; - - // Request has finished being processed, but encountered an error. - FAILED = 6; - - // Request has finished being cancelled after user called - // google.longrunning.Operations.CancelOperation. - CANCELLED = 7; - } - - // The time that work began on the operation. - google.protobuf.Timestamp start_time = 1; - - // The time the operation ended, either successfully or otherwise. - google.protobuf.Timestamp end_time = 2; - - // The type of the operation. Can be used as a filter in - // ListOperationsRequest. - OperationType operation_type = 3; - - // The client-assigned labels which were provided when the operation was - // created. May also include additional labels. - map labels = 4; - - // The current state of the Operation. - State state = 5; -} - -// Measures the progress of a particular metric. -message Progress { - // The amount of work that has been completed. Note that this may be greater - // than work_estimated. - int64 work_completed = 1; - - // An estimate of how much work needs to be performed. May be zero if the - // work estimate is unavailable. - int64 work_estimated = 2; -} - -// The request for -// [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities]. -message ExportEntitiesRequest { - // Required. Project ID against which to make the request. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Client-assigned labels. - map labels = 2; - - // Description of what data from the project is included in the export. - EntityFilter entity_filter = 3; - - // Required. Location for the export metadata and data files. - // - // The full resource URL of the external storage location. Currently, only - // Google Cloud Storage is supported. So output_url_prefix should be of the - // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the - // name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud - // Storage namespace path (this is not a Cloud Datastore namespace). For more - // information about Cloud Storage namespace paths, see - // [Object name - // considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - // - // The resulting files will be nested deeper than the specified URL prefix. - // The final output URL will be provided in the - // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - // field. That value should be used for subsequent ImportEntities operations. - // - // By nesting the data files deeper, the same Cloud Storage bucket can be used - // in multiple ExportEntities operations without conflict. - string output_url_prefix = 4 [(google.api.field_behavior) = REQUIRED]; -} - -// The request for -// [google.datastore.admin.v1.DatastoreAdmin.ImportEntities][google.datastore.admin.v1.DatastoreAdmin.ImportEntities]. -message ImportEntitiesRequest { - // Required. Project ID against which to make the request. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Client-assigned labels. - map labels = 2; - - // Required. The full resource URL of the external storage location. - // Currently, only Google Cloud Storage is supported. So input_url should be - // of the form: - // `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - // `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - // an optional Cloud Storage namespace path (this is not a Cloud Datastore - // namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - // by the ExportEntities operation. For more information about Cloud Storage - // namespace paths, see - // [Object name - // considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - // - // For more information, see - // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - string input_url = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optionally specify which kinds/namespaces are to be imported. If provided, - // the list must be a subset of the EntityFilter used in creating the export, - // otherwise a FAILED_PRECONDITION error will be returned. If no filter is - // specified then all entities from the export are imported. - EntityFilter entity_filter = 4; -} - -// The response for -// [google.datastore.admin.v1.DatastoreAdmin.ExportEntities][google.datastore.admin.v1.DatastoreAdmin.ExportEntities]. -message ExportEntitiesResponse { - // Location of the output metadata file. This can be used to begin an import - // into Cloud Datastore (this project or another project). See - // [google.datastore.admin.v1.ImportEntitiesRequest.input_url][google.datastore.admin.v1.ImportEntitiesRequest.input_url]. - // Only present if the operation completed successfully. - string output_url = 1; -} - -// Metadata for ExportEntities operations. -message ExportEntitiesMetadata { - // Metadata common to all Datastore Admin operations. - CommonMetadata common = 1; - - // An estimate of the number of entities processed. - Progress progress_entities = 2; - - // An estimate of the number of bytes processed. - Progress progress_bytes = 3; - - // Description of which entities are being exported. - EntityFilter entity_filter = 4; - - // Location for the export metadata and data files. This will be the same - // value as the - // [google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix][google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix] - // field. The final output location is provided in - // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url]. - string output_url_prefix = 5; -} - -// Metadata for ImportEntities operations. -message ImportEntitiesMetadata { - // Metadata common to all Datastore Admin operations. - CommonMetadata common = 1; - - // An estimate of the number of entities processed. - Progress progress_entities = 2; - - // An estimate of the number of bytes processed. - Progress progress_bytes = 3; - - // Description of which entities are being imported. - EntityFilter entity_filter = 4; - - // The location of the import metadata file. This will be the same value as - // the - // [google.datastore.admin.v1.ExportEntitiesResponse.output_url][google.datastore.admin.v1.ExportEntitiesResponse.output_url] - // field. - string input_url = 5; -} - -// Identifies a subset of entities in a project. This is specified as -// combinations of kinds and namespaces (either or both of which may be all, as -// described in the following examples). -// Example usage: -// -// Entire project: -// kinds=[], namespace_ids=[] -// -// Kinds Foo and Bar in all namespaces: -// kinds=['Foo', 'Bar'], namespace_ids=[] -// -// Kinds Foo and Bar only in the default namespace: -// kinds=['Foo', 'Bar'], namespace_ids=[''] -// -// Kinds Foo and Bar in both the default and Baz namespaces: -// kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz'] -// -// The entire Baz namespace: -// kinds=[], namespace_ids=['Baz'] -message EntityFilter { - // If empty, then this represents all kinds. - repeated string kinds = 1; - - // An empty list represents all namespaces. This is the preferred - // usage for projects that don't use namespaces. - // - // An empty string element represents the default namespace. This should be - // used if the project has data in non-default namespaces, but doesn't want to - // include them. - // Each namespace in this list must be unique. - repeated string namespace_ids = 2; -} - -// The request for -// [google.datastore.admin.v1.DatastoreAdmin.CreateIndex][google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. -message CreateIndexRequest { - // Project ID against which to make the request. - string project_id = 1; - - // The index to create. The name and state fields are output only and will be - // ignored. Single property indexes cannot be created or deleted. - Index index = 3; -} - -// The request for -// [google.datastore.admin.v1.DatastoreAdmin.DeleteIndex][google.datastore.admin.v1.DatastoreAdmin.DeleteIndex]. -message DeleteIndexRequest { - // Project ID against which to make the request. - string project_id = 1; - - // The resource ID of the index to delete. - string index_id = 3; -} - -// The request for -// [google.datastore.admin.v1.DatastoreAdmin.GetIndex][google.datastore.admin.v1.DatastoreAdmin.GetIndex]. -message GetIndexRequest { - // Project ID against which to make the request. - string project_id = 1; - - // The resource ID of the index to get. - string index_id = 3; -} - -// The request for -// [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes]. -message ListIndexesRequest { - // Project ID against which to make the request. - string project_id = 1; - - string filter = 3; - - // The maximum number of items to return. If zero, then all results will be - // returned. - int32 page_size = 4; - - // The next_page_token value returned from a previous List request, if any. - string page_token = 5; -} - -// The response for -// [google.datastore.admin.v1.DatastoreAdmin.ListIndexes][google.datastore.admin.v1.DatastoreAdmin.ListIndexes]. -message ListIndexesResponse { - // The indexes. - repeated Index indexes = 1; - - // The standard List next-page token. - string next_page_token = 2; -} - -// Metadata for Index operations. -message IndexOperationMetadata { - // Metadata common to all Datastore Admin operations. - CommonMetadata common = 1; - - // An estimate of the number of entities processed. - Progress progress_entities = 2; - - // The index resource ID that this operation is acting on. - string index_id = 3; -} - -// Metadata for Datastore to Firestore migration operations. -// -// The DatastoreFirestoreMigration operation is not started by the end-user via -// an explicit "creation" method. This is an intentional deviation from the LRO -// design pattern. -// -// This singleton resource can be accessed at: -// "projects/{project_id}/operations/datastore-firestore-migration" -message DatastoreFirestoreMigrationMetadata { - // The current state of migration from Cloud Datastore to Cloud Firestore in - // Datastore mode. - MigrationState migration_state = 1; - - // The current step of migration from Cloud Datastore to Cloud Firestore in - // Datastore mode. - MigrationStep migration_step = 2; -} - -// Operation types. -enum OperationType { - // Unspecified. - OPERATION_TYPE_UNSPECIFIED = 0; - - // ExportEntities. - EXPORT_ENTITIES = 1; - - // ImportEntities. - IMPORT_ENTITIES = 2; - - // CreateIndex. - CREATE_INDEX = 3; - - // DeleteIndex. - DELETE_INDEX = 4; -} diff --git a/handwritten/datastore/protos/google/datastore/admin/v1/index.proto b/handwritten/datastore/protos/google/datastore/admin/v1/index.proto deleted file mode 100644 index c907660568c6..000000000000 --- a/handwritten/datastore/protos/google/datastore/admin/v1/index.proto +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.datastore.admin.v1; - -import "google/api/field_behavior.proto"; - -option csharp_namespace = "Google.Cloud.Datastore.Admin.V1"; -option go_package = "cloud.google.com/go/datastore/admin/apiv1/adminpb;adminpb"; -option java_multiple_files = true; -option java_outer_classname = "IndexProto"; -option java_package = "com.google.datastore.admin.v1"; -option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1"; -option ruby_package = "Google::Cloud::Datastore::Admin::V1"; - -// Datastore composite index definition. -message Index { - // For an ordered index, specifies whether each of the entity's ancestors - // will be included. - enum AncestorMode { - // The ancestor mode is unspecified. - ANCESTOR_MODE_UNSPECIFIED = 0; - - // Do not include the entity's ancestors in the index. - NONE = 1; - - // Include all the entity's ancestors in the index. - ALL_ANCESTORS = 2; - } - - // The direction determines how a property is indexed. - enum Direction { - // The direction is unspecified. - DIRECTION_UNSPECIFIED = 0; - - // The property's values are indexed so as to support sequencing in - // ascending order and also query by <, >, <=, >=, and =. - ASCENDING = 1; - - // The property's values are indexed so as to support sequencing in - // descending order and also query by <, >, <=, >=, and =. - DESCENDING = 2; - } - - // A property of an index. - message IndexedProperty { - // Required. The property name to index. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The indexed property's direction. Must not be - // DIRECTION_UNSPECIFIED. - Direction direction = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // The possible set of states of an index. - enum State { - // The state is unspecified. - STATE_UNSPECIFIED = 0; - - // The index is being created, and cannot be used by queries. - // There is an active long-running operation for the index. - // The index is updated when writing an entity. - // Some index data may exist. - CREATING = 1; - - // The index is ready to be used. - // The index is updated when writing an entity. - // The index is fully populated from all stored entities it applies to. - READY = 2; - - // The index is being deleted, and cannot be used by queries. - // There is an active long-running operation for the index. - // The index is not updated when writing an entity. - // Some index data may exist. - DELETING = 3; - - // The index was being created or deleted, but something went wrong. - // The index cannot by used by queries. - // There is no active long-running operation for the index, - // and the most recently finished long-running operation failed. - // The index is not updated when writing an entity. - // Some index data may exist. - ERROR = 4; - } - - // Output only. Project ID. - string project_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The resource ID of the index. - string index_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The entity kind to which this index applies. - string kind = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The index's ancestor mode. Must not be - // ANCESTOR_MODE_UNSPECIFIED. - AncestorMode ancestor = 5 [(google.api.field_behavior) = REQUIRED]; - - // Required. An ordered sequence of property names and their index attributes. - // - // Requires: - // - // * A maximum of 100 properties. - repeated IndexedProperty properties = 6 - [(google.api.field_behavior) = REQUIRED]; - - // Output only. The state of the index. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/handwritten/datastore/protos/google/datastore/admin/v1/migration.proto b/handwritten/datastore/protos/google/datastore/admin/v1/migration.proto deleted file mode 100644 index 67ac1ab711d7..000000000000 --- a/handwritten/datastore/protos/google/datastore/admin/v1/migration.proto +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.datastore.admin.v1; - -option csharp_namespace = "Google.Cloud.Datastore.Admin.V1"; -option go_package = "cloud.google.com/go/datastore/admin/apiv1/adminpb;adminpb"; -option java_multiple_files = true; -option java_outer_classname = "MigrationProto"; -option java_package = "com.google.datastore.admin.v1"; -option php_namespace = "Google\\Cloud\\Datastore\\Admin\\V1"; -option ruby_package = "Google::Cloud::Datastore::Admin::V1"; - -// An event signifying a change in state of a [migration from Cloud Datastore to -// Cloud Firestore in Datastore -// mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore). -message MigrationStateEvent { - // The new state of the migration. - MigrationState state = 1; -} - -// An event signifying the start of a new step in a [migration from Cloud -// Datastore to Cloud Firestore in Datastore -// mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore). -message MigrationProgressEvent { - // Concurrency modes for transactions in Cloud Firestore. - enum ConcurrencyMode { - // Unspecified. - CONCURRENCY_MODE_UNSPECIFIED = 0; - - // Pessimistic concurrency. - PESSIMISTIC = 1; - - // Optimistic concurrency. - OPTIMISTIC = 2; - - // Optimistic concurrency with entity groups. - OPTIMISTIC_WITH_ENTITY_GROUPS = 3; - } - - // Details for the `PREPARE` step. - message PrepareStepDetails { - // The concurrency mode this database will use when it reaches the - // `REDIRECT_WRITES` step. - ConcurrencyMode concurrency_mode = 1; - } - - // Details for the `REDIRECT_WRITES` step. - message RedirectWritesStepDetails { - // Ths concurrency mode for this database. - ConcurrencyMode concurrency_mode = 1; - } - - // The step that is starting. - // - // An event with step set to `START` indicates that the migration - // has been reverted back to the initial pre-migration state. - MigrationStep step = 1; - - // Details about this step. - oneof step_details { - // Details for the `PREPARE` step. - PrepareStepDetails prepare_step_details = 2; - - // Details for the `REDIRECT_WRITES` step. - RedirectWritesStepDetails redirect_writes_step_details = 3; - } -} - -// States for a migration. -enum MigrationState { - // Unspecified. - MIGRATION_STATE_UNSPECIFIED = 0; - - // The migration is running. - RUNNING = 1; - - // The migration is paused. - PAUSED = 2; - - // The migration is complete. - COMPLETE = 3; -} - -// Steps in a migration. -enum MigrationStep { - // Unspecified. - MIGRATION_STEP_UNSPECIFIED = 0; - - // Pre-migration: the database is prepared for migration. - PREPARE = 6; - - // Start of migration. - START = 1; - - // Writes are applied synchronously to at least one replica. - APPLY_WRITES_SYNCHRONOUSLY = 7; - - // Data is copied to Cloud Firestore and then verified to match the data in - // Cloud Datastore. - COPY_AND_VERIFY = 2; - - // Eventually-consistent reads are redirected to Cloud Firestore. - REDIRECT_EVENTUALLY_CONSISTENT_READS = 3; - - // Strongly-consistent reads are redirected to Cloud Firestore. - REDIRECT_STRONGLY_CONSISTENT_READS = 4; - - // Writes are redirected to Cloud Firestore. - REDIRECT_WRITES = 5; -} diff --git a/handwritten/datastore/protos/google/datastore/v1/aggregation_result.proto b/handwritten/datastore/protos/google/datastore/v1/aggregation_result.proto deleted file mode 100644 index cd51f660c419..000000000000 --- a/handwritten/datastore/protos/google/datastore/v1/aggregation_result.proto +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.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 = "cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb"; -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/handwritten/datastore/protos/google/datastore/v1/datastore.proto b/handwritten/datastore/protos/google/datastore/v1/datastore.proto deleted file mode 100644 index c0a281b18797..000000000000 --- a/handwritten/datastore/protos/google/datastore/v1/datastore.proto +++ /dev/null @@ -1,810 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.datastore.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/routing.proto"; -import "google/datastore/v1/aggregation_result.proto"; -import "google/datastore/v1/entity.proto"; -import "google/datastore/v1/query.proto"; -import "google/datastore/v1/query_profile.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Datastore.V1"; -option go_package = "cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb"; -option java_multiple_files = true; -option java_outer_classname = "DatastoreProto"; -option java_package = "com.google.datastore.v1"; -option php_namespace = "Google\\Cloud\\Datastore\\V1"; -option ruby_package = "Google::Cloud::Datastore::V1"; - -// Each RPC normalizes the partition IDs of the keys in its input entities, -// and always returns entities with keys with normalized partition IDs. -// This applies to all keys and entities, including those in values, except keys -// with both an empty path and an empty or unset partition ID. Normalization of -// input keys sets the project ID (if not already set) to the project ID from -// the request. -// -service Datastore { - option (google.api.default_host) = "datastore.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/datastore"; - - // Looks up entities by key. - rpc Lookup(LookupRequest) returns (LookupResponse) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:lookup" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { field: "project_id" } - routing_parameters { field: "database_id" } - }; - option (google.api.method_signature) = "project_id,read_options,keys"; - } - - // Queries for entities. - rpc RunQuery(RunQueryRequest) returns (RunQueryResponse) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:runQuery" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { field: "project_id" } - routing_parameters { field: "database_id" } - }; - } - - // Runs an aggregation query. - rpc RunAggregationQuery(RunAggregationQueryRequest) - returns (RunAggregationQueryResponse) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:runAggregationQuery" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { field: "project_id" } - routing_parameters { field: "database_id" } - }; - } - - // Begins a new transaction. - rpc BeginTransaction(BeginTransactionRequest) - returns (BeginTransactionResponse) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:beginTransaction" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { field: "project_id" } - routing_parameters { field: "database_id" } - }; - option (google.api.method_signature) = "project_id"; - } - - // Commits a transaction, optionally creating, deleting or modifying some - // entities. - rpc Commit(CommitRequest) returns (CommitResponse) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:commit" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { field: "project_id" } - routing_parameters { field: "database_id" } - }; - option (google.api.method_signature) = - "project_id,mode,transaction,mutations"; - option (google.api.method_signature) = "project_id,mode,mutations"; - } - - // Rolls back a transaction. - rpc Rollback(RollbackRequest) returns (RollbackResponse) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:rollback" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { field: "project_id" } - routing_parameters { field: "database_id" } - }; - option (google.api.method_signature) = "project_id,transaction"; - } - - // Allocates IDs for the given keys, which is useful for referencing an entity - // before it is inserted. - rpc AllocateIds(AllocateIdsRequest) returns (AllocateIdsResponse) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:allocateIds" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { field: "project_id" } - routing_parameters { field: "database_id" } - }; - option (google.api.method_signature) = "project_id,keys"; - } - - // Prevents the supplied keys' IDs from being auto-allocated by Cloud - // Datastore. - rpc ReserveIds(ReserveIdsRequest) returns (ReserveIdsResponse) { - option (google.api.http) = { - post: "/v1/projects/{project_id}:reserveIds" - body: "*" - }; - option (google.api.routing) = { - routing_parameters { field: "project_id" } - routing_parameters { field: "database_id" } - }; - option (google.api.method_signature) = "project_id,keys"; - } -} - -// The request for [Datastore.Lookup][google.datastore.v1.Datastore.Lookup]. -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; - - // Required. Keys of entities to look up. - repeated Key keys = 3 [(google.api.field_behavior) = REQUIRED]; - - // The properties to return. Defaults to returning all properties. - // - // If this field is set and an entity has a property not referenced in the - // mask, it will be absent from [LookupResponse.found.entity.properties][]. - // - // The entity's key is always returned. - PropertyMask property_mask = 5; -} - -// The response for [Datastore.Lookup][google.datastore.v1.Datastore.Lookup]. -message LookupResponse { - // Entities found as `ResultType.FULL` entities. The order of results in this - // field is undefined and has no relation to the order of the keys in the - // input. - repeated EntityResult found = 1; - - // Entities not found as `ResultType.KEY_ONLY` entities. The order of results - // in this field is undefined and has no relation to the order of the keys - // in the input. - repeated EntityResult missing = 2; - - // A list of keys that were not looked up due to resource constraints. The - // order of results in this field is undefined and has no relation to the - // order of the keys in the input. - repeated Key deferred = 3; - - // The identifier of the transaction that was started as part of this Lookup - // request. - // - // Set only when - // [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - // was set in - // [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options]. - bytes transaction = 5; - - // The time at which these entities were read or found missing. - google.protobuf.Timestamp read_time = 7; -} - -// The request for [Datastore.RunQuery][google.datastore.v1.Datastore.RunQuery]. -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 - // 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. - Query query = 3; - - // The GQL query to run. This query must be a non-aggregation query. - GqlQuery gql_query = 7; - } - - // The properties to return. - // This field must not be set for a projection query. - // - // See - // [LookupRequest.property_mask][google.datastore.v1.LookupRequest.property_mask]. - PropertyMask property_mask = 10; - - // Optional. Explain options for the query. If set, additional query - // statistics will be returned. If not, only query results will be returned. - ExplainOptions explain_options = 12 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response for -// [Datastore.RunQuery][google.datastore.v1.Datastore.RunQuery]. -message RunQueryResponse { - // A batch of query results (always present). - QueryResultBatch batch = 1; - - // The parsed form of the `GqlQuery` from the request, if it was set. - Query query = 2; - - // The identifier of the transaction that was started as part of this - // RunQuery request. - // - // Set only when - // [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - // was set in - // [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options]. - bytes transaction = 5; - - // Query explain metrics. This is only present when the - // [RunQueryRequest.explain_options][google.datastore.v1.RunQueryRequest.explain_options] - // is provided, and it is sent only once with the last response in the stream. - ExplainMetrics explain_metrics = 9; -} - -// 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; - } - - // Optional. Explain options for the query. If set, additional query - // statistics will be returned. If not, only query results will be returned. - ExplainOptions explain_options = 11 [(google.api.field_behavior) = OPTIONAL]; -} - -// 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 identifier of the transaction that was started as part of this - // RunAggregationQuery request. - // - // Set only when - // [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] - // was set in - // [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options]. - bytes transaction = 5; - - // Query explain metrics. This is only present when the - // [RunAggregationQueryRequest.explain_options][google.datastore.v1.RunAggregationQueryRequest.explain_options] - // is provided, and it is sent only once with the last response in the stream. - ExplainMetrics explain_metrics = 9; -} - -// 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; -} - -// The response for -// [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. -message BeginTransactionResponse { - // The transaction identifier (always present). - bytes transaction = 1; -} - -// The request for [Datastore.Rollback][google.datastore.v1.Datastore.Rollback]. -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]; -} - -// The response for -// [Datastore.Rollback][google.datastore.v1.Datastore.Rollback]. (an empty -// message). -message RollbackResponse {} - -// The request for [Datastore.Commit][google.datastore.v1.Datastore.Commit]. -message CommitRequest { - // The modes available for commits. - enum Mode { - // Unspecified. This value must not be used. - MODE_UNSPECIFIED = 0; - - // Transactional: The mutations are either all applied, or none are applied. - // Learn about transactions - // [here](https://cloud.google.com/datastore/docs/concepts/transactions). - TRANSACTIONAL = 1; - - // Non-transactional: The mutations may not apply as all or none. - NON_TRANSACTIONAL = 2; - } - - // 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; - - // Must be set when mode is `TRANSACTIONAL`. - oneof transaction_selector { - // 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]. - bytes transaction = 1; - - // Options for beginning a new transaction for this request. - // The transaction is committed when the request completes. If specified, - // [TransactionOptions.mode][google.datastore.v1.TransactionOptions] must be - // [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite]. - TransactionOptions single_use_transaction = 10; - } - - // 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. - repeated Mutation mutations = 6; -} - -// The response for [Datastore.Commit][google.datastore.v1.Datastore.Commit]. -message CommitResponse { - // The result of performing the mutations. - // The i-th mutation result corresponds to the i-th mutation in the request. - repeated MutationResult mutation_results = 3; - - // The number of index entries updated during the commit, or zero if none were - // updated. - int32 index_updates = 4; - - // The transaction commit timestamp. Not set for non-transactional commits. - google.protobuf.Timestamp commit_time = 8; -} - -// The request for -// [Datastore.AllocateIds][google.datastore.v1.Datastore.AllocateIds]. -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]; -} - -// The response for -// [Datastore.AllocateIds][google.datastore.v1.Datastore.AllocateIds]. -message AllocateIdsResponse { - // The keys specified in the request (in the same order), each with - // its key path completed with a newly allocated ID. - repeated Key keys = 1; -} - -// The request for -// [Datastore.ReserveIds][google.datastore.v1.Datastore.ReserveIds]. -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. - string database_id = 9; - - // Required. A list of keys with complete key paths whose numeric IDs should - // not be auto-allocated. - repeated Key keys = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The response for -// [Datastore.ReserveIds][google.datastore.v1.Datastore.ReserveIds]. -message ReserveIdsResponse {} - -// A mutation to apply to an entity. -message Mutation { - // The possible ways to resolve a conflict detected in a mutation. - enum ConflictResolutionStrategy { - // Unspecified. Defaults to `SERVER_VALUE`. - STRATEGY_UNSPECIFIED = 0; - - // The server entity is kept. - SERVER_VALUE = 1; - - // The whole commit request fails. - FAIL = 3; - } - - // The mutation operation. - // - // For `insert`, `update`, and `upsert`: - // - The entity's key must not be reserved/read-only. - // - No property in the entity may have a reserved name, - // not even a property in an entity in a value. - // - No value in the entity may have meaning 18, - // not even a value in an entity in another value. - oneof operation { - // The entity to insert. The entity must not already exist. - // The entity key's final path element may be incomplete. - Entity insert = 4; - - // The entity to update. The entity must already exist. - // Must have a complete key path. - Entity update = 5; - - // The entity to upsert. The entity may or may not already exist. - // The entity key's final path element may be incomplete. - Entity upsert = 6; - - // The key of the entity to delete. The entity may or may not already exist. - // Must have a complete key path and must not be reserved/read-only. - Key delete = 7; - } - - // When set, the server will detect whether or not this mutation conflicts - // with the current version of the entity on the server. Conflicting mutations - // are not applied, and are marked as such in MutationResult. - oneof conflict_detection_strategy { - // The version of the entity that this mutation is being applied - // to. If this does not match the current version on the server, the - // mutation conflicts. - int64 base_version = 8; - - // The update time of the entity that this mutation is being applied - // to. If this does not match the current update time on the server, the - // mutation conflicts. - google.protobuf.Timestamp update_time = 11; - } - - // The strategy to use when a conflict is detected. Defaults to - // `SERVER_VALUE`. - // If this is set, then `conflict_detection_strategy` must also be set. - ConflictResolutionStrategy conflict_resolution_strategy = 10; - - // The properties to write in this mutation. - // None of the properties in the mask may have a reserved name, except for - // `__key__`. - // This field is ignored for `delete`. - // - // If the entity already exists, only properties referenced in the mask are - // updated, others are left untouched. - // Properties referenced in the mask but not in the entity are deleted. - PropertyMask property_mask = 9; - - // Optional. The transforms to perform on the entity. - // - // This field can be set only when the operation is `insert`, `update`, - // or `upsert`. If present, the transforms are be applied to the entity - // regardless of the property mask, in order, after the operation. - repeated PropertyTransform property_transforms = 12 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A transformation of an entity property. -message PropertyTransform { - // A value that is calculated by the server. - enum ServerValue { - // Unspecified. This value must not be used. - SERVER_VALUE_UNSPECIFIED = 0; - - // The time at which the server processed the request, with millisecond - // precision. If used on multiple properties (same or different entities) - // in a transaction, all the properties will get the same server timestamp. - REQUEST_TIME = 1; - } - - // Optional. The name of the property. - // - // Property paths (a list of property names separated by dots (`.`)) may be - // used to refer to properties inside entity values. For example `foo.bar` - // means the property `bar` inside the entity property `foo`. - // - // If a property name contains a dot `.` or a backlslash `\`, then that name - // must be escaped. - string property = 1 [(google.api.field_behavior) = OPTIONAL]; - - // The transformation to apply to the property. - oneof transform_type { - // Sets the property to the given server value. - ServerValue set_to_server_value = 2; - - // Adds the given value to the property's current value. - // - // This must be an integer or a double value. - // If the property is not an integer or double, or if the property does not - // yet exist, the transformation will set the property to the given value. - // If either of the given value or the current property value are doubles, - // both values will be interpreted as doubles. Double arithmetic and - // representation of double values follows IEEE 754 semantics. - // If there is positive/negative integer overflow, the property is resolved - // to the largest magnitude positive/negative integer. - Value increment = 3; - - // Sets the property to the maximum of its current value and the given - // value. - // - // This must be an integer or a double value. - // If the property is not an integer or double, or if the property does not - // yet exist, the transformation will set the property to the given value. - // If a maximum operation is applied where the property and the input value - // are of mixed types (that is - one is an integer and one is a double) - // the property takes on the type of the larger operand. If the operands are - // equivalent (e.g. 3 and 3.0), the property does not change. - // 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - // zero input value is always the stored value. - // The maximum of any numeric value x and NaN is NaN. - Value maximum = 4; - - // Sets the property to the minimum of its current value and the given - // value. - // - // This must be an integer or a double value. - // If the property is not an integer or double, or if the property does not - // yet exist, the transformation will set the property to the input value. - // If a minimum operation is applied where the property and the input value - // are of mixed types (that is - one is an integer and one is a double) - // the property takes on the type of the smaller operand. If the operands - // are equivalent (e.g. 3 and 3.0), the property does not change. 0, 0.0, - // and -0.0 are all zero. The minimum of a zero stored value and zero input - // value is always the stored value. The minimum of any numeric value x and - // NaN is NaN. - Value minimum = 5; - - // Appends the given elements in order if they are not already present in - // the current property value. - // If the property is not an array, or if the property does not yet exist, - // it is first set to the empty array. - // - // Equivalent numbers of different types (e.g. 3L and 3.0) are - // considered equal when checking if a value is missing. - // NaN is equal to NaN, and the null value is equal to the null value. - // If the input contains multiple equivalent values, only the first will - // be considered. - // - // The corresponding transform result will be the null value. - ArrayValue append_missing_elements = 6; - - // Removes all of the given elements from the array in the property. - // If the property is not an array, or if the property does not yet exist, - // it is set to the empty array. - // - // Equivalent numbers of different types (e.g. 3L and 3.0) are - // considered equal when deciding whether an element should be removed. - // NaN is equal to NaN, and the null value is equal to the null value. - // This will remove all equivalent values if there are duplicates. - // - // The corresponding transform result will be the null value. - ArrayValue remove_all_from_array = 7; - } -} - -// The result of applying a mutation. -message MutationResult { - // The automatically allocated key. - // Set only when the mutation allocated a key. - Key key = 3; - - // The version of the entity on the server after processing the mutation. If - // the mutation doesn't change anything on the server, then the version will - // be the version of the current entity or, if no entity is present, a version - // that is strictly greater than the version of any previous entity and less - // than the version of any possible future entity. - int64 version = 4; - - // The create time of the entity. This field will not be set after a 'delete'. - google.protobuf.Timestamp create_time = 7; - - // The update time of the entity on the server after processing the mutation. - // If the mutation doesn't change anything on the server, then the timestamp - // will be the update timestamp of the current entity. This field will not be - // set after a 'delete'. - google.protobuf.Timestamp update_time = 6; - - // Whether a conflict was detected for this mutation. Always false when a - // conflict detection strategy field is not set in the mutation. - bool conflict_detected = 5; - - // The results of applying each - // [PropertyTransform][google.datastore.v1.PropertyTransform], in the same - // order of the request. - repeated Value transform_results = 8; -} - -// The set of arbitrarily nested property paths used to restrict an operation to -// only a subset of properties in an entity. -message PropertyMask { - // The paths to the properties covered by this mask. - // - // A path is a list of property names separated by dots (`.`), for example - // `foo.bar` means the property `bar` inside the entity property `foo` inside - // the entity associated with this path. - // - // If a property name contains a dot `.` or a backslash `\`, then that - // name must be escaped. - // - // A path must not be empty, and may not reference a value inside an - // [array value][google.datastore.v1.Value.array_value]. - repeated string paths = 1; -} - -// The options shared by read requests. -message ReadOptions { - // The possible values for read consistencies. - enum ReadConsistency { - // Unspecified. This value must not be used. - READ_CONSISTENCY_UNSPECIFIED = 0; - - // Strong consistency. - STRONG = 1; - - // Eventual consistency. - EVENTUAL = 2; - } - - // For Cloud Firestore in Datastore mode, if you don't specify - // read_consistency then all lookups and queries default to - // `read_consistency`=`STRONG`. Note that, in Cloud Datastore, global queries - // defaulted to `read_consistency`=`EVENTUAL`. - // - // Explicitly setting `read_consistency`=`EVENTUAL` will result in eventually - // consistent lookups and queries. - oneof consistency_type { - // The non-transactional read consistency to use. - ReadConsistency read_consistency = 1; - - // The identifier of the transaction in which to read. A - // transaction identifier is returned by a call to - // [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction]. - bytes transaction = 2; - - // Options for beginning a new transaction for this request. - // - // The new transaction identifier will be returned in the corresponding - // response as either - // [LookupResponse.transaction][google.datastore.v1.LookupResponse.transaction] - // or - // [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction]. - TransactionOptions new_transaction = 3; - - // Reads entities as they were at the given time. This value is only - // supported for Cloud Firestore in Datastore mode. - // - // This must be a microsecond precision timestamp within the past one hour, - // or if Point-in-Time Recovery is enabled, can additionally be a whole - // minute timestamp within the past 7 days. - google.protobuf.Timestamp read_time = 4; - } -} - -// Options for beginning a new transaction. -// -// Transactions can be created explicitly with calls to -// [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction] -// or implicitly by setting -// [ReadOptions.new_transaction][google.datastore.v1.ReadOptions.new_transaction] -// in read requests. -message TransactionOptions { - // Options specific to read / write transactions. - message ReadWrite { - // The transaction identifier of the transaction being retried. - bytes previous_transaction = 1; - } - - // Options specific to read-only transactions. - message ReadOnly { - // Reads entities at the given time. - // - // This must be a microsecond precision timestamp within the past one hour, - // or if Point-in-Time Recovery is enabled, can additionally be a whole - // minute timestamp within the past 7 days. - google.protobuf.Timestamp read_time = 1; - } - - // The `mode` of the transaction, indicating whether write operations are - // supported. - oneof mode { - // The transaction should allow both reads and writes. - ReadWrite read_write = 1; - - // The transaction should only allow reads. - ReadOnly read_only = 2; - } -} diff --git a/handwritten/datastore/protos/google/datastore/v1/entity.proto b/handwritten/datastore/protos/google/datastore/v1/entity.proto deleted file mode 100644 index fdf0a32cb7f9..000000000000 --- a/handwritten/datastore/protos/google/datastore/v1/entity.proto +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.datastore.v1; - -import "google/protobuf/struct.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/latlng.proto"; - -option csharp_namespace = "Google.Cloud.Datastore.V1"; -option go_package = "cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb"; -option java_multiple_files = true; -option java_outer_classname = "EntityProto"; -option java_package = "com.google.datastore.v1"; -option php_namespace = "Google\\Cloud\\Datastore\\V1"; -option ruby_package = "Google::Cloud::Datastore::V1"; - -// A partition ID identifies a grouping of entities. The grouping is always -// by project and namespace, however the namespace ID may be empty. -// -// A partition ID contains several dimensions: -// project ID and namespace ID. -// -// Partition dimensions: -// -// - May be `""`. -// - Must be valid UTF-8 bytes. -// - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}` -// If the value of any dimension matches regex `__.*__`, the partition is -// reserved/read-only. -// A reserved/read-only partition ID is forbidden in certain documented -// contexts. -// -// Foreign partition IDs (in which the project ID does -// not match the context project ID ) are discouraged. -// Reads and writes of foreign partition IDs may fail if the project is not in -// an active state. -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; -} - -// A unique identifier for an entity. -// If a key's partition ID or any of its path kinds or names are -// reserved/read-only, the key is reserved/read-only. -// A reserved/read-only key is forbidden in certain documented contexts. -message Key { - // A (kind, ID/name) pair used to construct a key path. - // - // If either name or ID is set, the element is complete. - // If neither is set, the element is incomplete. - message PathElement { - // The kind of the entity. - // - // A kind matching regex `__.*__` is reserved/read-only. - // A kind must not contain more than 1500 bytes when UTF-8 encoded. - // Cannot be `""`. - // - // Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - // encoded as `__bytes__` where `` is the base-64 encoding of the - // bytes. - string kind = 1; - - // The type of ID. - oneof id_type { - // The auto-allocated ID of the entity. - // - // Never equal to zero. Values less than zero are discouraged and may not - // be supported in the future. - int64 id = 2; - - // The name of the entity. - // - // A name matching regex `__.*__` is reserved/read-only. - // A name must not be more than 1500 bytes when UTF-8 encoded. - // Cannot be `""`. - // - // Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are - // encoded as `__bytes__` where `` is the base-64 encoding of the - // bytes. - string name = 3; - } - } - - // Entities are partitioned into subsets, currently identified by a project - // ID and namespace ID. - // Queries are scoped to a single partition. - PartitionId partition_id = 1; - - // The entity path. - // An entity path consists of one or more elements composed of a kind and a - // string or numerical identifier, which identify entities. The first - // element identifies a _root entity_, the second element identifies - // a _child_ of the root entity, the third element identifies a child of the - // second entity, and so forth. The entities identified by all prefixes of - // the path are called the element's _ancestors_. - // - // An entity path is always fully complete: *all* of the entity's ancestors - // are required to be in the path along with the entity identifier itself. - // The only exception is that in some documented cases, the identifier in the - // last path element (for the entity) itself may be omitted. For example, - // the last path element of the key of `Mutation.insert` may have no - // identifier. - // - // A path can never be empty, and a path can have at most 100 elements. - repeated PathElement path = 2; -} - -// An array value. -message ArrayValue { - // Values in the array. - // The order of values in an array is preserved as long as all values have - // identical settings for 'exclude_from_indexes'. - repeated Value values = 1; -} - -// A message that can hold any of the supported value types and associated -// metadata. -message Value { - // Must have a value set. - oneof value_type { - // A null value. - google.protobuf.NullValue null_value = 11; - - // A boolean value. - bool boolean_value = 1; - - // An integer value. - int64 integer_value = 2; - - // A double value. - double double_value = 3; - - // A timestamp value. - // When stored in the Datastore, precise only to microseconds; - // any additional precision is rounded down. - google.protobuf.Timestamp timestamp_value = 10; - - // A key value. - Key key_value = 5; - - // A UTF-8 encoded string value. - // When `exclude_from_indexes` is false (it is indexed) , may have at most - // 1500 bytes. Otherwise, may be set to at most 1,000,000 bytes. - string string_value = 17; - - // A blob value. - // May have at most 1,000,000 bytes. - // When `exclude_from_indexes` is false, may have at most 1500 bytes. - // In JSON requests, must be base64-encoded. - bytes blob_value = 18; - - // A geo point value representing a point on the surface of Earth. - google.type.LatLng geo_point_value = 8; - - // An entity value. - // - // - May have no key. - // - May have a key with an incomplete key path. - // - May have a reserved/read-only key. - Entity entity_value = 6; - - // An array value. - // Cannot contain another array value. - // A `Value` instance that sets field `array_value` must not set fields - // `meaning` or `exclude_from_indexes`. - ArrayValue array_value = 9; - } - - // The `meaning` field should only be populated for backwards compatibility. - int32 meaning = 14; - - // If the value should be excluded from all indexes including those defined - // explicitly. - bool exclude_from_indexes = 19; -} - -// A Datastore data object. -// -// Must not exceed 1 MiB - 4 bytes. -message Entity { - // The entity's key. - // - // An entity must have a key, unless otherwise documented (for example, - // an entity in `Value.entity_value` may have no key). - // An entity's kind is its key path's last element's kind, - // or null if it has no key. - Key key = 1; - - // The entity's properties. - // The map's keys are property names. - // A property name matching regex `__.*__` is reserved. - // A reserved property name is forbidden in certain documented contexts. - // The map keys, represented as UTF-8, must not exceed 1,500 bytes and cannot - // be empty. - map properties = 3; -} diff --git a/handwritten/datastore/protos/google/datastore/v1/query.proto b/handwritten/datastore/protos/google/datastore/v1/query.proto deleted file mode 100644 index 2e36f958b67d..000000000000 --- a/handwritten/datastore/protos/google/datastore/v1/query.proto +++ /dev/null @@ -1,622 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.datastore.v1; - -import "google/api/field_behavior.proto"; -import "google/datastore/v1/entity.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; - -option csharp_namespace = "Google.Cloud.Datastore.V1"; -option go_package = "cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb"; -option java_multiple_files = true; -option java_outer_classname = "QueryProto"; -option java_package = "com.google.datastore.v1"; -option php_namespace = "Google\\Cloud\\Datastore\\V1"; -option ruby_package = "Google::Cloud::Datastore::V1"; - -// The result of fetching an entity from Datastore. -message EntityResult { - // Specifies what data the 'entity' field contains. - // A `ResultType` is either implied (for example, in `LookupResponse.missing` - // from `datastore.proto`, it is always `KEY_ONLY`) or specified by context - // (for example, in message `QueryResultBatch`, field `entity_result_type` - // specifies a `ResultType` for all the values in field `entity_results`). - enum ResultType { - // Unspecified. This value is never used. - RESULT_TYPE_UNSPECIFIED = 0; - - // The key and properties. - FULL = 1; - - // A projected subset of properties. The entity may have no key. - PROJECTION = 2; - - // Only the key. - KEY_ONLY = 3; - } - - // The resulting entity. - Entity entity = 1; - - // The version of the entity, a strictly positive number that monotonically - // increases with changes to the entity. - // - // This field is set for - // [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - // - // For [missing][google.datastore.v1.LookupResponse.missing] entities in - // `LookupResponse`, this is the version of the snapshot that was used to look - // up the entity, and it is always set except for eventually consistent reads. - int64 version = 4; - - // The time at which the entity was created. - // This field is set for - // [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - // If this entity is missing, this field will not be set. - google.protobuf.Timestamp create_time = 6; - - // The time at which the entity was last changed. - // This field is set for - // [`FULL`][google.datastore.v1.EntityResult.ResultType.FULL] entity results. - // If this entity is missing, this field will not be set. - google.protobuf.Timestamp update_time = 5; - - // A cursor that points to the position after the result entity. - // Set only when the `EntityResult` is part of a `QueryResultBatch` message. - bytes cursor = 3; -} - -// A query for entities. -// -// The query stages are executed in the following order: -// 1. kind -// 2. filter -// 3. projection -// 4. order + start_cursor + end_cursor -// 5. offset -// 6. limit -// 7. find_nearest -message Query { - // The projection to return. Defaults to returning all properties. - repeated Projection projection = 2; - - // The kinds to query (if empty, returns entities of all kinds). - // Currently at most 1 kind may be specified. - repeated KindExpression kind = 3; - - // The filter to apply. - Filter filter = 4; - - // The order to apply to the query results (if empty, order is unspecified). - repeated PropertyOrder order = 5; - - // The properties to make distinct. The query results will contain the first - // result for each distinct combination of values for the given properties - // (if empty, all results are returned). - // - // Requires: - // - // * If `order` is specified, the set of distinct on properties must appear - // before the non-distinct on properties in `order`. - repeated PropertyReference distinct_on = 6; - - // A starting point for the query results. Query cursors are - // returned in query result batches and - // [can only be used to continue the same - // query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - bytes start_cursor = 7; - - // An ending point for the query results. Query cursors are - // returned in query result batches and - // [can only be used to limit the same - // query](https://cloud.google.com/datastore/docs/concepts/queries#cursors_limits_and_offsets). - bytes end_cursor = 8; - - // The number of results to skip. Applies before limit, but after all other - // constraints. Optional. Must be >= 0 if specified. - int32 offset = 10; - - // The maximum number of results to return. Applies after all other - // constraints. Optional. - // Unspecified is interpreted as no limit. - // Must be >= 0 if specified. - google.protobuf.Int32Value limit = 12; - - // Optional. A potential Nearest Neighbors Search. - // - // Applies after all other filters and ordering. - // - // Finds the closest vector embeddings to the given query vector. - FindNearest find_nearest = 13 [(google.api.field_behavior) = OPTIONAL]; -} - -// Datastore query for running an aggregation over a -// [Query][google.datastore.v1.Query]. -message AggregationQuery { - // Defines an 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. - // - // Unspecified is interpreted as no bound. - // - // If a zero value is provided, a count result of zero should always be - // expected. - // - // High-Level Example: - // - // ``` - // AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k ); - // ``` - // - // Requires: - // - // * Must be non-negative when present. - google.protobuf.Int64Value up_to = 1 - [(google.api.field_behavior) = OPTIONAL]; - } - - // Sum of the values of the requested property. - // - // * Only numeric values will be aggregated. All non-numeric values - // including `NULL` are skipped. - // - // * If the aggregated values contain `NaN`, returns `NaN`. Infinity math - // follows IEEE-754 standards. - // - // * If the aggregated value set is empty, returns 0. - // - // * Returns a 64-bit integer if all aggregated numbers are integers and the - // sum result does not overflow. Otherwise, the result is returned as a - // double. Note that even if all the aggregated values are integers, the - // result is returned as a double if it cannot fit within a 64-bit signed - // integer. When this occurs, the returned value will lose precision. - // - // * When underflow occurs, floating-point aggregation is non-deterministic. - // This means that running the same query repeatedly without any changes to - // the underlying values could produce slightly different results each - // time. In those cases, values should be stored as integers over - // floating-point numbers. - message Sum { - // The property to aggregate on. - PropertyReference property = 1; - } - - // Average of the values of the requested property. - // - // * Only numeric values will be aggregated. All non-numeric values - // including `NULL` are skipped. - // - // * If the aggregated values contain `NaN`, returns `NaN`. Infinity math - // follows IEEE-754 standards. - // - // * If the aggregated value set is empty, returns `NULL`. - // - // * Always returns the result as a double. - message Avg { - // The property to aggregate on. - PropertyReference property = 1; - } - - // The type of aggregation to perform, required. - oneof operator { - // Count aggregator. - Count count = 1; - - // Sum aggregator. - Sum sum = 2; - - // Average aggregator. - Avg avg = 3; - } - - // Optional. Optional name of the property to store the result of the - // aggregation. - // - // If not provided, Datastore will pick a default name following the format - // `property_`. For example: - // - // ``` - // AGGREGATE - // COUNT_UP_TO(1) AS count_up_to_1, - // COUNT_UP_TO(2), - // COUNT_UP_TO(3) AS count_up_to_3, - // COUNT(*) - // OVER ( - // ... - // ); - // ``` - // - // becomes: - // - // ``` - // AGGREGATE - // COUNT_UP_TO(1) AS count_up_to_1, - // COUNT_UP_TO(2) AS property_1, - // COUNT_UP_TO(3) AS count_up_to_3, - // COUNT(*) AS property_2 - // OVER ( - // ... - // ); - // ``` - // - // Requires: - // - // * Must be unique across all aggregation aliases. - // * Conform to [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 over the results of the - // `nested_query`. - // - // Requires: - // - // * A minimum of one and maximum of five aggregations per query. - repeated Aggregation aggregations = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A representation of a kind. -message KindExpression { - // The name of the kind. - string name = 1; -} - -// A reference to a property relative to the kind expressions. -message PropertyReference { - // A reference to a property. - // - // Requires: - // - // * MUST be a dot-delimited (`.`) string of segments, where each segment - // conforms to [entity property name][google.datastore.v1.Entity.properties] - // limitations. - string name = 2; -} - -// A representation of a property in a projection. -message Projection { - // The property to project. - PropertyReference property = 1; -} - -// The desired order for a specific property. -message PropertyOrder { - // The sort direction. - enum Direction { - // Unspecified. This value must not be used. - DIRECTION_UNSPECIFIED = 0; - - // Ascending. - ASCENDING = 1; - - // Descending. - DESCENDING = 2; - } - - // The property to order by. - PropertyReference property = 1; - - // The direction to order by. Defaults to `ASCENDING`. - Direction direction = 2; -} - -// A holder for any type of filter. -message Filter { - // The type of filter. - oneof filter_type { - // A composite filter. - CompositeFilter composite_filter = 1; - - // A filter on a property. - PropertyFilter property_filter = 2; - } -} - -// A filter that merges multiple other filters using the given operator. -message CompositeFilter { - // A composite filter operator. - enum Operator { - // Unspecified. This value must not be used. - OPERATOR_UNSPECIFIED = 0; - - // 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. - repeated Filter filters = 2; -} - -// A filter on a specific property. -message PropertyFilter { - // A property filter operator. - enum Operator { - // Unspecified. This value must not be used. - OPERATOR_UNSPECIFIED = 0; - - // The given `property` is less than the given `value`. - // - // Requires: - // - // * That `property` comes first in `order_by`. - LESS_THAN = 1; - - // The given `property` is less than or equal to the given `value`. - // - // Requires: - // - // * That `property` comes first in `order_by`. - LESS_THAN_OR_EQUAL = 2; - - // The given `property` is greater than the given `value`. - // - // Requires: - // - // * That `property` comes first in `order_by`. - GREATER_THAN = 3; - - // The given `property` is greater than or equal to the given `value`. - // - // Requires: - // - // * That `property` comes first in `order_by`. - GREATER_THAN_OR_EQUAL = 4; - - // The given `property` is equal to the given `value`. - EQUAL = 5; - - // The given `property` is equal to at least one value in the given array. - // - // Requires: - // - // * That `value` is a non-empty `ArrayValue`, subject to disjunction - // limits. - // * No `NOT_IN` is in the same query. - IN = 6; - - // The given `property` is not equal to the given `value`. - // - // Requires: - // - // * No other `NOT_EQUAL` or `NOT_IN` is in the same query. - // * That `property` comes first in the `order_by`. - NOT_EQUAL = 9; - - // Limit the result set to the given entity and its descendants. - // - // Requires: - // - // * That `value` is an entity key. - // * All evaluated disjunctions must have the same `HAS_ANCESTOR` filter. - HAS_ANCESTOR = 11; - - // The value of the `property` is not in the given array. - // - // Requires: - // - // * That `value` is a non-empty `ArrayValue` with at most 10 values. - // * No other `OR`, `IN`, `NOT_IN`, `NOT_EQUAL` is in the same query. - // * That `field` comes first in the `order_by`. - NOT_IN = 13; - } - - // The property to filter by. - PropertyReference property = 1; - - // The operator to filter by. - Operator op = 2; - - // The value to compare the property to. - Value value = 3; -} - -// Nearest Neighbors search config. The ordering provided by FindNearest -// supersedes the order_by stage. If multiple documents have the same vector -// distance, the returned document order is not guaranteed to be stable between -// queries. -message FindNearest { - // The distance measure to use when comparing vectors. - enum DistanceMeasure { - // Should not be set. - DISTANCE_MEASURE_UNSPECIFIED = 0; - - // Measures the EUCLIDEAN distance between the vectors. See - // [Euclidean](https://en.wikipedia.org/wiki/Euclidean_distance) to learn - // more. The resulting distance decreases the more similar two vectors are. - EUCLIDEAN = 1; - - // COSINE distance compares vectors based on the angle between them, which - // allows you to measure similarity that isn't based on the vectors - // magnitude. We recommend using DOT_PRODUCT with unit normalized vectors - // instead of COSINE distance, which is mathematically equivalent with - // better performance. See [Cosine - // Similarity](https://en.wikipedia.org/wiki/Cosine_similarity) to learn - // more about COSINE similarity and COSINE distance. The resulting COSINE - // distance decreases the more similar two vectors are. - COSINE = 2; - - // Similar to cosine but is affected by the magnitude of the vectors. See - // [Dot Product](https://en.wikipedia.org/wiki/Dot_product) to learn more. - // The resulting distance increases the more similar two vectors are. - DOT_PRODUCT = 3; - } - - // Required. An indexed vector property to search upon. Only documents which - // contain vectors whose dimensionality match the query_vector can be - // returned. - PropertyReference vector_property = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The query vector that we are searching on. Must be a vector of no - // more than 2048 dimensions. - Value query_vector = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The Distance Measure to use, required. - DistanceMeasure distance_measure = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The number of nearest neighbors to return. Must be a positive - // integer of no more than 100. - google.protobuf.Int32Value limit = 4 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Optional name of the field to output the result of the vector - // distance calculation. Must conform to [entity - // property][google.datastore.v1.Entity.properties] limitations. - string distance_result_property = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Option to specify a threshold for which no less similar documents - // will be returned. The behavior of the specified `distance_measure` will - // affect the meaning of the distance threshold. Since DOT_PRODUCT distances - // increase when the vectors are more similar, the comparison is inverted. - // - // For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold - // For DOT_PRODUCT: WHERE distance >= distance_threshold - google.protobuf.DoubleValue distance_threshold = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A [GQL -// query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). -message GqlQuery { - // A string of the format described - // [here](https://cloud.google.com/datastore/docs/apis/gql/gql_reference). - string query_string = 1; - - // When false, the query string must not contain any literals and instead must - // bind all values. For example, - // `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed, while - // `SELECT * FROM Kind WHERE a = @value` is. - bool allow_literals = 2; - - // For each non-reserved named binding site in the query string, there must be - // a named parameter with that name, but not necessarily the inverse. - // - // Key must match regex `[A-Za-z_$][A-Za-z_$0-9]*`, must not match regex - // `__.*__`, and must not be `""`. - map named_bindings = 5; - - // Numbered binding site @1 references the first numbered parameter, - // effectively using 1-based indexing, rather than the usual 0. - // - // For each binding site numbered i in `query_string`, there must be an i-th - // numbered parameter. The inverse must also be true. - repeated GqlQueryParameter positional_bindings = 4; -} - -// A binding parameter for a GQL query. -message GqlQueryParameter { - // The type of parameter. - oneof parameter_type { - // A value parameter. - Value value = 2; - - // A query cursor. Query cursors are returned in query - // result batches. - bytes cursor = 3; - } -} - -// A batch of results produced by a query. -message QueryResultBatch { - // The possible values for the `more_results` field. - enum MoreResultsType { - // Unspecified. This value is never used. - MORE_RESULTS_TYPE_UNSPECIFIED = 0; - - // There may be additional batches to fetch from this query. - NOT_FINISHED = 1; - - // The query is finished, but there may be more results after the limit. - MORE_RESULTS_AFTER_LIMIT = 2; - - // The query is finished, but there may be more results after the end - // cursor. - MORE_RESULTS_AFTER_CURSOR = 4; - - // The query is finished, and there are no more results. - NO_MORE_RESULTS = 3; - } - - // The number of results skipped, typically because of an offset. - int32 skipped_results = 6; - - // A cursor that points to the position after the last skipped result. - // Will be set when `skipped_results` != 0. - bytes skipped_cursor = 3; - - // The result type for every entity in `entity_results`. - EntityResult.ResultType entity_result_type = 1; - - // The results for this batch. - repeated EntityResult entity_results = 2; - - // A cursor that points to the position after the last result in the batch. - bytes end_cursor = 4; - - // The state of the query after the current batch. - MoreResultsType more_results = 5; - - // The version number of the snapshot this batch was returned from. - // This applies to the range of results from the query's `start_cursor` (or - // the beginning of the query if no cursor was given) to this batch's - // `end_cursor` (not the query's `end_cursor`). - // - // In a single transaction, subsequent query result batches for the same query - // can have a greater snapshot version number. Each batch's snapshot version - // is valid for all preceding batches. - // The value will be zero for eventually consistent queries. - int64 snapshot_version = 7; - - // Read timestamp this batch was returned from. - // This applies to the range of results from the query's `start_cursor` (or - // the beginning of the query if no cursor was given) to this batch's - // `end_cursor` (not the query's `end_cursor`). - // - // 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. - // This value will not be set for eventually consistent queries in Cloud - // Datastore. - google.protobuf.Timestamp read_time = 8; -} diff --git a/handwritten/datastore/protos/google/datastore/v1/query_profile.proto b/handwritten/datastore/protos/google/datastore/v1/query_profile.proto deleted file mode 100644 index 71a4eb599335..000000000000 --- a/handwritten/datastore/protos/google/datastore/v1/query_profile.proto +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.datastore.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/struct.proto"; - -option csharp_namespace = "Google.Cloud.Datastore.V1"; -option go_package = "cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb"; -option java_multiple_files = true; -option java_outer_classname = "QueryProfileProto"; -option java_package = "com.google.datastore.v1"; -option php_namespace = "Google\\Cloud\\Datastore\\V1"; -option ruby_package = "Google::Cloud::Datastore::V1"; - -// Specification of the Datastore Query Profile fields. - -// Explain options for the query. -message ExplainOptions { - // Optional. Whether to execute this query. - // - // When false (the default), the query will be planned, returning only - // metrics from the planning stages. - // - // When true, the query will be planned and executed, returning the full - // query results along with both planning and execution stage metrics. - bool analyze = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Explain metrics for the query. -message ExplainMetrics { - // Planning phase information for the query. - PlanSummary plan_summary = 1; - - // Aggregated stats from the execution of the query. Only present when - // [ExplainOptions.analyze][google.datastore.v1.ExplainOptions.analyze] is set - // to true. - ExecutionStats execution_stats = 2; -} - -// Planning phase information for the query. -message PlanSummary { - // The indexes selected for the query. For example: - // [ - // {"query_scope": "Collection", "properties": "(foo ASC, __name__ ASC)"}, - // {"query_scope": "Collection", "properties": "(bar ASC, __name__ ASC)"} - // ] - repeated google.protobuf.Struct indexes_used = 1; -} - -// Execution statistics for the query. -message ExecutionStats { - // Total number of results returned, including documents, projections, - // aggregation results, keys. - int64 results_returned = 1; - - // Total time to execute the query in the backend. - google.protobuf.Duration execution_duration = 3; - - // Total billable read operations. - int64 read_operations = 4; - - // Debugging statistics from the execution of the query. Note that the - // debugging stats are subject to change as Firestore evolves. It could - // include: - // { - // "indexes_entries_scanned": "1000", - // "documents_scanned": "20", - // "billing_details" : { - // "documents_billable": "20", - // "index_entries_billable": "1000", - // "min_query_cost": "0" - // } - // } - google.protobuf.Struct debug_stats = 5; -} diff --git a/handwritten/datastore/protos/protos.d.ts b/handwritten/datastore/protos/protos.d.ts deleted file mode 100644 index c330fd9b1871..000000000000 --- a/handwritten/datastore/protos/protos.d.ts +++ /dev/null @@ -1,18362 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import type {protobuf as $protobuf} from "google-gax"; -import Long = require("long"); -/** Namespace google. */ -export namespace google { - - /** Namespace datastore. */ - namespace datastore { - - /** Namespace admin. */ - namespace admin { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a DatastoreAdmin */ - class DatastoreAdmin extends $protobuf.rpc.Service { - - /** - * 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 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; - - /** - * 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; - - /** - * Calls ExportEntities. - * @param request ExportEntitiesRequest message or plain object - * @returns Promise - */ - public exportEntities(request: google.datastore.admin.v1.IExportEntitiesRequest): Promise; - - /** - * 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; - - /** - * Calls ImportEntities. - * @param request ImportEntitiesRequest message or plain object - * @returns Promise - */ - public importEntities(request: google.datastore.admin.v1.IImportEntitiesRequest): Promise; - - /** - * 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; - - /** - * Calls CreateIndex. - * @param request CreateIndexRequest message or plain object - * @returns Promise - */ - public createIndex(request: google.datastore.admin.v1.ICreateIndexRequest): Promise; - - /** - * 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; - - /** - * Calls DeleteIndex. - * @param request DeleteIndexRequest message or plain object - * @returns Promise - */ - public deleteIndex(request: google.datastore.admin.v1.IDeleteIndexRequest): Promise; - - /** - * 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; - - /** - * Calls GetIndex. - * @param request GetIndexRequest message or plain object - * @returns Promise - */ - public getIndex(request: google.datastore.admin.v1.IGetIndexRequest): Promise; - - /** - * 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; - - /** - * Calls ListIndexes. - * @param request ListIndexesRequest message or plain object - * @returns Promise - */ - public listIndexes(request: google.datastore.admin.v1.IListIndexesRequest): Promise; - } - - namespace DatastoreAdmin { - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - } - - /** Properties of a CommonMetadata. */ - interface ICommonMetadata { - - /** CommonMetadata startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** CommonMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** CommonMetadata operationType */ - operationType?: (google.datastore.admin.v1.OperationType|keyof typeof google.datastore.admin.v1.OperationType|null); - - /** CommonMetadata labels */ - labels?: ({ [k: string]: string }|null); - - /** CommonMetadata state */ - state?: (google.datastore.admin.v1.CommonMetadata.State|keyof typeof google.datastore.admin.v1.CommonMetadata.State|null); - } - - /** Represents a CommonMetadata. */ - class CommonMetadata implements ICommonMetadata { - - /** - * Constructs a new CommonMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.ICommonMetadata); - - /** CommonMetadata startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** CommonMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** CommonMetadata operationType. */ - public operationType: (google.datastore.admin.v1.OperationType|keyof typeof google.datastore.admin.v1.OperationType); - - /** CommonMetadata labels. */ - public labels: { [k: string]: string }; - - /** CommonMetadata state. */ - public state: (google.datastore.admin.v1.CommonMetadata.State|keyof typeof google.datastore.admin.v1.CommonMetadata.State); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this CommonMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CommonMetadata { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - INITIALIZING = 1, - PROCESSING = 2, - CANCELLING = 3, - FINALIZING = 4, - SUCCESSFUL = 5, - FAILED = 6, - CANCELLED = 7 - } - } - - /** Properties of a Progress. */ - interface IProgress { - - /** Progress workCompleted */ - workCompleted?: (number|Long|string|null); - - /** Progress workEstimated */ - workEstimated?: (number|Long|string|null); - } - - /** Represents a Progress. */ - class Progress implements IProgress { - - /** - * Constructs a new Progress. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IProgress); - - /** Progress workCompleted. */ - public workCompleted: (number|Long|string); - - /** Progress workEstimated. */ - public workEstimated: (number|Long|string); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * Verifies a Progress message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Progress message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Progress - */ - public static fromObject(object: { [k: string]: any }): google.datastore.admin.v1.Progress; - - /** - * Creates a plain object from a Progress message. Also converts values to other types if specified. - * @param message Progress - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.admin.v1.Progress, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Progress to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Progress - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportEntitiesRequest. */ - interface IExportEntitiesRequest { - - /** ExportEntitiesRequest projectId */ - projectId?: (string|null); - - /** ExportEntitiesRequest labels */ - labels?: ({ [k: string]: string }|null); - - /** ExportEntitiesRequest entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - - /** ExportEntitiesRequest outputUrlPrefix */ - outputUrlPrefix?: (string|null); - } - - /** Represents an ExportEntitiesRequest. */ - class ExportEntitiesRequest implements IExportEntitiesRequest { - - /** - * Constructs a new ExportEntitiesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IExportEntitiesRequest); - - /** ExportEntitiesRequest projectId. */ - public projectId: string; - - /** ExportEntitiesRequest labels. */ - public labels: { [k: string]: string }; - - /** ExportEntitiesRequest entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - - /** ExportEntitiesRequest outputUrlPrefix. */ - public outputUrlPrefix: 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this ExportEntitiesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportEntitiesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportEntitiesRequest. */ - interface IImportEntitiesRequest { - - /** ImportEntitiesRequest projectId */ - projectId?: (string|null); - - /** ImportEntitiesRequest labels */ - labels?: ({ [k: string]: string }|null); - - /** ImportEntitiesRequest inputUrl */ - inputUrl?: (string|null); - - /** ImportEntitiesRequest entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - } - - /** Represents an ImportEntitiesRequest. */ - class ImportEntitiesRequest implements IImportEntitiesRequest { - - /** - * Constructs a new ImportEntitiesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IImportEntitiesRequest); - - /** ImportEntitiesRequest projectId. */ - public projectId: string; - - /** ImportEntitiesRequest labels. */ - public labels: { [k: string]: string }; - - /** ImportEntitiesRequest inputUrl. */ - public inputUrl: string; - - /** ImportEntitiesRequest entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|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; - - /** - * 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 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; - - /** - * 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 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; - - /** - * 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); - - /** - * 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 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 }; - - /** - * Converts this ImportEntitiesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportEntitiesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportEntitiesResponse. */ - interface IExportEntitiesResponse { - - /** ExportEntitiesResponse outputUrl */ - outputUrl?: (string|null); - } - - /** Represents an ExportEntitiesResponse. */ - class ExportEntitiesResponse implements IExportEntitiesResponse { - - /** - * Constructs a new ExportEntitiesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IExportEntitiesResponse); - - /** ExportEntitiesResponse outputUrl. */ - public outputUrl: 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ExportEntitiesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportEntitiesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExportEntitiesMetadata. */ - interface IExportEntitiesMetadata { - - /** ExportEntitiesMetadata common */ - common?: (google.datastore.admin.v1.ICommonMetadata|null); - - /** ExportEntitiesMetadata progressEntities */ - progressEntities?: (google.datastore.admin.v1.IProgress|null); - - /** ExportEntitiesMetadata progressBytes */ - progressBytes?: (google.datastore.admin.v1.IProgress|null); - - /** ExportEntitiesMetadata entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - - /** ExportEntitiesMetadata outputUrlPrefix */ - outputUrlPrefix?: (string|null); - } - - /** Represents an ExportEntitiesMetadata. */ - class ExportEntitiesMetadata implements IExportEntitiesMetadata { - - /** - * Constructs a new ExportEntitiesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IExportEntitiesMetadata); - - /** ExportEntitiesMetadata common. */ - public common?: (google.datastore.admin.v1.ICommonMetadata|null); - - /** ExportEntitiesMetadata progressEntities. */ - public progressEntities?: (google.datastore.admin.v1.IProgress|null); - - /** ExportEntitiesMetadata progressBytes. */ - public progressBytes?: (google.datastore.admin.v1.IProgress|null); - - /** ExportEntitiesMetadata entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - - /** ExportEntitiesMetadata outputUrlPrefix. */ - public outputUrlPrefix: string; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ExportEntitiesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExportEntitiesMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ImportEntitiesMetadata. */ - interface IImportEntitiesMetadata { - - /** ImportEntitiesMetadata common */ - common?: (google.datastore.admin.v1.ICommonMetadata|null); - - /** ImportEntitiesMetadata progressEntities */ - progressEntities?: (google.datastore.admin.v1.IProgress|null); - - /** ImportEntitiesMetadata progressBytes */ - progressBytes?: (google.datastore.admin.v1.IProgress|null); - - /** ImportEntitiesMetadata entityFilter */ - entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - - /** ImportEntitiesMetadata inputUrl */ - inputUrl?: (string|null); - } - - /** Represents an ImportEntitiesMetadata. */ - class ImportEntitiesMetadata implements IImportEntitiesMetadata { - - /** - * Constructs a new ImportEntitiesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IImportEntitiesMetadata); - - /** ImportEntitiesMetadata common. */ - public common?: (google.datastore.admin.v1.ICommonMetadata|null); - - /** ImportEntitiesMetadata progressEntities. */ - public progressEntities?: (google.datastore.admin.v1.IProgress|null); - - /** ImportEntitiesMetadata progressBytes. */ - public progressBytes?: (google.datastore.admin.v1.IProgress|null); - - /** ImportEntitiesMetadata entityFilter. */ - public entityFilter?: (google.datastore.admin.v1.IEntityFilter|null); - - /** ImportEntitiesMetadata inputUrl. */ - public inputUrl: string; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this ImportEntitiesMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ImportEntitiesMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EntityFilter. */ - interface IEntityFilter { - - /** EntityFilter kinds */ - kinds?: (string[]|null); - - /** EntityFilter namespaceIds */ - namespaceIds?: (string[]|null); - } - - /** Represents an EntityFilter. */ - class EntityFilter implements IEntityFilter { - - /** - * Constructs a new EntityFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IEntityFilter); - - /** EntityFilter kinds. */ - public kinds: string[]; - - /** EntityFilter namespaceIds. */ - public namespaceIds: string[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this EntityFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntityFilter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateIndexRequest. */ - interface ICreateIndexRequest { - - /** CreateIndexRequest projectId */ - projectId?: (string|null); - - /** CreateIndexRequest index */ - index?: (google.datastore.admin.v1.IIndex|null); - } - - /** Represents a CreateIndexRequest. */ - class CreateIndexRequest implements ICreateIndexRequest { - - /** - * Constructs a new CreateIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.ICreateIndexRequest); - - /** CreateIndexRequest projectId. */ - public projectId: string; - - /** CreateIndexRequest index. */ - public index?: (google.datastore.admin.v1.IIndex|null); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this CreateIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateIndexRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteIndexRequest. */ - interface IDeleteIndexRequest { - - /** DeleteIndexRequest projectId */ - projectId?: (string|null); - - /** DeleteIndexRequest indexId */ - indexId?: (string|null); - } - - /** Represents a DeleteIndexRequest. */ - class DeleteIndexRequest implements IDeleteIndexRequest { - - /** - * Constructs a new DeleteIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IDeleteIndexRequest); - - /** DeleteIndexRequest projectId. */ - public projectId: string; - - /** DeleteIndexRequest indexId. */ - public indexId: string; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this DeleteIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteIndexRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetIndexRequest. */ - interface IGetIndexRequest { - - /** GetIndexRequest projectId */ - projectId?: (string|null); - - /** GetIndexRequest indexId */ - indexId?: (string|null); - } - - /** Represents a GetIndexRequest. */ - class GetIndexRequest implements IGetIndexRequest { - - /** - * Constructs a new GetIndexRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IGetIndexRequest); - - /** GetIndexRequest projectId. */ - public projectId: string; - - /** GetIndexRequest indexId. */ - public indexId: 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this GetIndexRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetIndexRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListIndexesRequest. */ - interface IListIndexesRequest { - - /** ListIndexesRequest projectId */ - projectId?: (string|null); - - /** ListIndexesRequest filter */ - filter?: (string|null); - - /** ListIndexesRequest pageSize */ - pageSize?: (number|null); - - /** ListIndexesRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListIndexesRequest. */ - class ListIndexesRequest implements IListIndexesRequest { - - /** - * Constructs a new ListIndexesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IListIndexesRequest); - - /** ListIndexesRequest projectId. */ - public projectId: string; - - /** ListIndexesRequest filter. */ - public filter: string; - - /** ListIndexesRequest pageSize. */ - public pageSize: number; - - /** 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ListIndexesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListIndexesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListIndexesResponse. */ - interface IListIndexesResponse { - - /** ListIndexesResponse indexes */ - indexes?: (google.datastore.admin.v1.IIndex[]|null); - - /** ListIndexesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListIndexesResponse. */ - class ListIndexesResponse implements IListIndexesResponse { - - /** - * Constructs a new ListIndexesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IListIndexesResponse); - - /** ListIndexesResponse indexes. */ - public indexes: google.datastore.admin.v1.IIndex[]; - - /** ListIndexesResponse nextPageToken. */ - public nextPageToken: string; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ListIndexesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListIndexesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an IndexOperationMetadata. */ - interface IIndexOperationMetadata { - - /** IndexOperationMetadata common */ - common?: (google.datastore.admin.v1.ICommonMetadata|null); - - /** IndexOperationMetadata progressEntities */ - progressEntities?: (google.datastore.admin.v1.IProgress|null); - - /** IndexOperationMetadata indexId */ - indexId?: (string|null); - } - - /** Represents an IndexOperationMetadata. */ - class IndexOperationMetadata implements IIndexOperationMetadata { - - /** - * Constructs a new IndexOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IIndexOperationMetadata); - - /** IndexOperationMetadata common. */ - public common?: (google.datastore.admin.v1.ICommonMetadata|null); - - /** IndexOperationMetadata progressEntities. */ - public progressEntities?: (google.datastore.admin.v1.IProgress|null); - - /** IndexOperationMetadata indexId. */ - public indexId: string; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 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; - - /** - * 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); - - /** - * 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 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 }; - - /** - * Converts this IndexOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndexOperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DatastoreFirestoreMigrationMetadata. */ - interface IDatastoreFirestoreMigrationMetadata { - - /** DatastoreFirestoreMigrationMetadata migrationState */ - migrationState?: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState|null); - - /** DatastoreFirestoreMigrationMetadata migrationStep */ - migrationStep?: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep|null); - } - - /** Represents a DatastoreFirestoreMigrationMetadata. */ - class DatastoreFirestoreMigrationMetadata implements IDatastoreFirestoreMigrationMetadata { - - /** - * Constructs a new DatastoreFirestoreMigrationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IDatastoreFirestoreMigrationMetadata); - - /** DatastoreFirestoreMigrationMetadata migrationState. */ - public migrationState: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState); - - /** DatastoreFirestoreMigrationMetadata migrationStep. */ - public migrationStep: (google.datastore.admin.v1.MigrationStep|keyof typeof google.datastore.admin.v1.MigrationStep); - - /** - * 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 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 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 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; - - /** - * 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); - - /** - * 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 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 }; - - /** - * Converts this DatastoreFirestoreMigrationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DatastoreFirestoreMigrationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** OperationType enum. */ - enum OperationType { - OPERATION_TYPE_UNSPECIFIED = 0, - EXPORT_ENTITIES = 1, - IMPORT_ENTITIES = 2, - CREATE_INDEX = 3, - DELETE_INDEX = 4 - } - - /** Properties of an Index. */ - interface IIndex { - - /** Index projectId */ - projectId?: (string|null); - - /** Index indexId */ - indexId?: (string|null); - - /** Index kind */ - kind?: (string|null); - - /** Index ancestor */ - ancestor?: (google.datastore.admin.v1.Index.AncestorMode|keyof typeof google.datastore.admin.v1.Index.AncestorMode|null); - - /** Index properties */ - properties?: (google.datastore.admin.v1.Index.IIndexedProperty[]|null); - - /** Index state */ - state?: (google.datastore.admin.v1.Index.State|keyof typeof google.datastore.admin.v1.Index.State|null); - } - - /** Represents an Index. */ - class Index implements IIndex { - - /** - * Constructs a new Index. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IIndex); - - /** Index projectId. */ - public projectId: string; - - /** Index indexId. */ - public indexId: string; - - /** Index kind. */ - public kind: string; - - /** Index ancestor. */ - public ancestor: (google.datastore.admin.v1.Index.AncestorMode|keyof typeof google.datastore.admin.v1.Index.AncestorMode); - - /** Index properties. */ - public properties: google.datastore.admin.v1.Index.IIndexedProperty[]; - - /** Index state. */ - public state: (google.datastore.admin.v1.Index.State|keyof typeof google.datastore.admin.v1.Index.State); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this Index to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Index - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Index { - - /** AncestorMode enum. */ - enum AncestorMode { - ANCESTOR_MODE_UNSPECIFIED = 0, - NONE = 1, - ALL_ANCESTORS = 2 - } - - /** Direction enum. */ - enum Direction { - DIRECTION_UNSPECIFIED = 0, - ASCENDING = 1, - DESCENDING = 2 - } - - /** Properties of an IndexedProperty. */ - interface IIndexedProperty { - - /** IndexedProperty name */ - name?: (string|null); - - /** IndexedProperty direction */ - direction?: (google.datastore.admin.v1.Index.Direction|keyof typeof google.datastore.admin.v1.Index.Direction|null); - } - - /** Represents an IndexedProperty. */ - class IndexedProperty implements IIndexedProperty { - - /** - * Constructs a new IndexedProperty. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.Index.IIndexedProperty); - - /** IndexedProperty name. */ - public name: string; - - /** IndexedProperty direction. */ - public direction: (google.datastore.admin.v1.Index.Direction|keyof typeof google.datastore.admin.v1.Index.Direction); - - /** - * 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 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 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 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 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 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 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 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 IndexedProperty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for IndexedProperty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - DELETING = 3, - ERROR = 4 - } - } - - /** Properties of a MigrationStateEvent. */ - interface IMigrationStateEvent { - - /** MigrationStateEvent state */ - state?: (google.datastore.admin.v1.MigrationState|keyof typeof google.datastore.admin.v1.MigrationState|null); - } - - /** Represents a MigrationStateEvent. */ - class MigrationStateEvent implements IMigrationStateEvent { - - /** - * Constructs a new MigrationStateEvent. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.admin.v1.IMigrationStateEvent); - - /** MigrationStateEvent state. */ - public state: (google.datastore.admin.v1.MigrationState|keyof typeof 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 }; - - /** - * Gets the default type url for MigrationStateEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MigrationProgressEvent. */ - interface IMigrationProgressEvent { - - /** MigrationProgressEvent step */ - step?: (google.datastore.admin.v1.MigrationStep|keyof typeof 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|keyof typeof 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 }; - - /** - * Gets the default type url for MigrationProgressEvent - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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|keyof typeof 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|keyof typeof 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 }; - - /** - * Gets the default type url for PrepareStepDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RedirectWritesStepDetails. */ - interface IRedirectWritesStepDetails { - - /** RedirectWritesStepDetails concurrencyMode */ - concurrencyMode?: (google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode|keyof typeof 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|keyof typeof 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 }; - - /** - * Gets the default type url for RedirectWritesStepDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** 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 - } - } - } - - /** 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 }; - - /** - * Gets the default type url for AggregationResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AggregationResultBatch. */ - interface IAggregationResultBatch { - - /** AggregationResultBatch aggregationResults */ - aggregationResults?: (google.datastore.v1.IAggregationResult[]|null); - - /** AggregationResultBatch moreResults */ - moreResults?: (google.datastore.v1.QueryResultBatch.MoreResultsType|keyof typeof 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|keyof typeof 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 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 }; - - /** - * Converts this AggregationResultBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AggregationResultBatch - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PartitionId. */ - interface IPartitionId { - - /** PartitionId projectId */ - projectId?: (string|null); - - /** PartitionId databaseId */ - databaseId?: (string|null); - - /** PartitionId namespaceId */ - namespaceId?: (string|null); - } - - /** Represents a PartitionId. */ - class PartitionId implements IPartitionId { - - /** - * Constructs a new PartitionId. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IPartitionId); - - /** PartitionId projectId. */ - public projectId: string; - - /** PartitionId databaseId. */ - public databaseId: string; - - /** PartitionId namespaceId. */ - public namespaceId: string; - - /** - * Creates a new PartitionId instance using the specified properties. - * @param [properties] Properties to set - * @returns PartitionId instance - */ - public static create(properties?: google.datastore.v1.IPartitionId): google.datastore.v1.PartitionId; - - /** - * 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.IPartitionId, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IPartitionId, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.PartitionId; - - /** - * Decodes a PartitionId message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.PartitionId; - - /** - * 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 PartitionId message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PartitionId - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PartitionId; - - /** - * 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.PartitionId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PartitionId to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PartitionId - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Key. */ - interface IKey { - - /** Key partitionId */ - partitionId?: (google.datastore.v1.IPartitionId|null); - - /** Key path */ - path?: (google.datastore.v1.Key.IPathElement[]|null); - } - - /** Represents a Key. */ - class Key implements IKey { - - /** - * Constructs a new Key. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IKey); - - /** Key partitionId. */ - public partitionId?: (google.datastore.v1.IPartitionId|null); - - /** Key path. */ - public path: google.datastore.v1.Key.IPathElement[]; - - /** - * Creates a new Key instance using the specified properties. - * @param [properties] Properties to set - * @returns Key instance - */ - public static create(properties?: google.datastore.v1.IKey): google.datastore.v1.Key; - - /** - * 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.IKey, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Key message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Key; - - /** - * Decodes a Key message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Key; - - /** - * Verifies a Key message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Key - */ - public static fromObject(object: { [k: string]: any }): google.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 - */ - public static toObject(message: google.datastore.v1.Key, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Key to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Key - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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 }; - - /** - * Converts this PathElement to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PathElement - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ArrayValue. */ - interface IArrayValue { - - /** ArrayValue values */ - values?: (google.datastore.v1.IValue[]|null); - } - - /** Represents an ArrayValue. */ - class ArrayValue implements IArrayValue { - - /** - * Constructs a new ArrayValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IArrayValue); - - /** ArrayValue values. */ - public values: google.datastore.v1.IValue[]; - - /** - * Creates a new ArrayValue instance using the specified properties. - * @param [properties] Properties to set - * @returns ArrayValue instance - */ - public static create(properties?: google.datastore.v1.IArrayValue): google.datastore.v1.ArrayValue; - - /** - * 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.IArrayValue, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IArrayValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ArrayValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ArrayValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.ArrayValue; - - /** - * Decodes an ArrayValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ArrayValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.ArrayValue; - - /** - * Verifies an ArrayValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ArrayValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ArrayValue - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ArrayValue; - - /** - * Creates a plain object from an ArrayValue message. Also converts values to other types if specified. - * @param message ArrayValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.ArrayValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ArrayValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ArrayValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value booleanValue */ - booleanValue?: (boolean|null); - - /** Value integerValue */ - integerValue?: (number|Long|string|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|Buffer|string|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 Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value booleanValue. */ - public booleanValue?: (boolean|null); - - /** Value integerValue. */ - public integerValue?: (number|Long|string|null); - - /** 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|Buffer|string|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 Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.datastore.v1.IValue): google.datastore.v1.Value; - - /** - * 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.IValue, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.Value; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.Value; - - /** - * Verifies a Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Entity. */ - interface IEntity { - - /** Entity key */ - key?: (google.datastore.v1.IKey|null); - - /** Entity properties */ - properties?: ({ [k: string]: google.datastore.v1.IValue }|null); - } - - /** Represents an Entity. */ - class Entity implements IEntity { - - /** - * Constructs a new Entity. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IEntity); - - /** Entity key. */ - public key?: (google.datastore.v1.IKey|null); - - /** Entity properties. */ - public properties: { [k: string]: google.datastore.v1.IValue }; - - /** - * Creates a new Entity instance using the specified properties. - * @param [properties] Properties to set - * @returns Entity instance - */ - public static create(properties?: google.datastore.v1.IEntity): google.datastore.v1.Entity; - - /** - * 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.IEntity, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.Entity; - - /** - * Decodes an Entity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.Entity; - - /** - * 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 an Entity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Entity - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Entity; - - /** - * 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.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Entity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Entity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EntityResult. */ - interface IEntityResult { - - /** EntityResult entity */ - entity?: (google.datastore.v1.IEntity|null); - - /** EntityResult version */ - version?: (number|Long|string|null); - - /** EntityResult createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** EntityResult updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** EntityResult cursor */ - cursor?: (Uint8Array|Buffer|string|null); - } - - /** Represents an EntityResult. */ - class EntityResult implements IEntityResult { - - /** - * Constructs a new EntityResult. - * @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 createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** EntityResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** EntityResult cursor. */ - public cursor: (Uint8Array|Buffer|string); - - /** - * Creates a new EntityResult instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityResult instance - */ - public static create(properties?: google.datastore.v1.IEntityResult): google.datastore.v1.EntityResult; - - /** - * 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.IEntityResult, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IEntityResult, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.EntityResult; - - /** - * Decodes an EntityResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.EntityResult; - - /** - * 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 an EntityResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityResult - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.EntityResult; - - /** - * 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.EntityResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EntityResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EntityResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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|Buffer|string|null); - - /** Query endCursor */ - endCursor?: (Uint8Array|Buffer|string|null); - - /** Query offset */ - offset?: (number|null); - - /** Query limit */ - limit?: (google.protobuf.IInt32Value|null); - - /** Query findNearest */ - findNearest?: (google.datastore.v1.IFindNearest|null); - } - - /** Represents a Query. */ - class Query implements IQuery { - - /** - * Constructs a new Query. - * @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|Buffer|string); - - /** Query endCursor. */ - public endCursor: (Uint8Array|Buffer|string); - - /** Query offset. */ - public offset: number; - - /** Query limit. */ - public limit?: (google.protobuf.IInt32Value|null); - - /** Query findNearest. */ - public findNearest?: (google.datastore.v1.IFindNearest|null); - - /** - * Creates a new Query instance using the specified properties. - * @param [properties] Properties to set - * @returns Query instance - */ - public static create(properties?: google.datastore.v1.IQuery): google.datastore.v1.Query; - - /** - * 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.IQuery, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.Query; - - /** - * Decodes a Query message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.Query; - - /** - * 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 Query message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Query - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Query; - - /** - * 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 Query to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Query - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AggregationQuery. */ - interface IAggregationQuery { - - /** AggregationQuery nestedQuery */ - nestedQuery?: (google.datastore.v1.IQuery|null); - - /** AggregationQuery aggregations */ - aggregations?: (google.datastore.v1.AggregationQuery.IAggregation[]|null); - } - - /** Represents an AggregationQuery. */ - class AggregationQuery implements IAggregationQuery { - - /** - * Constructs a new AggregationQuery. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IAggregationQuery); - - /** 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 }; - - /** - * Gets the default type url for AggregationQuery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AggregationQuery { - - /** Properties of an Aggregation. */ - interface IAggregation { - - /** Aggregation count */ - count?: (google.datastore.v1.AggregationQuery.Aggregation.ICount|null); - - /** Aggregation sum */ - sum?: (google.datastore.v1.AggregationQuery.Aggregation.ISum|null); - - /** Aggregation avg */ - avg?: (google.datastore.v1.AggregationQuery.Aggregation.IAvg|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 sum. */ - public sum?: (google.datastore.v1.AggregationQuery.Aggregation.ISum|null); - - /** Aggregation avg. */ - public avg?: (google.datastore.v1.AggregationQuery.Aggregation.IAvg|null); - - /** Aggregation alias. */ - public alias: string; - - /** Aggregation operator. */ - public operator?: ("count"|"sum"|"avg"); - - /** - * 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 }; - - /** - * Gets the default type url for Aggregation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Aggregation { - - /** Properties of a Count. */ - interface ICount { - - /** Count upTo */ - upTo?: (google.protobuf.IInt64Value|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?: (google.protobuf.IInt64Value|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; - - /** - * 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 }; - - /** - * Gets the default type url for Count - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Sum. */ - interface ISum { - - /** Sum property */ - property?: (google.datastore.v1.IPropertyReference|null); - } - - /** Represents a Sum. */ - class Sum implements ISum { - - /** - * Constructs a new Sum. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.AggregationQuery.Aggregation.ISum); - - /** Sum property. */ - public property?: (google.datastore.v1.IPropertyReference|null); - - /** - * Creates a new Sum instance using the specified properties. - * @param [properties] Properties to set - * @returns Sum instance - */ - public static create(properties?: google.datastore.v1.AggregationQuery.Aggregation.ISum): google.datastore.v1.AggregationQuery.Aggregation.Sum; - - /** - * Encodes the specified Sum message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Sum.verify|verify} messages. - * @param message Sum message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.AggregationQuery.Aggregation.ISum, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Sum message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Sum.verify|verify} messages. - * @param message Sum message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.AggregationQuery.Aggregation.ISum, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Sum message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.AggregationQuery.Aggregation.Sum; - - /** - * Decodes a Sum message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.AggregationQuery.Aggregation.Sum; - - /** - * Verifies a Sum message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Sum message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Sum - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery.Aggregation.Sum; - - /** - * Creates a plain object from a Sum message. Also converts values to other types if specified. - * @param message Sum - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AggregationQuery.Aggregation.Sum, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Sum to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Sum - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Avg. */ - interface IAvg { - - /** Avg property */ - property?: (google.datastore.v1.IPropertyReference|null); - } - - /** Represents an Avg. */ - class Avg implements IAvg { - - /** - * Constructs a new Avg. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.AggregationQuery.Aggregation.IAvg); - - /** Avg property. */ - public property?: (google.datastore.v1.IPropertyReference|null); - - /** - * Creates a new Avg instance using the specified properties. - * @param [properties] Properties to set - * @returns Avg instance - */ - public static create(properties?: google.datastore.v1.AggregationQuery.Aggregation.IAvg): google.datastore.v1.AggregationQuery.Aggregation.Avg; - - /** - * Encodes the specified Avg message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Avg.verify|verify} messages. - * @param message Avg message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.AggregationQuery.Aggregation.IAvg, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Avg message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Avg.verify|verify} messages. - * @param message Avg message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.AggregationQuery.Aggregation.IAvg, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Avg message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Avg - * @throws {Error} If the payload is not 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.Avg; - - /** - * Decodes an Avg message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Avg - * @throws {Error} If the payload 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.Avg; - - /** - * Verifies an Avg message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Avg message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Avg - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.AggregationQuery.Aggregation.Avg; - - /** - * Creates a plain object from an Avg message. Also converts values to other types if specified. - * @param message Avg - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.AggregationQuery.Aggregation.Avg, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Avg to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Avg - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** 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; - - /** - * 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.IKindExpression, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IKindExpression, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.KindExpression; - - /** - * Decodes a KindExpression message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.KindExpression; - - /** - * 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 KindExpression message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KindExpression - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.KindExpression; - - /** - * 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.KindExpression, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this KindExpression to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for KindExpression - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PropertyReference. */ - interface IPropertyReference { - - /** PropertyReference name */ - name?: (string|null); - } - - /** Represents a PropertyReference. */ - class PropertyReference implements IPropertyReference { - - /** - * Constructs a new PropertyReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IPropertyReference); - - /** PropertyReference name. */ - public name: string; - - /** - * Creates a new PropertyReference instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyReference instance - */ - public static create(properties?: google.datastore.v1.IPropertyReference): google.datastore.v1.PropertyReference; - - /** - * 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.IPropertyReference, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IPropertyReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.PropertyReference; - - /** - * Decodes a PropertyReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.PropertyReference; - - /** - * 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 a PropertyReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyReference - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyReference; - - /** - * 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.PropertyReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Projection. */ - interface IProjection { - - /** Projection property */ - property?: (google.datastore.v1.IPropertyReference|null); - } - - /** Represents a Projection. */ - class Projection implements IProjection { - - /** - * Constructs a new Projection. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IProjection); - - /** Projection property. */ - public property?: (google.datastore.v1.IPropertyReference|null); - - /** - * Creates a new Projection instance using the specified properties. - * @param [properties] Properties to set - * @returns Projection instance - */ - public static create(properties?: google.datastore.v1.IProjection): google.datastore.v1.Projection; - - /** - * 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.IProjection, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IProjection, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.Projection; - - /** - * Decodes a Projection message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.Projection; - - /** - * 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 a Projection message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Projection - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Projection; - - /** - * 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.Projection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Projection to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Projection - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PropertyOrder. */ - interface IPropertyOrder { - - /** PropertyOrder property */ - property?: (google.datastore.v1.IPropertyReference|null); - - /** PropertyOrder direction */ - direction?: (google.datastore.v1.PropertyOrder.Direction|keyof typeof google.datastore.v1.PropertyOrder.Direction|null); - } - - /** Represents a PropertyOrder. */ - class PropertyOrder implements IPropertyOrder { - - /** - * Constructs a new PropertyOrder. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IPropertyOrder); - - /** PropertyOrder property. */ - public property?: (google.datastore.v1.IPropertyReference|null); - - /** 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. - * @param [properties] Properties to set - * @returns PropertyOrder instance - */ - public static create(properties?: google.datastore.v1.IPropertyOrder): google.datastore.v1.PropertyOrder; - - /** - * 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.IPropertyOrder, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IPropertyOrder, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.PropertyOrder; - - /** - * Decodes a PropertyOrder message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.PropertyOrder; - - /** - * 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 PropertyOrder message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyOrder - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyOrder; - - /** - * 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.PropertyOrder, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyOrder to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyOrder - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PropertyOrder { - - /** Direction enum. */ - enum Direction { - DIRECTION_UNSPECIFIED = 0, - ASCENDING = 1, - DESCENDING = 2 - } - } - - /** 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 Filter. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IFilter); - - /** 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 Filter instance using the specified properties. - * @param [properties] Properties to set - * @returns Filter instance - */ - public static create(properties?: google.datastore.v1.IFilter): google.datastore.v1.Filter; - - /** - * 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.IFilter, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.Filter; - - /** - * Decodes a Filter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.Filter; - - /** - * 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 Filter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Filter - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Filter; - - /** - * 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.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Filter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Filter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CompositeFilter. */ - interface ICompositeFilter { - - /** CompositeFilter op */ - op?: (google.datastore.v1.CompositeFilter.Operator|keyof typeof google.datastore.v1.CompositeFilter.Operator|null); - - /** CompositeFilter filters */ - filters?: (google.datastore.v1.IFilter[]|null); - } - - /** Represents a CompositeFilter. */ - class CompositeFilter implements ICompositeFilter { - - /** - * Constructs a new CompositeFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ICompositeFilter); - - /** CompositeFilter op. */ - public op: (google.datastore.v1.CompositeFilter.Operator|keyof typeof google.datastore.v1.CompositeFilter.Operator); - - /** CompositeFilter filters. */ - public filters: google.datastore.v1.IFilter[]; - - /** - * Creates a new CompositeFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns CompositeFilter instance - */ - public static create(properties?: google.datastore.v1.ICompositeFilter): google.datastore.v1.CompositeFilter; - - /** - * 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.ICompositeFilter, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.ICompositeFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.CompositeFilter; - - /** - * Decodes a CompositeFilter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.CompositeFilter; - - /** - * 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 CompositeFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CompositeFilter - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.CompositeFilter; - - /** - * 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.CompositeFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CompositeFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CompositeFilter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CompositeFilter { - - /** 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|keyof typeof google.datastore.v1.PropertyFilter.Operator|null); - - /** PropertyFilter value */ - value?: (google.datastore.v1.IValue|null); - } - - /** Represents a PropertyFilter. */ - class PropertyFilter implements IPropertyFilter { - - /** - * Constructs a new PropertyFilter. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IPropertyFilter); - - /** PropertyFilter property. */ - public property?: (google.datastore.v1.IPropertyReference|null); - - /** PropertyFilter op. */ - public op: (google.datastore.v1.PropertyFilter.Operator|keyof typeof google.datastore.v1.PropertyFilter.Operator); - - /** PropertyFilter value. */ - public value?: (google.datastore.v1.IValue|null); - - /** - * Creates a new PropertyFilter instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyFilter instance - */ - public static create(properties?: google.datastore.v1.IPropertyFilter): google.datastore.v1.PropertyFilter; - - /** - * 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.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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.IPropertyFilter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.datastore.v1.PropertyFilter; - - /** - * 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 - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.datastore.v1.PropertyFilter; - - /** - * 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 PropertyFilter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyFilter - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyFilter; - - /** - * 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.PropertyFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyFilter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyFilter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PropertyFilter { - - /** 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 - } - } - - /** Properties of a FindNearest. */ - interface IFindNearest { - - /** FindNearest vectorProperty */ - vectorProperty?: (google.datastore.v1.IPropertyReference|null); - - /** FindNearest queryVector */ - queryVector?: (google.datastore.v1.IValue|null); - - /** FindNearest distanceMeasure */ - distanceMeasure?: (google.datastore.v1.FindNearest.DistanceMeasure|keyof typeof google.datastore.v1.FindNearest.DistanceMeasure|null); - - /** FindNearest limit */ - limit?: (google.protobuf.IInt32Value|null); - - /** FindNearest distanceResultProperty */ - distanceResultProperty?: (string|null); - - /** FindNearest distanceThreshold */ - distanceThreshold?: (google.protobuf.IDoubleValue|null); - } - - /** Represents a FindNearest. */ - class FindNearest implements IFindNearest { - - /** - * Constructs a new FindNearest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IFindNearest); - - /** FindNearest vectorProperty. */ - public vectorProperty?: (google.datastore.v1.IPropertyReference|null); - - /** FindNearest queryVector. */ - public queryVector?: (google.datastore.v1.IValue|null); - - /** FindNearest distanceMeasure. */ - public distanceMeasure: (google.datastore.v1.FindNearest.DistanceMeasure|keyof typeof google.datastore.v1.FindNearest.DistanceMeasure); - - /** FindNearest limit. */ - public limit?: (google.protobuf.IInt32Value|null); - - /** FindNearest distanceResultProperty. */ - public distanceResultProperty: string; - - /** FindNearest distanceThreshold. */ - public distanceThreshold?: (google.protobuf.IDoubleValue|null); - - /** - * Creates a new FindNearest instance using the specified properties. - * @param [properties] Properties to set - * @returns FindNearest instance - */ - public static create(properties?: google.datastore.v1.IFindNearest): google.datastore.v1.FindNearest; - - /** - * Encodes the specified FindNearest message. Does not implicitly {@link google.datastore.v1.FindNearest.verify|verify} messages. - * @param message FindNearest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IFindNearest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FindNearest message, length delimited. Does not implicitly {@link google.datastore.v1.FindNearest.verify|verify} messages. - * @param message FindNearest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IFindNearest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FindNearest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FindNearest - * @throws {Error} If the payload is not 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.FindNearest; - - /** - * Decodes a FindNearest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FindNearest - * @throws {Error} If the payload 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.FindNearest; - - /** - * Verifies a FindNearest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FindNearest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FindNearest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.FindNearest; - - /** - * Creates a plain object from a FindNearest message. Also converts values to other types if specified. - * @param message FindNearest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.FindNearest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FindNearest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FindNearest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FindNearest { - - /** DistanceMeasure enum. */ - enum DistanceMeasure { - DISTANCE_MEASURE_UNSPECIFIED = 0, - EUCLIDEAN = 1, - COSINE = 2, - DOT_PRODUCT = 3 - } - } - - /** 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 GqlQuery. */ - class GqlQuery implements IGqlQuery { - - /** - * Constructs a new GqlQuery. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IGqlQuery); - - /** GqlQuery queryString. */ - public queryString: string; - - /** 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 GqlQuery instance using the specified properties. - * @param [properties] Properties to set - * @returns GqlQuery instance - */ - public static create(properties?: google.datastore.v1.IGqlQuery): google.datastore.v1.GqlQuery; - - /** - * 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.IGqlQuery, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IGqlQuery, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.GqlQuery; - - /** - * Decodes a GqlQuery message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.GqlQuery; - - /** - * 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 GqlQuery message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GqlQuery - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.GqlQuery; - - /** - * 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.GqlQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GqlQuery to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GqlQuery - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GqlQueryParameter. */ - interface IGqlQueryParameter { - - /** GqlQueryParameter value */ - value?: (google.datastore.v1.IValue|null); - - /** GqlQueryParameter cursor */ - cursor?: (Uint8Array|Buffer|string|null); - } - - /** Represents a GqlQueryParameter. */ - class GqlQueryParameter implements IGqlQueryParameter { - - /** - * Constructs a new GqlQueryParameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IGqlQueryParameter); - - /** GqlQueryParameter value. */ - public value?: (google.datastore.v1.IValue|null); - - /** GqlQueryParameter cursor. */ - public cursor?: (Uint8Array|Buffer|string|null); - - /** GqlQueryParameter parameterType. */ - public parameterType?: ("value"|"cursor"); - - /** - * Creates a new GqlQueryParameter instance using the specified properties. - * @param [properties] Properties to set - * @returns GqlQueryParameter instance - */ - public static create(properties?: google.datastore.v1.IGqlQueryParameter): google.datastore.v1.GqlQueryParameter; - - /** - * 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.IGqlQueryParameter, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IGqlQueryParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.GqlQueryParameter; - - /** - * Decodes a GqlQueryParameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.GqlQueryParameter; - - /** - * 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 GqlQueryParameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GqlQueryParameter - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.GqlQueryParameter; - - /** - * 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.GqlQueryParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GqlQueryParameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GqlQueryParameter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a QueryResultBatch. */ - interface IQueryResultBatch { - - /** QueryResultBatch skippedResults */ - skippedResults?: (number|null); - - /** QueryResultBatch skippedCursor */ - skippedCursor?: (Uint8Array|Buffer|string|null); - - /** QueryResultBatch entityResultType */ - 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|Buffer|string|null); - - /** QueryResultBatch moreResults */ - moreResults?: (google.datastore.v1.QueryResultBatch.MoreResultsType|keyof typeof google.datastore.v1.QueryResultBatch.MoreResultsType|null); - - /** QueryResultBatch snapshotVersion */ - snapshotVersion?: (number|Long|string|null); - - /** QueryResultBatch readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a QueryResultBatch. */ - class QueryResultBatch implements IQueryResultBatch { - - /** - * Constructs a new QueryResultBatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IQueryResultBatch); - - /** QueryResultBatch skippedResults. */ - public skippedResults: number; - - /** QueryResultBatch skippedCursor. */ - public skippedCursor: (Uint8Array|Buffer|string); - - /** QueryResultBatch entityResultType. */ - 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|Buffer|string); - - /** QueryResultBatch moreResults. */ - public moreResults: (google.datastore.v1.QueryResultBatch.MoreResultsType|keyof typeof google.datastore.v1.QueryResultBatch.MoreResultsType); - - /** QueryResultBatch snapshotVersion. */ - public snapshotVersion: (number|Long|string); - - /** QueryResultBatch readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new QueryResultBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryResultBatch instance - */ - public static create(properties?: google.datastore.v1.IQueryResultBatch): google.datastore.v1.QueryResultBatch; - - /** - * 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.IQueryResultBatch, 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 - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IQueryResultBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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.QueryResultBatch; - - /** - * Decodes a QueryResultBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @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.QueryResultBatch; - - /** - * 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 QueryResultBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryResultBatch - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.QueryResultBatch; - - /** - * 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.QueryResultBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QueryResultBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for QueryResultBatch - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - 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 - } - } - - /** Represents a Datastore */ - class Datastore extends $protobuf.rpc.Service { - - /** - * 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); - - /** - * 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; - - /** - * 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; - - /** - * Calls Lookup. - * @param request LookupRequest message or plain object - * @returns Promise - */ - public lookup(request: google.datastore.v1.ILookupRequest): Promise; - - /** - * 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; - - /** - * Calls RunQuery. - * @param request RunQueryRequest message or plain object - * @returns Promise - */ - public runQuery(request: google.datastore.v1.IRunQueryRequest): Promise; - - /** - * 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; - - /** - * Calls RunAggregationQuery. - * @param request RunAggregationQueryRequest message or plain object - * @returns Promise - */ - public runAggregationQuery(request: google.datastore.v1.IRunAggregationQueryRequest): Promise; - - /** - * 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; - - /** - * Calls BeginTransaction. - * @param request BeginTransactionRequest message or plain object - * @returns Promise - */ - public beginTransaction(request: google.datastore.v1.IBeginTransactionRequest): Promise; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CommitResponse - */ - public commit(request: google.datastore.v1.ICommitRequest, callback: google.datastore.v1.Datastore.CommitCallback): void; - - /** - * Calls Commit. - * @param request CommitRequest message or plain object - * @returns Promise - */ - public commit(request: google.datastore.v1.ICommitRequest): Promise; - - /** - * 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; - - /** - * Calls Rollback. - * @param request RollbackRequest message or plain object - * @returns Promise - */ - public rollback(request: google.datastore.v1.IRollbackRequest): Promise; - - /** - * 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; - - /** - * Calls AllocateIds. - * @param request AllocateIdsRequest message or plain object - * @returns Promise - */ - public allocateIds(request: google.datastore.v1.IAllocateIdsRequest): Promise; - - /** - * 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; - - /** - * Calls ReserveIds. - * @param request ReserveIdsRequest message or plain object - * @returns Promise - */ - public reserveIds(request: google.datastore.v1.IReserveIdsRequest): Promise; - } - - namespace Datastore { - - /** - * 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 LookupRequest. */ - interface ILookupRequest { - - /** LookupRequest projectId */ - projectId?: (string|null); - - /** LookupRequest databaseId */ - databaseId?: (string|null); - - /** LookupRequest readOptions */ - readOptions?: (google.datastore.v1.IReadOptions|null); - - /** LookupRequest keys */ - keys?: (google.datastore.v1.IKey[]|null); - - /** LookupRequest propertyMask */ - propertyMask?: (google.datastore.v1.IPropertyMask|null); - } - - /** Represents a LookupRequest. */ - class LookupRequest implements ILookupRequest { - - /** - * Constructs a new LookupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ILookupRequest); - - /** LookupRequest projectId. */ - public projectId: string; - - /** LookupRequest databaseId. */ - public databaseId: string; - - /** LookupRequest readOptions. */ - public readOptions?: (google.datastore.v1.IReadOptions|null); - - /** LookupRequest keys. */ - public keys: google.datastore.v1.IKey[]; - - /** LookupRequest propertyMask. */ - public propertyMask?: (google.datastore.v1.IPropertyMask|null); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 LookupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LookupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a LookupResponse. */ - interface ILookupResponse { - - /** LookupResponse found */ - found?: (google.datastore.v1.IEntityResult[]|null); - - /** LookupResponse missing */ - missing?: (google.datastore.v1.IEntityResult[]|null); - - /** LookupResponse deferred */ - deferred?: (google.datastore.v1.IKey[]|null); - - /** LookupResponse transaction */ - transaction?: (Uint8Array|Buffer|string|null); - - /** LookupResponse readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a LookupResponse. */ - class LookupResponse implements ILookupResponse { - - /** - * Constructs a new LookupResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ILookupResponse); - - /** LookupResponse found. */ - public found: google.datastore.v1.IEntityResult[]; - - /** LookupResponse missing. */ - public missing: google.datastore.v1.IEntityResult[]; - - /** LookupResponse deferred. */ - public deferred: google.datastore.v1.IKey[]; - - /** LookupResponse transaction. */ - public transaction: (Uint8Array|Buffer|string); - - /** LookupResponse readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** - * 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 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 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 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 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 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 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 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 LookupResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LookupResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunQueryRequest. */ - interface IRunQueryRequest { - - /** RunQueryRequest projectId */ - projectId?: (string|null); - - /** RunQueryRequest databaseId */ - databaseId?: (string|null); - - /** RunQueryRequest partitionId */ - partitionId?: (google.datastore.v1.IPartitionId|null); - - /** RunQueryRequest readOptions */ - readOptions?: (google.datastore.v1.IReadOptions|null); - - /** RunQueryRequest query */ - query?: (google.datastore.v1.IQuery|null); - - /** RunQueryRequest gqlQuery */ - gqlQuery?: (google.datastore.v1.IGqlQuery|null); - - /** RunQueryRequest propertyMask */ - propertyMask?: (google.datastore.v1.IPropertyMask|null); - - /** RunQueryRequest explainOptions */ - explainOptions?: (google.datastore.v1.IExplainOptions|null); - } - - /** Represents a RunQueryRequest. */ - class RunQueryRequest implements IRunQueryRequest { - - /** - * Constructs a new RunQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRunQueryRequest); - - /** RunQueryRequest projectId. */ - public projectId: string; - - /** RunQueryRequest databaseId. */ - public databaseId: string; - - /** RunQueryRequest partitionId. */ - public partitionId?: (google.datastore.v1.IPartitionId|null); - - /** RunQueryRequest readOptions. */ - public readOptions?: (google.datastore.v1.IReadOptions|null); - - /** RunQueryRequest query. */ - public query?: (google.datastore.v1.IQuery|null); - - /** RunQueryRequest gqlQuery. */ - public gqlQuery?: (google.datastore.v1.IGqlQuery|null); - - /** RunQueryRequest propertyMask. */ - public propertyMask?: (google.datastore.v1.IPropertyMask|null); - - /** RunQueryRequest explainOptions. */ - public explainOptions?: (google.datastore.v1.IExplainOptions|null); - - /** RunQueryRequest queryType. */ - public queryType?: ("query"|"gqlQuery"); - - /** - * 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 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 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 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 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 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 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 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 RunQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunQueryRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunQueryResponse. */ - interface IRunQueryResponse { - - /** RunQueryResponse batch */ - batch?: (google.datastore.v1.IQueryResultBatch|null); - - /** RunQueryResponse query */ - query?: (google.datastore.v1.IQuery|null); - - /** RunQueryResponse transaction */ - transaction?: (Uint8Array|Buffer|string|null); - - /** RunQueryResponse explainMetrics */ - explainMetrics?: (google.datastore.v1.IExplainMetrics|null); - } - - /** Represents a RunQueryResponse. */ - class RunQueryResponse implements IRunQueryResponse { - - /** - * Constructs a new RunQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRunQueryResponse); - - /** RunQueryResponse batch. */ - public batch?: (google.datastore.v1.IQueryResultBatch|null); - - /** RunQueryResponse query. */ - public query?: (google.datastore.v1.IQuery|null); - - /** RunQueryResponse transaction. */ - public transaction: (Uint8Array|Buffer|string); - - /** RunQueryResponse explainMetrics. */ - public explainMetrics?: (google.datastore.v1.IExplainMetrics|null); - - /** - * 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 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 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 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 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 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 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 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 RunQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunQueryResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunAggregationQueryRequest. */ - interface IRunAggregationQueryRequest { - - /** RunAggregationQueryRequest projectId */ - projectId?: (string|null); - - /** RunAggregationQueryRequest databaseId */ - databaseId?: (string|null); - - /** RunAggregationQueryRequest partitionId */ - partitionId?: (google.datastore.v1.IPartitionId|null); - - /** RunAggregationQueryRequest readOptions */ - readOptions?: (google.datastore.v1.IReadOptions|null); - - /** RunAggregationQueryRequest aggregationQuery */ - aggregationQuery?: (google.datastore.v1.IAggregationQuery|null); - - /** RunAggregationQueryRequest gqlQuery */ - gqlQuery?: (google.datastore.v1.IGqlQuery|null); - - /** RunAggregationQueryRequest explainOptions */ - explainOptions?: (google.datastore.v1.IExplainOptions|null); - } - - /** Represents a RunAggregationQueryRequest. */ - class RunAggregationQueryRequest implements IRunAggregationQueryRequest { - - /** - * Constructs a new RunAggregationQueryRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRunAggregationQueryRequest); - - /** RunAggregationQueryRequest projectId. */ - public projectId: string; - - /** RunAggregationQueryRequest databaseId. */ - public databaseId: string; - - /** RunAggregationQueryRequest partitionId. */ - public partitionId?: (google.datastore.v1.IPartitionId|null); - - /** RunAggregationQueryRequest readOptions. */ - public readOptions?: (google.datastore.v1.IReadOptions|null); - - /** RunAggregationQueryRequest aggregationQuery. */ - public aggregationQuery?: (google.datastore.v1.IAggregationQuery|null); - - /** RunAggregationQueryRequest gqlQuery. */ - public gqlQuery?: (google.datastore.v1.IGqlQuery|null); - - /** RunAggregationQueryRequest explainOptions. */ - public explainOptions?: (google.datastore.v1.IExplainOptions|null); - - /** RunAggregationQueryRequest queryType. */ - public queryType?: ("aggregationQuery"|"gqlQuery"); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this RunAggregationQueryRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunAggregationQueryRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RunAggregationQueryResponse. */ - interface IRunAggregationQueryResponse { - - /** RunAggregationQueryResponse batch */ - batch?: (google.datastore.v1.IAggregationResultBatch|null); - - /** RunAggregationQueryResponse query */ - query?: (google.datastore.v1.IAggregationQuery|null); - - /** RunAggregationQueryResponse transaction */ - transaction?: (Uint8Array|Buffer|string|null); - - /** RunAggregationQueryResponse explainMetrics */ - explainMetrics?: (google.datastore.v1.IExplainMetrics|null); - } - - /** Represents a RunAggregationQueryResponse. */ - class RunAggregationQueryResponse implements IRunAggregationQueryResponse { - - /** - * Constructs a new RunAggregationQueryResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRunAggregationQueryResponse); - - /** RunAggregationQueryResponse batch. */ - public batch?: (google.datastore.v1.IAggregationResultBatch|null); - - /** RunAggregationQueryResponse query. */ - public query?: (google.datastore.v1.IAggregationQuery|null); - - /** RunAggregationQueryResponse transaction. */ - public transaction: (Uint8Array|Buffer|string); - - /** RunAggregationQueryResponse explainMetrics. */ - public explainMetrics?: (google.datastore.v1.IExplainMetrics|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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this RunAggregationQueryResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RunAggregationQueryResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BeginTransactionRequest. */ - interface IBeginTransactionRequest { - - /** BeginTransactionRequest projectId */ - projectId?: (string|null); - - /** BeginTransactionRequest databaseId */ - databaseId?: (string|null); - - /** BeginTransactionRequest transactionOptions */ - transactionOptions?: (google.datastore.v1.ITransactionOptions|null); - } - - /** Represents a BeginTransactionRequest. */ - class BeginTransactionRequest implements IBeginTransactionRequest { - - /** - * Constructs a new BeginTransactionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IBeginTransactionRequest); - - /** BeginTransactionRequest projectId. */ - public projectId: string; - - /** BeginTransactionRequest databaseId. */ - public databaseId: string; - - /** BeginTransactionRequest transactionOptions. */ - public transactionOptions?: (google.datastore.v1.ITransactionOptions|null); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * Verifies a BeginTransactionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BeginTransactionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BeginTransactionRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.BeginTransactionRequest; - - /** - * Creates a plain object from a BeginTransactionRequest message. Also converts values to other types if specified. - * @param message BeginTransactionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.BeginTransactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BeginTransactionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BeginTransactionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BeginTransactionResponse. */ - interface IBeginTransactionResponse { - - /** BeginTransactionResponse transaction */ - transaction?: (Uint8Array|Buffer|string|null); - } - - /** Represents a BeginTransactionResponse. */ - class BeginTransactionResponse implements IBeginTransactionResponse { - - /** - * Constructs a new BeginTransactionResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IBeginTransactionResponse); - - /** BeginTransactionResponse transaction. */ - public transaction: (Uint8Array|Buffer|string); - - /** - * 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 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; - - /** - * 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 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; - - /** - * 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; - - /** - * 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 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 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 BeginTransactionResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BeginTransactionResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RollbackRequest. */ - interface IRollbackRequest { - - /** RollbackRequest projectId */ - projectId?: (string|null); - - /** RollbackRequest databaseId */ - databaseId?: (string|null); - - /** RollbackRequest transaction */ - transaction?: (Uint8Array|Buffer|string|null); - } - - /** Represents a RollbackRequest. */ - class RollbackRequest implements IRollbackRequest { - - /** - * Constructs a new RollbackRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRollbackRequest); - - /** RollbackRequest projectId. */ - public projectId: string; - - /** RollbackRequest databaseId. */ - public databaseId: string; - - /** RollbackRequest transaction. */ - public transaction: (Uint8Array|Buffer|string); - - /** - * Creates a new RollbackRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RollbackRequest instance - */ - public static create(properties?: google.datastore.v1.IRollbackRequest): google.datastore.v1.RollbackRequest; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * Verifies a RollbackRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RollbackRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RollbackRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.RollbackRequest; - - /** - * Creates a plain object from a RollbackRequest message. Also converts values to other types if specified. - * @param message RollbackRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.RollbackRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RollbackRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RollbackRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RollbackResponse. */ - interface IRollbackResponse { - } - - /** Represents a RollbackResponse. */ - class RollbackResponse implements IRollbackResponse { - - /** - * Constructs a new RollbackResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IRollbackResponse); - - /** - * 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 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 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 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 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 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 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 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 }; - - /** - * Gets the default type url for RollbackResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommitRequest. */ - interface ICommitRequest { - - /** CommitRequest projectId */ - projectId?: (string|null); - - /** CommitRequest databaseId */ - databaseId?: (string|null); - - /** CommitRequest mode */ - mode?: (google.datastore.v1.CommitRequest.Mode|keyof typeof google.datastore.v1.CommitRequest.Mode|null); - - /** CommitRequest transaction */ - transaction?: (Uint8Array|Buffer|string|null); - - /** CommitRequest singleUseTransaction */ - singleUseTransaction?: (google.datastore.v1.ITransactionOptions|null); - - /** CommitRequest mutations */ - mutations?: (google.datastore.v1.IMutation[]|null); - } - - /** Represents a CommitRequest. */ - class CommitRequest implements ICommitRequest { - - /** - * Constructs a new CommitRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ICommitRequest); - - /** CommitRequest projectId. */ - public projectId: string; - - /** CommitRequest databaseId. */ - public databaseId: string; - - /** CommitRequest mode. */ - public mode: (google.datastore.v1.CommitRequest.Mode|keyof typeof google.datastore.v1.CommitRequest.Mode); - - /** CommitRequest transaction. */ - public transaction?: (Uint8Array|Buffer|string|null); - - /** CommitRequest singleUseTransaction. */ - public singleUseTransaction?: (google.datastore.v1.ITransactionOptions|null); - - /** CommitRequest mutations. */ - public mutations: google.datastore.v1.IMutation[]; - - /** CommitRequest transactionSelector. */ - public transactionSelector?: ("transaction"|"singleUseTransaction"); - - /** - * 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 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; - - /** - * 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 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; - - /** - * 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; - - /** - * Verifies a CommitRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitRequest - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.CommitRequest; - - /** - * Creates a plain object from a CommitRequest message. Also converts values to other types if specified. - * @param message CommitRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.CommitRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommitRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CommitRequest { - - /** Mode enum. */ - enum Mode { - MODE_UNSPECIFIED = 0, - TRANSACTIONAL = 1, - NON_TRANSACTIONAL = 2 - } - } - - /** 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 CommitResponse. */ - class CommitResponse implements ICommitResponse { - - /** - * Constructs a new CommitResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ICommitResponse); - - /** CommitResponse mutationResults. */ - public mutationResults: google.datastore.v1.IMutationResult[]; - - /** CommitResponse indexUpdates. */ - public indexUpdates: number; - - /** CommitResponse commitTime. */ - public commitTime?: (google.protobuf.ITimestamp|null); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * Verifies a CommitResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommitResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommitResponse - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.CommitResponse; - - /** - * Creates a plain object from a CommitResponse message. Also converts values to other types if specified. - * @param message CommitResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.CommitResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommitResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommitResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AllocateIdsRequest. */ - interface IAllocateIdsRequest { - - /** AllocateIdsRequest projectId */ - projectId?: (string|null); - - /** AllocateIdsRequest databaseId */ - databaseId?: (string|null); - - /** AllocateIdsRequest keys */ - keys?: (google.datastore.v1.IKey[]|null); - } - - /** Represents an AllocateIdsRequest. */ - class AllocateIdsRequest implements IAllocateIdsRequest { - - /** - * Constructs a new AllocateIdsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IAllocateIdsRequest); - - /** AllocateIdsRequest projectId. */ - public projectId: string; - - /** AllocateIdsRequest databaseId. */ - public databaseId: string; - - /** AllocateIdsRequest keys. */ - public keys: google.datastore.v1.IKey[]; - - /** - * 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.datastore.v1.IAllocateIdsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * 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 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this AllocateIdsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllocateIdsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AllocateIdsResponse. */ - interface IAllocateIdsResponse { - - /** AllocateIdsResponse keys */ - keys?: (google.datastore.v1.IKey[]|null); - } - - /** Represents an AllocateIdsResponse. */ - class AllocateIdsResponse implements IAllocateIdsResponse { - - /** - * Constructs a new AllocateIdsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IAllocateIdsResponse); - - /** AllocateIdsResponse keys. */ - public keys: google.datastore.v1.IKey[]; - - /** - * 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 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; - - /** - * 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 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 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 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 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 AllocateIdsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllocateIdsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReserveIdsRequest. */ - interface IReserveIdsRequest { - - /** ReserveIdsRequest projectId */ - projectId?: (string|null); - - /** ReserveIdsRequest databaseId */ - databaseId?: (string|null); - - /** ReserveIdsRequest keys */ - keys?: (google.datastore.v1.IKey[]|null); - } - - /** Represents a ReserveIdsRequest. */ - class ReserveIdsRequest implements IReserveIdsRequest { - - /** - * Constructs a new ReserveIdsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IReserveIdsRequest); - - /** ReserveIdsRequest projectId. */ - public projectId: string; - - /** ReserveIdsRequest databaseId. */ - public databaseId: string; - - /** ReserveIdsRequest keys. */ - public keys: google.datastore.v1.IKey[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ReserveIdsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReserveIdsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReserveIdsResponse. */ - interface IReserveIdsResponse { - } - - /** Represents a ReserveIdsResponse. */ - class ReserveIdsResponse implements IReserveIdsResponse { - - /** - * Constructs a new ReserveIdsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IReserveIdsResponse); - - /** - * 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 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 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 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 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 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 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 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 ReserveIdsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReserveIdsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Mutation. */ - interface IMutation { - - /** Mutation insert */ - insert?: (google.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); - - /** Mutation baseVersion */ - baseVersion?: (number|Long|string|null); - - /** Mutation updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Mutation conflictResolutionStrategy */ - conflictResolutionStrategy?: (google.datastore.v1.Mutation.ConflictResolutionStrategy|keyof typeof google.datastore.v1.Mutation.ConflictResolutionStrategy|null); - - /** Mutation propertyMask */ - propertyMask?: (google.datastore.v1.IPropertyMask|null); - - /** Mutation propertyTransforms */ - propertyTransforms?: (google.datastore.v1.IPropertyTransform[]|null); - } - - /** Represents a Mutation. */ - class Mutation implements IMutation { - - /** - * Constructs a new Mutation. - * @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); - - /** Mutation conflictResolutionStrategy. */ - public conflictResolutionStrategy: (google.datastore.v1.Mutation.ConflictResolutionStrategy|keyof typeof google.datastore.v1.Mutation.ConflictResolutionStrategy); - - /** Mutation propertyMask. */ - public propertyMask?: (google.datastore.v1.IPropertyMask|null); - - /** Mutation propertyTransforms. */ - public propertyTransforms: google.datastore.v1.IPropertyTransform[]; - - /** Mutation operation. */ - public operation?: ("insert"|"update"|"upsert"|"delete"); - - /** Mutation conflictDetectionStrategy. */ - public conflictDetectionStrategy?: ("baseVersion"|"updateTime"); - - /** - * 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 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 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 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 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 a Mutation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Mutation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Mutation - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.Mutation; - - /** - * Creates a plain object from a Mutation message. Also converts values to other types if specified. - * @param message Mutation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.Mutation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Mutation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Mutation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Mutation { - - /** ConflictResolutionStrategy enum. */ - enum ConflictResolutionStrategy { - STRATEGY_UNSPECIFIED = 0, - SERVER_VALUE = 1, - FAIL = 3 - } - } - - /** Properties of a PropertyTransform. */ - interface IPropertyTransform { - - /** PropertyTransform property */ - property?: (string|null); - - /** PropertyTransform setToServerValue */ - setToServerValue?: (google.datastore.v1.PropertyTransform.ServerValue|keyof typeof google.datastore.v1.PropertyTransform.ServerValue|null); - - /** PropertyTransform increment */ - increment?: (google.datastore.v1.IValue|null); - - /** PropertyTransform maximum */ - maximum?: (google.datastore.v1.IValue|null); - - /** PropertyTransform minimum */ - minimum?: (google.datastore.v1.IValue|null); - - /** PropertyTransform appendMissingElements */ - appendMissingElements?: (google.datastore.v1.IArrayValue|null); - - /** PropertyTransform removeAllFromArray */ - removeAllFromArray?: (google.datastore.v1.IArrayValue|null); - } - - /** Represents a PropertyTransform. */ - class PropertyTransform implements IPropertyTransform { - - /** - * Constructs a new PropertyTransform. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IPropertyTransform); - - /** PropertyTransform property. */ - public property: string; - - /** PropertyTransform setToServerValue. */ - public setToServerValue?: (google.datastore.v1.PropertyTransform.ServerValue|keyof typeof google.datastore.v1.PropertyTransform.ServerValue|null); - - /** PropertyTransform increment. */ - public increment?: (google.datastore.v1.IValue|null); - - /** PropertyTransform maximum. */ - public maximum?: (google.datastore.v1.IValue|null); - - /** PropertyTransform minimum. */ - public minimum?: (google.datastore.v1.IValue|null); - - /** PropertyTransform appendMissingElements. */ - public appendMissingElements?: (google.datastore.v1.IArrayValue|null); - - /** PropertyTransform removeAllFromArray. */ - public removeAllFromArray?: (google.datastore.v1.IArrayValue|null); - - /** PropertyTransform transformType. */ - public transformType?: ("setToServerValue"|"increment"|"maximum"|"minimum"|"appendMissingElements"|"removeAllFromArray"); - - /** - * Creates a new PropertyTransform instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyTransform instance - */ - public static create(properties?: google.datastore.v1.IPropertyTransform): google.datastore.v1.PropertyTransform; - - /** - * Encodes the specified PropertyTransform message. Does not implicitly {@link google.datastore.v1.PropertyTransform.verify|verify} messages. - * @param message PropertyTransform message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IPropertyTransform, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PropertyTransform message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyTransform.verify|verify} messages. - * @param message PropertyTransform message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IPropertyTransform, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PropertyTransform message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PropertyTransform - * @throws {Error} If the payload is not 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.PropertyTransform; - - /** - * Decodes a PropertyTransform message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PropertyTransform - * @throws {Error} If the payload 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.PropertyTransform; - - /** - * Verifies a PropertyTransform message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PropertyTransform message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyTransform - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyTransform; - - /** - * Creates a plain object from a PropertyTransform message. Also converts values to other types if specified. - * @param message PropertyTransform - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.PropertyTransform, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyTransform to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyTransform - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PropertyTransform { - - /** ServerValue enum. */ - enum ServerValue { - SERVER_VALUE_UNSPECIFIED = 0, - REQUEST_TIME = 1 - } - } - - /** Properties of a MutationResult. */ - interface IMutationResult { - - /** MutationResult key */ - key?: (google.datastore.v1.IKey|null); - - /** MutationResult version */ - version?: (number|Long|string|null); - - /** MutationResult createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** MutationResult updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** MutationResult conflictDetected */ - conflictDetected?: (boolean|null); - - /** MutationResult transformResults */ - transformResults?: (google.datastore.v1.IValue[]|null); - } - - /** Represents a MutationResult. */ - class MutationResult implements IMutationResult { - - /** - * Constructs a new MutationResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IMutationResult); - - /** MutationResult key. */ - public key?: (google.datastore.v1.IKey|null); - - /** MutationResult version. */ - public version: (number|Long|string); - - /** MutationResult createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** MutationResult updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** MutationResult conflictDetected. */ - public conflictDetected: boolean; - - /** MutationResult transformResults. */ - public transformResults: google.datastore.v1.IValue[]; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this MutationResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MutationResult - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PropertyMask. */ - interface IPropertyMask { - - /** PropertyMask paths */ - paths?: (string[]|null); - } - - /** Represents a PropertyMask. */ - class PropertyMask implements IPropertyMask { - - /** - * Constructs a new PropertyMask. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IPropertyMask); - - /** PropertyMask paths. */ - public paths: string[]; - - /** - * Creates a new PropertyMask instance using the specified properties. - * @param [properties] Properties to set - * @returns PropertyMask instance - */ - public static create(properties?: google.datastore.v1.IPropertyMask): google.datastore.v1.PropertyMask; - - /** - * Encodes the specified PropertyMask message. Does not implicitly {@link google.datastore.v1.PropertyMask.verify|verify} messages. - * @param message PropertyMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IPropertyMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PropertyMask message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyMask.verify|verify} messages. - * @param message PropertyMask message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IPropertyMask, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PropertyMask message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PropertyMask - * @throws {Error} If the payload is not 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.PropertyMask; - - /** - * Decodes a PropertyMask message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PropertyMask - * @throws {Error} If the payload 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.PropertyMask; - - /** - * Verifies a PropertyMask message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PropertyMask message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PropertyMask - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PropertyMask; - - /** - * Creates a plain object from a PropertyMask message. Also converts values to other types if specified. - * @param message PropertyMask - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.PropertyMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PropertyMask to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PropertyMask - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReadOptions. */ - interface IReadOptions { - - /** ReadOptions readConsistency */ - readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|keyof typeof google.datastore.v1.ReadOptions.ReadConsistency|null); - - /** ReadOptions transaction */ - transaction?: (Uint8Array|Buffer|string|null); - - /** ReadOptions newTransaction */ - newTransaction?: (google.datastore.v1.ITransactionOptions|null); - - /** ReadOptions readTime */ - readTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a ReadOptions. */ - class ReadOptions implements IReadOptions { - - /** - * Constructs a new ReadOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IReadOptions); - - /** ReadOptions readConsistency. */ - public readConsistency?: (google.datastore.v1.ReadOptions.ReadConsistency|keyof typeof google.datastore.v1.ReadOptions.ReadConsistency|null); - - /** ReadOptions transaction. */ - public transaction?: (Uint8Array|Buffer|string|null); - - /** ReadOptions newTransaction. */ - public newTransaction?: (google.datastore.v1.ITransactionOptions|null); - - /** ReadOptions readTime. */ - public readTime?: (google.protobuf.ITimestamp|null); - - /** ReadOptions consistencyType. */ - public consistencyType?: ("readConsistency"|"transaction"|"newTransaction"|"readTime"); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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); - - /** - * 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; - - /** - * 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 }; - - /** - * Converts this ReadOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ReadOptions { - - /** ReadConsistency enum. */ - enum ReadConsistency { - READ_CONSISTENCY_UNSPECIFIED = 0, - STRONG = 1, - EVENTUAL = 2 - } - } - - /** Properties of a TransactionOptions. */ - interface ITransactionOptions { - - /** TransactionOptions readWrite */ - readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); - - /** TransactionOptions readOnly */ - readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); - } - - /** Represents a TransactionOptions. */ - class TransactionOptions implements ITransactionOptions { - - /** - * Constructs a new TransactionOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.ITransactionOptions); - - /** TransactionOptions readWrite. */ - public readWrite?: (google.datastore.v1.TransactionOptions.IReadWrite|null); - - /** TransactionOptions readOnly. */ - public readOnly?: (google.datastore.v1.TransactionOptions.IReadOnly|null); - - /** TransactionOptions mode. */ - public mode?: ("readWrite"|"readOnly"); - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * Verifies a TransactionOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TransactionOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TransactionOptions - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.TransactionOptions; - - /** - * Creates a plain object from a TransactionOptions message. Also converts values to other types if specified. - * @param message TransactionOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.TransactionOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TransactionOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TransactionOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace TransactionOptions { - - /** Properties of a ReadWrite. */ - interface IReadWrite { - - /** ReadWrite previousTransaction */ - previousTransaction?: (Uint8Array|Buffer|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|Buffer|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 }; - - /** - * Gets the default type url for ReadWrite - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** 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 }; - - /** - * Converts this ReadOnly to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReadOnly - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExplainOptions. */ - interface IExplainOptions { - - /** ExplainOptions analyze */ - analyze?: (boolean|null); - } - - /** Represents an ExplainOptions. */ - class ExplainOptions implements IExplainOptions { - - /** - * Constructs a new ExplainOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IExplainOptions); - - /** ExplainOptions analyze. */ - public analyze: boolean; - - /** - * Creates a new ExplainOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExplainOptions instance - */ - public static create(properties?: google.datastore.v1.IExplainOptions): google.datastore.v1.ExplainOptions; - - /** - * Encodes the specified ExplainOptions message. Does not implicitly {@link google.datastore.v1.ExplainOptions.verify|verify} messages. - * @param message ExplainOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IExplainOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExplainOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ExplainOptions.verify|verify} messages. - * @param message ExplainOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IExplainOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExplainOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExplainOptions - * @throws {Error} If the payload is not 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.ExplainOptions; - - /** - * Decodes an ExplainOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExplainOptions - * @throws {Error} If the payload 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.ExplainOptions; - - /** - * Verifies an ExplainOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExplainOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExplainOptions - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ExplainOptions; - - /** - * Creates a plain object from an ExplainOptions message. Also converts values to other types if specified. - * @param message ExplainOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.ExplainOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExplainOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExplainOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExplainMetrics. */ - interface IExplainMetrics { - - /** ExplainMetrics planSummary */ - planSummary?: (google.datastore.v1.IPlanSummary|null); - - /** ExplainMetrics executionStats */ - executionStats?: (google.datastore.v1.IExecutionStats|null); - } - - /** Represents an ExplainMetrics. */ - class ExplainMetrics implements IExplainMetrics { - - /** - * Constructs a new ExplainMetrics. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IExplainMetrics); - - /** ExplainMetrics planSummary. */ - public planSummary?: (google.datastore.v1.IPlanSummary|null); - - /** ExplainMetrics executionStats. */ - public executionStats?: (google.datastore.v1.IExecutionStats|null); - - /** - * Creates a new ExplainMetrics instance using the specified properties. - * @param [properties] Properties to set - * @returns ExplainMetrics instance - */ - public static create(properties?: google.datastore.v1.IExplainMetrics): google.datastore.v1.ExplainMetrics; - - /** - * Encodes the specified ExplainMetrics message. Does not implicitly {@link google.datastore.v1.ExplainMetrics.verify|verify} messages. - * @param message ExplainMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IExplainMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExplainMetrics message, length delimited. Does not implicitly {@link google.datastore.v1.ExplainMetrics.verify|verify} messages. - * @param message ExplainMetrics message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IExplainMetrics, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExplainMetrics message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExplainMetrics - * @throws {Error} If the payload is not 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.ExplainMetrics; - - /** - * Decodes an ExplainMetrics message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExplainMetrics - * @throws {Error} If the payload 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.ExplainMetrics; - - /** - * Verifies an ExplainMetrics message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExplainMetrics message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExplainMetrics - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ExplainMetrics; - - /** - * Creates a plain object from an ExplainMetrics message. Also converts values to other types if specified. - * @param message ExplainMetrics - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.ExplainMetrics, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExplainMetrics to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExplainMetrics - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PlanSummary. */ - interface IPlanSummary { - - /** PlanSummary indexesUsed */ - indexesUsed?: (google.protobuf.IStruct[]|null); - } - - /** Represents a PlanSummary. */ - class PlanSummary implements IPlanSummary { - - /** - * Constructs a new PlanSummary. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IPlanSummary); - - /** PlanSummary indexesUsed. */ - public indexesUsed: google.protobuf.IStruct[]; - - /** - * Creates a new PlanSummary instance using the specified properties. - * @param [properties] Properties to set - * @returns PlanSummary instance - */ - public static create(properties?: google.datastore.v1.IPlanSummary): google.datastore.v1.PlanSummary; - - /** - * Encodes the specified PlanSummary message. Does not implicitly {@link google.datastore.v1.PlanSummary.verify|verify} messages. - * @param message PlanSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IPlanSummary, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PlanSummary message, length delimited. Does not implicitly {@link google.datastore.v1.PlanSummary.verify|verify} messages. - * @param message PlanSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IPlanSummary, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PlanSummary message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PlanSummary - * @throws {Error} If the payload is not 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.PlanSummary; - - /** - * Decodes a PlanSummary message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PlanSummary - * @throws {Error} If the payload 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.PlanSummary; - - /** - * Verifies a PlanSummary message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PlanSummary message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PlanSummary - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.PlanSummary; - - /** - * Creates a plain object from a PlanSummary message. Also converts values to other types if specified. - * @param message PlanSummary - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.PlanSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PlanSummary to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PlanSummary - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an ExecutionStats. */ - interface IExecutionStats { - - /** ExecutionStats resultsReturned */ - resultsReturned?: (number|Long|string|null); - - /** ExecutionStats executionDuration */ - executionDuration?: (google.protobuf.IDuration|null); - - /** ExecutionStats readOperations */ - readOperations?: (number|Long|string|null); - - /** ExecutionStats debugStats */ - debugStats?: (google.protobuf.IStruct|null); - } - - /** Represents an ExecutionStats. */ - class ExecutionStats implements IExecutionStats { - - /** - * Constructs a new ExecutionStats. - * @param [properties] Properties to set - */ - constructor(properties?: google.datastore.v1.IExecutionStats); - - /** ExecutionStats resultsReturned. */ - public resultsReturned: (number|Long|string); - - /** ExecutionStats executionDuration. */ - public executionDuration?: (google.protobuf.IDuration|null); - - /** ExecutionStats readOperations. */ - public readOperations: (number|Long|string); - - /** ExecutionStats debugStats. */ - public debugStats?: (google.protobuf.IStruct|null); - - /** - * Creates a new ExecutionStats instance using the specified properties. - * @param [properties] Properties to set - * @returns ExecutionStats instance - */ - public static create(properties?: google.datastore.v1.IExecutionStats): google.datastore.v1.ExecutionStats; - - /** - * Encodes the specified ExecutionStats message. Does not implicitly {@link google.datastore.v1.ExecutionStats.verify|verify} messages. - * @param message ExecutionStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.datastore.v1.IExecutionStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExecutionStats message, length delimited. Does not implicitly {@link google.datastore.v1.ExecutionStats.verify|verify} messages. - * @param message ExecutionStats message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.datastore.v1.IExecutionStats, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExecutionStats message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExecutionStats - * @throws {Error} If the payload is not 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.ExecutionStats; - - /** - * Decodes an ExecutionStats message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExecutionStats - * @throws {Error} If the payload 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.ExecutionStats; - - /** - * Verifies an ExecutionStats message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExecutionStats message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExecutionStats - */ - public static fromObject(object: { [k: string]: any }): google.datastore.v1.ExecutionStats; - - /** - * Creates a plain object from an ExecutionStats message. Also converts values to other types if specified. - * @param message ExecutionStats - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.datastore.v1.ExecutionStats, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExecutionStats to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExecutionStats - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - - /** CommonLanguageSettings selectiveGapicGeneration */ - selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** CommonLanguageSettings selectiveGapicGeneration. */ - public selectiveGapicGeneration?: (google.api.ISelectiveGapicGeneration|null); - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** PythonSettings experimentalFeatures */ - experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** PythonSettings experimentalFeatures. */ - public experimentalFeatures?: (google.api.PythonSettings.IExperimentalFeatures|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace PythonSettings { - - /** Properties of an ExperimentalFeatures. */ - interface IExperimentalFeatures { - - /** ExperimentalFeatures restAsyncIoEnabled */ - restAsyncIoEnabled?: (boolean|null); - - /** ExperimentalFeatures protobufPythonicTypesEnabled */ - protobufPythonicTypesEnabled?: (boolean|null); - - /** ExperimentalFeatures unversionedPackageDisabled */ - unversionedPackageDisabled?: (boolean|null); - } - - /** Represents an ExperimentalFeatures. */ - class ExperimentalFeatures implements IExperimentalFeatures { - - /** - * Constructs a new ExperimentalFeatures. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.PythonSettings.IExperimentalFeatures); - - /** ExperimentalFeatures restAsyncIoEnabled. */ - public restAsyncIoEnabled: boolean; - - /** ExperimentalFeatures protobufPythonicTypesEnabled. */ - public protobufPythonicTypesEnabled: boolean; - - /** ExperimentalFeatures unversionedPackageDisabled. */ - public unversionedPackageDisabled: boolean; - - /** - * Creates a new ExperimentalFeatures instance using the specified properties. - * @param [properties] Properties to set - * @returns ExperimentalFeatures instance - */ - public static create(properties?: google.api.PythonSettings.IExperimentalFeatures): google.api.PythonSettings.ExperimentalFeatures; - - /** - * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. - * @param message ExperimentalFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. - * @param message ExperimentalFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.PythonSettings.IExperimentalFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExperimentalFeatures message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExperimentalFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings.ExperimentalFeatures; - - /** - * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExperimentalFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings.ExperimentalFeatures; - - /** - * Verifies an ExperimentalFeatures message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExperimentalFeatures - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings.ExperimentalFeatures; - - /** - * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. - * @param message ExperimentalFeatures - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings.ExperimentalFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExperimentalFeatures to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExperimentalFeatures - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** GoSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** GoSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** Properties of a SelectiveGapicGeneration. */ - interface ISelectiveGapicGeneration { - - /** SelectiveGapicGeneration methods */ - methods?: (string[]|null); - - /** SelectiveGapicGeneration generateOmittedAsInternal */ - generateOmittedAsInternal?: (boolean|null); - } - - /** Represents a SelectiveGapicGeneration. */ - class SelectiveGapicGeneration implements ISelectiveGapicGeneration { - - /** - * Constructs a new SelectiveGapicGeneration. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ISelectiveGapicGeneration); - - /** SelectiveGapicGeneration methods. */ - public methods: string[]; - - /** SelectiveGapicGeneration generateOmittedAsInternal. */ - public generateOmittedAsInternal: boolean; - - /** - * Creates a new SelectiveGapicGeneration instance using the specified properties. - * @param [properties] Properties to set - * @returns SelectiveGapicGeneration instance - */ - public static create(properties?: google.api.ISelectiveGapicGeneration): google.api.SelectiveGapicGeneration; - - /** - * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. - * @param message SelectiveGapicGeneration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. - * @param message SelectiveGapicGeneration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ISelectiveGapicGeneration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SelectiveGapicGeneration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.SelectiveGapicGeneration; - - /** - * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SelectiveGapicGeneration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.SelectiveGapicGeneration; - - /** - * Verifies a SelectiveGapicGeneration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SelectiveGapicGeneration - */ - public static fromObject(object: { [k: string]: any }): google.api.SelectiveGapicGeneration; - - /** - * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. - * @param message SelectiveGapicGeneration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.SelectiveGapicGeneration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SelectiveGapicGeneration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SelectiveGapicGeneration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a RoutingRule. */ - interface IRoutingRule { - - /** RoutingRule routingParameters */ - routingParameters?: (google.api.IRoutingParameter[]|null); - } - - /** Represents a RoutingRule. */ - class RoutingRule implements IRoutingRule { - - /** - * Constructs a new RoutingRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRoutingRule); - - /** RoutingRule routingParameters. */ - public routingParameters: google.api.IRoutingParameter[]; - - /** - * Creates a new RoutingRule instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingRule instance - */ - public static create(properties?: google.api.IRoutingRule): google.api.RoutingRule; - - /** - * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @param message RoutingRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @param message RoutingRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRoutingRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RoutingRule; - - /** - * Decodes a RoutingRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RoutingRule; - - /** - * Verifies a RoutingRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingRule - */ - public static fromObject(object: { [k: string]: any }): google.api.RoutingRule; - - /** - * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. - * @param message RoutingRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RoutingRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RoutingParameter. */ - interface IRoutingParameter { - - /** RoutingParameter field */ - field?: (string|null); - - /** RoutingParameter pathTemplate */ - pathTemplate?: (string|null); - } - - /** Represents a RoutingParameter. */ - class RoutingParameter implements IRoutingParameter { - - /** - * Constructs a new RoutingParameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRoutingParameter); - - /** RoutingParameter field. */ - public field: string; - - /** RoutingParameter pathTemplate. */ - public pathTemplate: string; - - /** - * Creates a new RoutingParameter instance using the specified properties. - * @param [properties] Properties to set - * @returns RoutingParameter instance - */ - public static create(properties?: google.api.IRoutingParameter): google.api.RoutingParameter; - - /** - * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @param message RoutingParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @param message RoutingParameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRoutingParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RoutingParameter; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RoutingParameter; - - /** - * Verifies a RoutingParameter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RoutingParameter - */ - public static fromObject(object: { [k: string]: any }): google.api.RoutingParameter; - - /** - * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. - * @param message RoutingParameter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RoutingParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RoutingParameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RoutingParameter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_LEGACY = 900, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto optionDependency */ - optionDependency?: (string[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto optionDependency. */ - public optionDependency: string[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - - /** DescriptorProto visibility */ - visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** DescriptorProto visibility. */ - public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - - /** EnumDescriptorProto visibility */ - visibility?: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** EnumDescriptorProto visibility. */ - public visibility: (google.protobuf.SymbolVisibility|keyof typeof google.protobuf.SymbolVisibility); - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions featureSupport */ - featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions featureSupport. */ - public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FeatureSupport. */ - interface IFeatureSupport { - - /** FeatureSupport editionIntroduced */ - editionIntroduced?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSupport editionDeprecated */ - editionDeprecated?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSupport deprecationWarning */ - deprecationWarning?: (string|null); - - /** FeatureSupport editionRemoved */ - editionRemoved?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSupport. */ - class FeatureSupport implements IFeatureSupport { - - /** - * Constructs a new FeatureSupport. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IFeatureSupport); - - /** FeatureSupport editionIntroduced. */ - public editionIntroduced: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSupport editionDeprecated. */ - public editionDeprecated: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSupport deprecationWarning. */ - public deprecationWarning: string; - - /** FeatureSupport editionRemoved. */ - public editionRemoved: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSupport instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSupport instance - */ - public static create(properties?: google.protobuf.FieldOptions.IFeatureSupport): google.protobuf.FieldOptions.FeatureSupport; - - /** - * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. - * @param message FeatureSupport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. - * @param message FeatureSupport message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IFeatureSupport, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSupport message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSupport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.FeatureSupport; - - /** - * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSupport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.FeatureSupport; - - /** - * Verifies a FeatureSupport message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSupport - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.FeatureSupport; - - /** - * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. - * @param message FeatureSupport - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.FeatureSupport, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSupport to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSupport - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions featureSupport */ - featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions featureSupport. */ - public featureSupport?: (google.protobuf.FieldOptions.IFeatureSupport|null); - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - - /** MethodOptions .google.api.routing */ - ".google.api.routing"?: (google.api.IRoutingRule|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|Buffer|string|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long|string); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long|string); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: (Uint8Array|Buffer|string); - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UninterpretedOption - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NamePart - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a FeatureSet. */ - interface IFeatureSet { - - /** FeatureSet fieldPresence */ - fieldPresence?: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence|null); - - /** FeatureSet enumType */ - enumType?: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType|null); - - /** FeatureSet repeatedFieldEncoding */ - repeatedFieldEncoding?: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding|null); - - /** FeatureSet utf8Validation */ - utf8Validation?: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation|null); - - /** FeatureSet messageEncoding */ - messageEncoding?: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding|null); - - /** FeatureSet jsonFormat */ - jsonFormat?: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat|null); - - /** FeatureSet enforceNamingStyle */ - enforceNamingStyle?: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle|null); - - /** FeatureSet defaultSymbolVisibility */ - defaultSymbolVisibility?: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null); - } - - /** Represents a FeatureSet. */ - class FeatureSet implements IFeatureSet { - - /** - * Constructs a new FeatureSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSet); - - /** FeatureSet fieldPresence. */ - public fieldPresence: (google.protobuf.FeatureSet.FieldPresence|keyof typeof google.protobuf.FeatureSet.FieldPresence); - - /** FeatureSet enumType. */ - public enumType: (google.protobuf.FeatureSet.EnumType|keyof typeof google.protobuf.FeatureSet.EnumType); - - /** FeatureSet repeatedFieldEncoding. */ - public repeatedFieldEncoding: (google.protobuf.FeatureSet.RepeatedFieldEncoding|keyof typeof google.protobuf.FeatureSet.RepeatedFieldEncoding); - - /** FeatureSet utf8Validation. */ - public utf8Validation: (google.protobuf.FeatureSet.Utf8Validation|keyof typeof google.protobuf.FeatureSet.Utf8Validation); - - /** FeatureSet messageEncoding. */ - public messageEncoding: (google.protobuf.FeatureSet.MessageEncoding|keyof typeof google.protobuf.FeatureSet.MessageEncoding); - - /** FeatureSet jsonFormat. */ - public jsonFormat: (google.protobuf.FeatureSet.JsonFormat|keyof typeof google.protobuf.FeatureSet.JsonFormat); - - /** FeatureSet enforceNamingStyle. */ - public enforceNamingStyle: (google.protobuf.FeatureSet.EnforceNamingStyle|keyof typeof google.protobuf.FeatureSet.EnforceNamingStyle); - - /** FeatureSet defaultSymbolVisibility. */ - public defaultSymbolVisibility: (google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|keyof typeof google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility); - - /** - * Creates a new FeatureSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSet instance - */ - public static create(properties?: google.protobuf.IFeatureSet): google.protobuf.FeatureSet; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @param message FeatureSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet; - - /** - * Verifies a FeatureSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @param message FeatureSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSet { - - /** FieldPresence enum. */ - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3 - } - - /** EnumType enum. */ - enum EnumType { - ENUM_TYPE_UNKNOWN = 0, - OPEN = 1, - CLOSED = 2 - } - - /** RepeatedFieldEncoding enum. */ - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0, - PACKED = 1, - EXPANDED = 2 - } - - /** Utf8Validation enum. */ - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0, - VERIFY = 2, - NONE = 3 - } - - /** MessageEncoding enum. */ - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0, - LENGTH_PREFIXED = 1, - DELIMITED = 2 - } - - /** JsonFormat enum. */ - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0, - ALLOW = 1, - LEGACY_BEST_EFFORT = 2 - } - - /** EnforceNamingStyle enum. */ - enum EnforceNamingStyle { - ENFORCE_NAMING_STYLE_UNKNOWN = 0, - STYLE2024 = 1, - STYLE_LEGACY = 2 - } - - /** Properties of a VisibilityFeature. */ - interface IVisibilityFeature { - } - - /** Represents a VisibilityFeature. */ - class VisibilityFeature implements IVisibilityFeature { - - /** - * Constructs a new VisibilityFeature. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSet.IVisibilityFeature); - - /** - * Creates a new VisibilityFeature instance using the specified properties. - * @param [properties] Properties to set - * @returns VisibilityFeature instance - */ - public static create(properties?: google.protobuf.FeatureSet.IVisibilityFeature): google.protobuf.FeatureSet.VisibilityFeature; - - /** - * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. - * @param message VisibilityFeature message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. - * @param message VisibilityFeature message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSet.IVisibilityFeature, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a VisibilityFeature message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VisibilityFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSet.VisibilityFeature; - - /** - * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VisibilityFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSet.VisibilityFeature; - - /** - * Verifies a VisibilityFeature message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VisibilityFeature - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSet.VisibilityFeature; - - /** - * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. - * @param message VisibilityFeature - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSet.VisibilityFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this VisibilityFeature to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for VisibilityFeature - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace VisibilityFeature { - - /** DefaultSymbolVisibility enum. */ - enum DefaultSymbolVisibility { - DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, - EXPORT_ALL = 1, - EXPORT_TOP_LEVEL = 2, - LOCAL_ALL = 3, - STRICT = 4 - } - } - } - - /** Properties of a FeatureSetDefaults. */ - interface IFeatureSetDefaults { - - /** FeatureSetDefaults defaults */ - defaults?: (google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]|null); - - /** FeatureSetDefaults minimumEdition */ - minimumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetDefaults maximumEdition */ - maximumEdition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FeatureSetDefaults. */ - class FeatureSetDefaults implements IFeatureSetDefaults { - - /** - * Constructs a new FeatureSetDefaults. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFeatureSetDefaults); - - /** FeatureSetDefaults defaults. */ - public defaults: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault[]; - - /** FeatureSetDefaults minimumEdition. */ - public minimumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetDefaults maximumEdition. */ - public maximumEdition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetDefaults instance - */ - public static create(properties?: google.protobuf.IFeatureSetDefaults): google.protobuf.FeatureSetDefaults; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @param message FeatureSetDefaults message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFeatureSetDefaults, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults; - - /** - * Verifies a FeatureSetDefaults message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetDefaults - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @param message FeatureSetDefaults - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetDefaults - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FeatureSetDefaults { - - /** Properties of a FeatureSetEditionDefault. */ - interface IFeatureSetEditionDefault { - - /** FeatureSetEditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** FeatureSetEditionDefault overridableFeatures */ - overridableFeatures?: (google.protobuf.IFeatureSet|null); - - /** FeatureSetEditionDefault fixedFeatures */ - fixedFeatures?: (google.protobuf.IFeatureSet|null); - } - - /** Represents a FeatureSetEditionDefault. */ - class FeatureSetEditionDefault implements IFeatureSetEditionDefault { - - /** - * Constructs a new FeatureSetEditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault); - - /** FeatureSetEditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** FeatureSetEditionDefault overridableFeatures. */ - public overridableFeatures?: (google.protobuf.IFeatureSet|null); - - /** FeatureSetEditionDefault fixedFeatures. */ - public fixedFeatures?: (google.protobuf.IFeatureSet|null); - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns FeatureSetEditionDefault instance - */ - public static create(properties?: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @param message FeatureSetEditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Verifies a FeatureSetEditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FeatureSetEditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @param message FeatureSetEditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SourceCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Location - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - - /** Annotation semantic */ - semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** Annotation semantic. */ - public semantic: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic); - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Annotation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Annotation { - - /** Semantic enum. */ - enum Semantic { - NONE = 0, - SET = 1, - ALIAS = 2 - } - } - } - - /** SymbolVisibility enum. */ - enum SymbolVisibility { - VISIBILITY_UNSET = 0, - VISIBILITY_LOCAL = 1, - VISIBILITY_EXPORT = 2 - } - - /** Properties of a Duration. */ - interface IDuration { - - /** Duration seconds */ - seconds?: (number|Long|string|null); - - /** Duration nanos */ - nanos?: (number|null); - } - - /** Represents a Duration. */ - class Duration implements IDuration { - - /** - * Constructs a new Duration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDuration); - - /** Duration seconds. */ - public seconds: (number|Long|string); - - /** Duration nanos. */ - public nanos: number; - - /** - * Creates a new Duration instance using the specified properties. - * @param [properties] Properties to set - * @returns Duration instance - */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; - - /** - * Decodes a Duration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; - - /** - * Verifies a Duration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Duration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Duration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Duration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Any - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Empty. */ - interface IEmpty { - } - - /** Represents an Empty. */ - class Empty implements IEmpty { - - /** - * Constructs a new Empty. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEmpty); - - /** - * Creates a new Empty instance using the specified properties. - * @param [properties] Properties to set - * @returns Empty instance - */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; - - /** - * Verifies an Empty message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Empty - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Empty to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Empty - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); - } - - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { - - /** - * Constructs a new Timestamp. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; - - /** - * Creates a new Timestamp instance using the specified properties. - * @param [properties] Properties to set - * @returns Timestamp instance - */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; - - /** - * Verifies a Timestamp message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Timestamp - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Timestamp to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Timestamp - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Struct. */ - interface IStruct { - - /** Struct fields */ - fields?: ({ [k: string]: google.protobuf.IValue }|null); - } - - /** Represents a Struct. */ - class Struct implements IStruct { - - /** - * Constructs a new Struct. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStruct); - - /** Struct fields. */ - public fields: { [k: string]: google.protobuf.IValue }; - - /** - * Creates a new Struct instance using the specified properties. - * @param [properties] Properties to set - * @returns Struct instance - */ - public static create(properties?: google.protobuf.IStruct): google.protobuf.Struct; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @param message Struct message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStruct, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Struct; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Struct; - - /** - * Verifies a Struct message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Struct - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Struct; - - /** - * Creates a plain object from a Struct message. Also converts values to other types if specified. - * @param message Struct - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Struct, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Struct to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Struct - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Value. */ - interface IValue { - - /** Value nullValue */ - nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue */ - numberValue?: (number|null); - - /** Value stringValue */ - stringValue?: (string|null); - - /** Value boolValue */ - boolValue?: (boolean|null); - - /** Value structValue */ - structValue?: (google.protobuf.IStruct|null); - - /** Value listValue */ - listValue?: (google.protobuf.IListValue|null); - } - - /** Represents a Value. */ - class Value implements IValue { - - /** - * Constructs a new Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IValue); - - /** Value nullValue. */ - public nullValue?: (google.protobuf.NullValue|keyof typeof google.protobuf.NullValue|null); - - /** Value numberValue. */ - public numberValue?: (number|null); - - /** Value stringValue. */ - public stringValue?: (string|null); - - /** Value boolValue. */ - public boolValue?: (boolean|null); - - /** Value structValue. */ - public structValue?: (google.protobuf.IStruct|null); - - /** Value listValue. */ - public listValue?: (google.protobuf.IListValue|null); - - /** Value kind. */ - public kind?: ("nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"); - - /** - * Creates a new Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Value instance - */ - public static create(properties?: google.protobuf.IValue): google.protobuf.Value; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @param message Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Value; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Value; - - /** - * Verifies a Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Value; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @param message Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** NullValue enum. */ - enum NullValue { - NULL_VALUE = 0 - } - - /** Properties of a ListValue. */ - interface IListValue { - - /** ListValue values */ - values?: (google.protobuf.IValue[]|null); - } - - /** Represents a ListValue. */ - class ListValue implements IListValue { - - /** - * Constructs a new ListValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IListValue); - - /** ListValue values. */ - public values: google.protobuf.IValue[]; - - /** - * Creates a new ListValue instance using the specified properties. - * @param [properties] Properties to set - * @returns ListValue instance - */ - public static create(properties?: google.protobuf.IListValue): google.protobuf.ListValue; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @param message ListValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IListValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ListValue; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ListValue; - - /** - * Verifies a ListValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ListValue; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @param message ListValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ListValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DoubleValue. */ - interface IDoubleValue { - - /** DoubleValue value */ - value?: (number|null); - } - - /** Represents a DoubleValue. */ - class DoubleValue implements IDoubleValue { - - /** - * Constructs a new DoubleValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDoubleValue); - - /** DoubleValue value. */ - public value: number; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @param [properties] Properties to set - * @returns DoubleValue instance - */ - public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @param message DoubleValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; - - /** - * Decodes a DoubleValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; - - /** - * Verifies a DoubleValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DoubleValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @param message DoubleValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DoubleValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DoubleValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FloatValue. */ - interface IFloatValue { - - /** FloatValue value */ - value?: (number|null); - } - - /** Represents a FloatValue. */ - class FloatValue implements IFloatValue { - - /** - * Constructs a new FloatValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFloatValue); - - /** FloatValue value. */ - public value: number; - - /** - * Creates a new FloatValue instance using the specified properties. - * @param [properties] Properties to set - * @returns FloatValue instance - */ - public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @param message FloatValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; - - /** - * Verifies a FloatValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FloatValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @param message FloatValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FloatValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FloatValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int64Value. */ - interface IInt64Value { - - /** Int64Value value */ - value?: (number|Long|string|null); - } - - /** Represents an Int64Value. */ - class Int64Value implements IInt64Value { - - /** - * Constructs a new Int64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt64Value); - - /** Int64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new Int64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int64Value instance - */ - public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @param message Int64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; - - /** - * Verifies an Int64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @param message Int64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt64Value. */ - interface IUInt64Value { - - /** UInt64Value value */ - value?: (number|Long|string|null); - } - - /** Represents a UInt64Value. */ - class UInt64Value implements IUInt64Value { - - /** - * Constructs a new UInt64Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt64Value); - - /** UInt64Value value. */ - public value: (number|Long|string); - - /** - * Creates a new UInt64Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt64Value instance - */ - public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @param message UInt64Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; - - /** - * Verifies a UInt64Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt64Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @param message UInt64Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt64Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt64Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Int32Value. */ - interface IInt32Value { - - /** Int32Value value */ - value?: (number|null); - } - - /** Represents an Int32Value. */ - class Int32Value implements IInt32Value { - - /** - * Constructs a new Int32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IInt32Value); - - /** Int32Value value. */ - public value: number; - - /** - * Creates a new Int32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns Int32Value instance - */ - public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @param message Int32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; - - /** - * Verifies an Int32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Int32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @param message Int32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Int32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Int32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a UInt32Value. */ - interface IUInt32Value { - - /** UInt32Value value */ - value?: (number|null); - } - - /** Represents a UInt32Value. */ - class UInt32Value implements IUInt32Value { - - /** - * Constructs a new UInt32Value. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUInt32Value); - - /** UInt32Value value. */ - public value: number; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @param [properties] Properties to set - * @returns UInt32Value instance - */ - public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @param message UInt32Value message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; - - /** - * Verifies a UInt32Value message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UInt32Value - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @param message UInt32Value - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UInt32Value to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UInt32Value - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BoolValue. */ - interface IBoolValue { - - /** BoolValue value */ - value?: (boolean|null); - } - - /** Represents a BoolValue. */ - class BoolValue implements IBoolValue { - - /** - * Constructs a new BoolValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBoolValue); - - /** BoolValue value. */ - public value: boolean; - - /** - * Creates a new BoolValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BoolValue instance - */ - public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @param message BoolValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; - - /** - * Verifies a BoolValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BoolValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @param message BoolValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BoolValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BoolValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StringValue. */ - interface IStringValue { - - /** StringValue value */ - value?: (string|null); - } - - /** Represents a StringValue. */ - class StringValue implements IStringValue { - - /** - * Constructs a new StringValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IStringValue); - - /** StringValue value. */ - public value: string; - - /** - * Creates a new StringValue instance using the specified properties. - * @param [properties] Properties to set - * @returns StringValue instance - */ - public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @param message StringValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; - - /** - * Verifies a StringValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StringValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StringValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @param message StringValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StringValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StringValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BytesValue. */ - interface IBytesValue { - - /** BytesValue value */ - value?: (Uint8Array|Buffer|string|null); - } - - /** Represents a BytesValue. */ - class BytesValue implements IBytesValue { - - /** - * Constructs a new BytesValue. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IBytesValue); - - /** BytesValue value. */ - public value: (Uint8Array|Buffer|string); - - /** - * Creates a new BytesValue instance using the specified properties. - * @param [properties] Properties to set - * @returns BytesValue instance - */ - public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @param message BytesValue message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; - - /** - * Verifies a BytesValue message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BytesValue - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @param message BytesValue - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BytesValue to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BytesValue - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace longrunning. */ - namespace longrunning { - - /** Represents an Operations */ - class Operations extends $protobuf.rpc.Service { - - /** - * Constructs a new Operations service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Operations service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Operations; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListOperationsResponse - */ - public listOperations(request: google.longrunning.IListOperationsRequest, callback: google.longrunning.Operations.ListOperationsCallback): void; - - /** - * Calls ListOperations. - * @param request ListOperationsRequest message or plain object - * @returns Promise - */ - public listOperations(request: google.longrunning.IListOperationsRequest): Promise; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public getOperation(request: google.longrunning.IGetOperationRequest, callback: google.longrunning.Operations.GetOperationCallback): void; - - /** - * Calls GetOperation. - * @param request GetOperationRequest message or plain object - * @returns Promise - */ - public getOperation(request: google.longrunning.IGetOperationRequest): Promise; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest, callback: google.longrunning.Operations.DeleteOperationCallback): void; - - /** - * Calls DeleteOperation. - * @param request DeleteOperationRequest message or plain object - * @returns Promise - */ - public deleteOperation(request: google.longrunning.IDeleteOperationRequest): Promise; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest, callback: google.longrunning.Operations.CancelOperationCallback): void; - - /** - * Calls CancelOperation. - * @param request CancelOperationRequest message or plain object - * @returns Promise - */ - public cancelOperation(request: google.longrunning.ICancelOperationRequest): Promise; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest, callback: google.longrunning.Operations.WaitOperationCallback): void; - - /** - * Calls WaitOperation. - * @param request WaitOperationRequest message or plain object - * @returns Promise - */ - public waitOperation(request: google.longrunning.IWaitOperationRequest): Promise; - } - - namespace Operations { - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @param error Error, if any - * @param [response] ListOperationsResponse - */ - type ListOperationsCallback = (error: (Error|null), response?: google.longrunning.ListOperationsResponse) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type GetOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @param error Error, if any - * @param [response] Empty - */ - type CancelOperationCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @param error Error, if any - * @param [response] Operation - */ - type WaitOperationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Operation. */ - interface IOperation { - - /** Operation name */ - name?: (string|null); - - /** Operation metadata */ - metadata?: (google.protobuf.IAny|null); - - /** Operation done */ - done?: (boolean|null); - - /** Operation error */ - error?: (google.rpc.IStatus|null); - - /** Operation response */ - response?: (google.protobuf.IAny|null); - } - - /** Represents an Operation. */ - class Operation implements IOperation { - - /** - * Constructs a new Operation. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperation); - - /** Operation name. */ - public name: string; - - /** Operation metadata. */ - public metadata?: (google.protobuf.IAny|null); - - /** Operation done. */ - public done: boolean; - - /** Operation error. */ - public error?: (google.rpc.IStatus|null); - - /** Operation response. */ - public response?: (google.protobuf.IAny|null); - - /** Operation result. */ - public result?: ("error"|"response"); - - /** - * Creates a new Operation instance using the specified properties. - * @param [properties] Properties to set - * @returns Operation instance - */ - public static create(properties?: google.longrunning.IOperation): google.longrunning.Operation; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @param message Operation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.Operation; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.Operation; - - /** - * Verifies an Operation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Operation - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.Operation; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @param message Operation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.Operation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Operation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Operation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetOperationRequest. */ - interface IGetOperationRequest { - - /** GetOperationRequest name */ - name?: (string|null); - } - - /** Represents a GetOperationRequest. */ - class GetOperationRequest implements IGetOperationRequest { - - /** - * Constructs a new GetOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IGetOperationRequest); - - /** GetOperationRequest name. */ - public name: string; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetOperationRequest instance - */ - public static create(properties?: google.longrunning.IGetOperationRequest): google.longrunning.GetOperationRequest; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @param message GetOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IGetOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.GetOperationRequest; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.GetOperationRequest; - - /** - * Verifies a GetOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.GetOperationRequest; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @param message GetOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.GetOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsRequest. */ - interface IListOperationsRequest { - - /** ListOperationsRequest name */ - name?: (string|null); - - /** ListOperationsRequest filter */ - filter?: (string|null); - - /** ListOperationsRequest pageSize */ - pageSize?: (number|null); - - /** ListOperationsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListOperationsRequest. */ - class ListOperationsRequest implements IListOperationsRequest { - - /** - * Constructs a new ListOperationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsRequest); - - /** ListOperationsRequest name. */ - public name: string; - - /** ListOperationsRequest filter. */ - public filter: string; - - /** ListOperationsRequest pageSize. */ - public pageSize: number; - - /** ListOperationsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsRequest instance - */ - public static create(properties?: google.longrunning.IListOperationsRequest): google.longrunning.ListOperationsRequest; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @param message ListOperationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsRequest; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsRequest; - - /** - * Verifies a ListOperationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsRequest; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @param message ListOperationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListOperationsResponse. */ - interface IListOperationsResponse { - - /** ListOperationsResponse operations */ - operations?: (google.longrunning.IOperation[]|null); - - /** ListOperationsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListOperationsResponse. */ - class ListOperationsResponse implements IListOperationsResponse { - - /** - * Constructs a new ListOperationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IListOperationsResponse); - - /** ListOperationsResponse operations. */ - public operations: google.longrunning.IOperation[]; - - /** ListOperationsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListOperationsResponse instance - */ - public static create(properties?: google.longrunning.IListOperationsResponse): google.longrunning.ListOperationsResponse; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @param message ListOperationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IListOperationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.ListOperationsResponse; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.ListOperationsResponse; - - /** - * Verifies a ListOperationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListOperationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.ListOperationsResponse; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @param message ListOperationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.ListOperationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListOperationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListOperationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CancelOperationRequest. */ - interface ICancelOperationRequest { - - /** CancelOperationRequest name */ - name?: (string|null); - } - - /** Represents a CancelOperationRequest. */ - class CancelOperationRequest implements ICancelOperationRequest { - - /** - * Constructs a new CancelOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.ICancelOperationRequest); - - /** CancelOperationRequest name. */ - public name: string; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CancelOperationRequest instance - */ - public static create(properties?: google.longrunning.ICancelOperationRequest): google.longrunning.CancelOperationRequest; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @param message CancelOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.ICancelOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.CancelOperationRequest; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.CancelOperationRequest; - - /** - * Verifies a CancelOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CancelOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.CancelOperationRequest; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @param message CancelOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.CancelOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CancelOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CancelOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteOperationRequest. */ - interface IDeleteOperationRequest { - - /** DeleteOperationRequest name */ - name?: (string|null); - } - - /** Represents a DeleteOperationRequest. */ - class DeleteOperationRequest implements IDeleteOperationRequest { - - /** - * Constructs a new DeleteOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IDeleteOperationRequest); - - /** DeleteOperationRequest name. */ - public name: string; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteOperationRequest instance - */ - public static create(properties?: google.longrunning.IDeleteOperationRequest): google.longrunning.DeleteOperationRequest; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @param message DeleteOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IDeleteOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.DeleteOperationRequest; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.DeleteOperationRequest; - - /** - * Verifies a DeleteOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.DeleteOperationRequest; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @param message DeleteOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.DeleteOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WaitOperationRequest. */ - interface IWaitOperationRequest { - - /** WaitOperationRequest name */ - name?: (string|null); - - /** WaitOperationRequest timeout */ - timeout?: (google.protobuf.IDuration|null); - } - - /** Represents a WaitOperationRequest. */ - class WaitOperationRequest implements IWaitOperationRequest { - - /** - * Constructs a new WaitOperationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IWaitOperationRequest); - - /** WaitOperationRequest name. */ - public name: string; - - /** WaitOperationRequest timeout. */ - public timeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns WaitOperationRequest instance - */ - public static create(properties?: google.longrunning.IWaitOperationRequest): google.longrunning.WaitOperationRequest; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @param message WaitOperationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IWaitOperationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.WaitOperationRequest; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.WaitOperationRequest; - - /** - * Verifies a WaitOperationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WaitOperationRequest - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.WaitOperationRequest; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @param message WaitOperationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.WaitOperationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WaitOperationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WaitOperationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationInfo. */ - interface IOperationInfo { - - /** OperationInfo responseType */ - responseType?: (string|null); - - /** OperationInfo metadataType */ - metadataType?: (string|null); - } - - /** Represents an OperationInfo. */ - class OperationInfo implements IOperationInfo { - - /** - * Constructs a new OperationInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.longrunning.IOperationInfo); - - /** OperationInfo responseType. */ - public responseType: string; - - /** OperationInfo metadataType. */ - public metadataType: string; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationInfo instance - */ - public static create(properties?: google.longrunning.IOperationInfo): google.longrunning.OperationInfo; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @param message OperationInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.longrunning.IOperationInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.longrunning.OperationInfo; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.longrunning.OperationInfo; - - /** - * Verifies an OperationInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationInfo - */ - public static fromObject(object: { [k: string]: any }): google.longrunning.OperationInfo; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @param message OperationInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.longrunning.OperationInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace type. */ - namespace type { - - /** Properties of a LatLng. */ - interface ILatLng { - - /** LatLng latitude */ - latitude?: (number|null); - - /** LatLng longitude */ - longitude?: (number|null); - } - - /** Represents a LatLng. */ - class LatLng implements ILatLng { - - /** - * Constructs a new LatLng. - * @param [properties] Properties to set - */ - constructor(properties?: google.type.ILatLng); - - /** LatLng latitude. */ - public latitude: number; - - /** LatLng longitude. */ - public longitude: number; - - /** - * 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; - - /** - * 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; - - /** - * 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; - - /** - * 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 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; - - /** - * 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 }; - - /** - * Converts this LatLng to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LatLng - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } -} diff --git a/handwritten/datastore/protos/protos.js b/handwritten/datastore/protos/protos.js deleted file mode 100644 index 6f13d0a71617..000000000000 --- a/handwritten/datastore/protos/protos.js +++ /dev/null @@ -1,50328 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function(global, factory) { /* global define, require, module */ - - /* AMD */ if (typeof define === 'function' && define.amd) - define(["protobufjs/minimal"], factory); - - /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); - -})(this, function($protobuf) { - "use strict"; - - // Common aliases - var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; - - // Exported root namespace - var $root = $protobuf.roots._google_cloud_datastore_protos || ($protobuf.roots._google_cloud_datastore_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.datastore = (function() { - - /** - * Namespace datastore. - * @memberof google - * @namespace - */ - var datastore = {}; - - datastore.admin = (function() { - - /** - * Namespace admin. - * @memberof google.datastore - * @namespace - */ - var admin = {}; - - admin.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.datastore.admin - * @namespace - */ - var v1 = {}; - - v1.DatastoreAdmin = (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); - } - - (DatastoreAdmin.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DatastoreAdmin; - - /** - * 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); - }; - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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; - })(); - - v1.CommonMetadata = (function() { - - /** - * 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 - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - 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, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.labels, key); - message.labels[key] = value; - break; - } - case 5: { - message.state = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime, long + 1); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.admin.v1.CommonMetadata) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - switch (object.operationType) { - default: - if (typeof object.operationType === "number") { - message.operationType = object.operationType; - break; - } - break; - 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) { - if (keys[i] === "__proto__") - $util.makeProp(message.labels, keys[i]); - 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; - 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 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] === 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 = {}; - for (var j = 0; j < keys2.length; ++j) { - if (keys2[j] === "__proto__") - $util.makeProp(object.labels, keys2[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] === undefined ? message.state : $root.google.datastore.admin.v1.CommonMetadata.State[message.state] : message.state; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for CommonMetadata - * @function getTypeUrl - * @memberof google.datastore.admin.v1.CommonMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.CommonMetadata"; - }; - - /** - * 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; - })(); - - return CommonMetadata; - })(); - - 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 - */ - - /** - * 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 && keys[i] !== "__proto__") - 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; - - /** - * 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 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); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.workCompleted = reader.int64(); - break; - } - case 2: { - message.workEstimated = reader.int64(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.datastore.admin.v1.Progress) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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); - }; - - /** - * Gets the default type url for Progress - * @function getTypeUrl - * @memberof google.datastore.admin.v1.Progress - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Progress.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.Progress"; - }; - - return Progress; - })(); - - v1.ExportEntitiesRequest = (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 - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.labels, key); - message.labels[key] = value; - break; - } - case 3: { - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.outputUrlPrefix = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - 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 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, long) { - if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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) { - if (keys[i] === "__proto__") - $util.makeProp(message.labels, keys[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, long + 1); - } - if (object.outputUrlPrefix != null) - message.outputUrlPrefix = String(object.outputUrlPrefix); - return message; - }; - - /** - * 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) { - if (keys2[j] === "__proto__") - $util.makeProp(object.labels, keys2[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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ExportEntitiesRequest - * @function getTypeUrl - * @memberof google.datastore.admin.v1.ExportEntitiesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportEntitiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.ExportEntitiesRequest"; - }; - - return ExportEntitiesRequest; - })(); - - v1.ImportEntitiesRequest = (function() { - - /** - * 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 - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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; - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.labels, key); - 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(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - if (error) - return "entityFilter." + error; - } - 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, long) { - if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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) { - if (keys[i] === "__proto__") - $util.makeProp(message.labels, keys[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, long + 1); - } - 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) { - if (keys2[j] === "__proto__") - $util.makeProp(object.labels, keys2[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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ImportEntitiesRequest - * @function getTypeUrl - * @memberof google.datastore.admin.v1.ImportEntitiesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportEntitiesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.ImportEntitiesRequest"; - }; - - return ImportEntitiesRequest; - })(); - - v1.ExportEntitiesResponse = (function() { - - /** - * Properties of an ExportEntitiesResponse. - * @memberof google.datastore.admin.v1 - * @interface IExportEntitiesResponse - * @property {string|null} [outputUrl] ExportEntitiesResponse outputUrl - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExportEntitiesResponse outputUrl. - * @member {string} outputUrl - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @instance - */ - ExportEntitiesResponse.prototype.outputUrl = ""; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.outputUrl = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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); - }; - - /** - * Gets the default type url for ExportEntitiesResponse - * @function getTypeUrl - * @memberof google.datastore.admin.v1.ExportEntitiesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportEntitiesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.ExportEntitiesResponse"; - }; - - return ExportEntitiesResponse; - })(); - - v1.ExportEntitiesMetadata = (function() { - - /** - * 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 - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.outputUrlPrefix = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common, long + 1); - if (error) - return "common." + error; - } - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities, long + 1); - if (error) - return "progressEntities." + error; - } - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes, long + 1); - if (error) - return "progressBytes." + error; - } - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.admin.v1.ExportEntitiesMetadata) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - 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); - }; - - /** - * Gets the default type url for ExportEntitiesMetadata - * @function getTypeUrl - * @memberof google.datastore.admin.v1.ExportEntitiesMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportEntitiesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.ExportEntitiesMetadata"; - }; - - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.progressBytes = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.entityFilter = $root.google.datastore.admin.v1.EntityFilter.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.inputUrl = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common, long + 1); - if (error) - return "common." + error; - } - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities, long + 1); - if (error) - return "progressEntities." + error; - } - if (message.progressBytes != null && message.hasOwnProperty("progressBytes")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressBytes, long + 1); - if (error) - return "progressBytes." + error; - } - if (message.entityFilter != null && message.hasOwnProperty("entityFilter")) { - var error = $root.google.datastore.admin.v1.EntityFilter.verify(message.entityFilter, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.admin.v1.ImportEntitiesMetadata) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - 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); - }; - - /** - * Gets the default type url for ImportEntitiesMetadata - * @function getTypeUrl - * @memberof google.datastore.admin.v1.ImportEntitiesMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImportEntitiesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.ImportEntitiesMetadata"; - }; - - return ImportEntitiesMetadata; - })(); - - v1.EntityFilter = (function() { - - /** - * Properties of an EntityFilter. - * @memberof google.datastore.admin.v1 - * @interface IEntityFilter - * @property {Array.|null} [kinds] EntityFilter kinds - * @property {Array.|null} [namespaceIds] EntityFilter namespaceIds - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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, long); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.admin.v1.EntityFilter) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for EntityFilter - * @function getTypeUrl - * @memberof google.datastore.admin.v1.EntityFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.EntityFilter"; - }; - - return EntityFilter; - })(); - - v1.CreateIndexRequest = (function() { - - /** - * 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 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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; - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.index = $root.google.datastore.admin.v1.Index.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - if (error) - return "index." + error; - } - return null; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.admin.v1.CreateIndexRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for CreateIndexRequest - * @function getTypeUrl - * @memberof google.datastore.admin.v1.CreateIndexRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateIndexRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.CreateIndexRequest"; - }; - - return CreateIndexRequest; - })(); - - v1.DeleteIndexRequest = (function() { - - /** - * Properties of a DeleteIndexRequest. - * @memberof google.datastore.admin.v1 - * @interface IDeleteIndexRequest - * @property {string|null} [projectId] DeleteIndexRequest projectId - * @property {string|null} [indexId] DeleteIndexRequest indexId - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteIndexRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @instance - */ - DeleteIndexRequest.prototype.projectId = ""; - - /** - * DeleteIndexRequest indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @instance - */ - DeleteIndexRequest.prototype.indexId = ""; - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.indexId = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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 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, long) { - if (object instanceof $root.google.datastore.admin.v1.DeleteIndexRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for DeleteIndexRequest - * @function getTypeUrl - * @memberof google.datastore.admin.v1.DeleteIndexRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteIndexRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.DeleteIndexRequest"; - }; - - return DeleteIndexRequest; - })(); - - v1.GetIndexRequest = (function() { - - /** - * Properties of a GetIndexRequest. - * @memberof google.datastore.admin.v1 - * @interface IGetIndexRequest - * @property {string|null} [projectId] GetIndexRequest projectId - * @property {string|null} [indexId] GetIndexRequest indexId - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 = ""; - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.projectId = reader.string(); - break; - } - case 3: { - message.indexId = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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 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, long) { - if (object instanceof $root.google.datastore.admin.v1.GetIndexRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for GetIndexRequest - * @function getTypeUrl - * @memberof google.datastore.admin.v1.GetIndexRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetIndexRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.GetIndexRequest"; - }; - - return GetIndexRequest; - })(); - - v1.ListIndexesRequest = (function() { - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListIndexesRequest projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.projectId = ""; - - /** - * ListIndexesRequest filter. - * @member {string} filter - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.filter = ""; - - /** - * ListIndexesRequest pageSize. - * @member {number} pageSize - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.pageSize = 0; - - /** - * ListIndexesRequest pageToken. - * @member {string} pageToken - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @instance - */ - ListIndexesRequest.prototype.pageToken = ""; - - /** - * 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 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 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 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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, long); - break; - } - } - return message; - }; - - /** - * 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 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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 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, long) { - if (object instanceof $root.google.datastore.admin.v1.ListIndexesRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 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 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); - }; - - /** - * Gets the default type url for ListIndexesRequest - * @function getTypeUrl - * @memberof google.datastore.admin.v1.ListIndexesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListIndexesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.ListIndexesRequest"; - }; - - return ListIndexesRequest; - })(); - - v1.ListIndexesResponse = (function() { - - /** - * 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 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListIndexesResponse indexes. - * @member {Array.} indexes - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @instance - */ - ListIndexesResponse.prototype.indexes = $util.emptyArray; - - /** - * ListIndexesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @instance - */ - ListIndexesResponse.prototype.nextPageToken = ""; - - /** - * 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); - }; - - /** - * 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 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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(), undefined, long + 1)); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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 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, long) { - if (object instanceof $root.google.datastore.admin.v1.ListIndexesResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ListIndexesResponse - * @function getTypeUrl - * @memberof google.datastore.admin.v1.ListIndexesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListIndexesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.ListIndexesResponse"; - }; - - return ListIndexesResponse; - })(); - - v1.IndexOperationMetadata = (function() { - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.datastore.admin.v1.CommonMetadata.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.progressEntities = $root.google.datastore.admin.v1.Progress.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.indexId = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.datastore.admin.v1.CommonMetadata.verify(message.common, long + 1); - if (error) - return "common." + error; - } - if (message.progressEntities != null && message.hasOwnProperty("progressEntities")) { - var error = $root.google.datastore.admin.v1.Progress.verify(message.progressEntities, long + 1); - if (error) - return "progressEntities." + error; - } - if (message.indexId != null && message.hasOwnProperty("indexId")) - if (!$util.isString(message.indexId)) - return "indexId: string expected"; - return null; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.admin.v1.IndexOperationMetadata) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - if (object.indexId != null) - message.indexId = String(object.indexId); - return message; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for IndexOperationMetadata - * @function getTypeUrl - * @memberof google.datastore.admin.v1.IndexOperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndexOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.IndexOperationMetadata"; - }; - - return IndexOperationMetadata; - })(); - - v1.DatastoreFirestoreMigrationMetadata = (function() { - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * DatastoreFirestoreMigrationMetadata migrationState. - * @member {google.datastore.admin.v1.MigrationState} migrationState - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @instance - */ - DatastoreFirestoreMigrationMetadata.prototype.migrationState = 0; - - /** - * DatastoreFirestoreMigrationMetadata migrationStep. - * @member {google.datastore.admin.v1.MigrationStep} migrationStep - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @instance - */ - DatastoreFirestoreMigrationMetadata.prototype.migrationStep = 0; - - /** - * 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 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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.migrationState = reader.int32(); - break; - } - case 2: { - message.migrationStep = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - 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) { - default: - if (typeof object.migrationStep === "number") { - message.migrationStep = object.migrationStep; - break; - } - break; - 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; - }; - - /** - * 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] === 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] === undefined ? message.migrationStep : $root.google.datastore.admin.v1.MigrationStep[message.migrationStep] : message.migrationStep; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for DatastoreFirestoreMigrationMetadata - * @function getTypeUrl - * @memberof google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DatastoreFirestoreMigrationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata"; - }; - - return DatastoreFirestoreMigrationMetadata; - })(); - - /** - * 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; - })(); - - v1.Index = (function() { - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Index projectId. - * @member {string} projectId - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.projectId = ""; - - /** - * Index indexId. - * @member {string} indexId - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.indexId = ""; - - /** - * Index kind. - * @member {string} kind - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.kind = ""; - - /** - * Index ancestor. - * @member {google.datastore.admin.v1.Index.AncestorMode} ancestor - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.ancestor = 0; - - /** - * Index properties. - * @member {Array.} properties - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.properties = $util.emptyArray; - - /** - * Index state. - * @member {google.datastore.admin.v1.Index.State} state - * @memberof google.datastore.admin.v1.Index - * @instance - */ - Index.prototype.state = 0; - - /** - * 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 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 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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(), undefined, long + 1)); - break; - } - case 7: { - message.state = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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 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, long) { - if (object instanceof $root.google.datastore.admin.v1.Index) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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) { - default: - if (typeof object.ancestor === "number") { - message.ancestor = object.ancestor; - break; - } - break; - 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], long + 1); - } - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "DELETING": - case 3: - message.state = 3; - break; - case "ERROR": - case 4: - message.state = 4; - break; - } - return message; - }; - - /** - * 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] === 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] === undefined ? message.state : $root.google.datastore.admin.v1.Index.State[message.state] : message.state; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for Index - * @function getTypeUrl - * @memberof google.datastore.admin.v1.Index - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Index.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.Index"; - }; - - /** - * 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; - })(); - - /** - * 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; - })(); - - Index.IndexedProperty = (function() { - - /** - * 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 - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * IndexedProperty name. - * @member {string} name - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @instance - */ - IndexedProperty.prototype.name = ""; - - /** - * IndexedProperty direction. - * @member {google.datastore.admin.v1.Index.Direction} direction - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @instance - */ - IndexedProperty.prototype.direction = 0; - - /** - * 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); - }; - - /** - * 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 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 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.direction = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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 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, long) { - if (object instanceof $root.google.datastore.admin.v1.Index.IndexedProperty) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.admin.v1.Index.IndexedProperty(); - 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; - 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 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] === undefined ? message.direction : $root.google.datastore.admin.v1.Index.Direction[message.direction] : message.direction; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for IndexedProperty - * @function getTypeUrl - * @memberof google.datastore.admin.v1.Index.IndexedProperty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - IndexedProperty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.Index.IndexedProperty"; - }; - - return IndexedProperty; - })(); - - /** - * 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; - })(); - - return Index; - })(); - - v1.MigrationStateEvent = (function() { - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * MigrationStateEvent state. - * @member {google.datastore.admin.v1.MigrationState} state - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @instance - */ - MigrationStateEvent.prototype.state = 0; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.state = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.datastore.admin.v1.MigrationStateEvent) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - 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 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] === undefined ? message.state : $root.google.datastore.admin.v1.MigrationState[message.state] : message.state; - 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); - }; - - /** - * Gets the default type url for MigrationStateEvent - * @function getTypeUrl - * @memberof google.datastore.admin.v1.MigrationStateEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MigrationStateEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.MigrationStateEvent"; - }; - - return MigrationStateEvent; - })(); - - v1.MigrationProgressEvent = (function() { - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * 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 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 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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(), undefined, long + 1); - break; - } - case 3: { - message.redirectWritesStepDetails = $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - 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, long + 1); - if (error) - return "redirectWritesStepDetails." + error; - } - } - return null; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - 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, long + 1); - } - 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, long + 1); - } - return message; - }; - - /** - * 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] === 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) - 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 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); - }; - - /** - * Gets the default type url for MigrationProgressEvent - * @function getTypeUrl - * @memberof google.datastore.admin.v1.MigrationProgressEvent - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MigrationProgressEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.MigrationProgressEvent"; - }; - - /** - * 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; - })(); - - MigrationProgressEvent.PrepareStepDetails = (function() { - - /** - * 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 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PrepareStepDetails concurrencyMode. - * @member {google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode} concurrencyMode - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @instance - */ - PrepareStepDetails.prototype.concurrencyMode = 0; - - /** - * 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 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; - }; - - /** - * 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 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.concurrencyMode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - 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] === undefined ? message.concurrencyMode : $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for PrepareStepDetails - * @function getTypeUrl - * @memberof google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PrepareStepDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails"; - }; - - return PrepareStepDetails; - })(); - - MigrationProgressEvent.RedirectWritesStepDetails = (function() { - - /** - * 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 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 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 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 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 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.concurrencyMode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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 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, long) { - if (object instanceof $root.google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - 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 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] === undefined ? message.concurrencyMode : $root.google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode[message.concurrencyMode] : message.concurrencyMode; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for RedirectWritesStepDetails - * @function getTypeUrl - * @memberof google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RedirectWritesStepDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails"; - }; - - return RedirectWritesStepDetails; - })(); - - return MigrationProgressEvent; - })(); - - /** - * 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 v1; - })(); - - return admin; - })(); - - datastore.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.datastore - * @namespace - */ - var v1 = {}; - - v1.AggregationResult = (function() { - - /** - * Properties of an AggregationResult. - * @memberof google.datastore.v1 - * @interface IAggregationResult - * @property {Object.|null} [aggregateProperties] AggregationResult aggregateProperties - */ - - /** - * Constructs a new AggregationResult. - * @memberof google.datastore.v1 - * @classdesc Represents an AggregationResult. - * @implements IAggregationResult - * @constructor - * @param {google.datastore.v1.IAggregationResult=} [properties] Properties to set - */ - function AggregationResult(properties) { - this.aggregateProperties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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. - * @function create - * @memberof google.datastore.v1.AggregationResult - * @static - * @param {google.datastore.v1.IAggregationResult=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationResult} AggregationResult instance - */ - AggregationResult.create = function create(properties) { - return new AggregationResult(properties); - }; - - /** - * 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.IAggregationResult} message AggregationResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - 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 writer; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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(), undefined, long + 1); - break; - default: - reader.skipType(tag2 & 7, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.aggregateProperties, key); - message.aggregateProperties[key] = value; - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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]], long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.AggregationResult) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 (keys[i] === "__proto__") - $util.makeProp(message.aggregateProperties, keys[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]], long + 1); - } - } - 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) { - if (keys2[j] === "__proto__") - $util.makeProp(object.aggregateProperties, keys2[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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationResultBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1)); - break; - } - case 2: { - message.moreResults = reader.int32(); - break; - } - case 3: { - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.AggregationResultBatch) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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; - 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, long + 1); - } - return message; - }; - - /** - * 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] === undefined ? message.moreResults : $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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for AggregationResultBatch - * @function getTypeUrl - * @memberof google.datastore.v1.AggregationResultBatch - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AggregationResultBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.AggregationResultBatch"; - }; - - return AggregationResultBatch; - })(); - - v1.PartitionId = (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 - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PartitionId projectId. - * @member {string} projectId - * @memberof google.datastore.v1.PartitionId - * @instance - */ - PartitionId.prototype.projectId = ""; - - /** - * PartitionId databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.PartitionId - * @instance - */ - PartitionId.prototype.databaseId = ""; - - /** - * PartitionId namespaceId. - * @member {string} namespaceId - * @memberof google.datastore.v1.PartitionId - * @instance - */ - PartitionId.prototype.namespaceId = ""; - - /** - * 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); - }; - - /** - * 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.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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PartitionId(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.projectId = reader.string(); - break; - } - case 3: { - message.databaseId = reader.string(); - break; - } - case 4: { - message.namespaceId = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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"; - return null; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.v1.PartitionId) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - }; - - /** - * 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.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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for PartitionId - * @function getTypeUrl - * @memberof google.datastore.v1.PartitionId - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PartitionId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.PartitionId"; - }; - - return PartitionId; - })(); - - v1.Key = (function() { - - /** - * Properties of a Key. - * @memberof google.datastore.v1 - * @interface IKey - * @property {google.datastore.v1.IPartitionId|null} [partitionId] Key partitionId - * @property {Array.|null} [path] Key path - */ - - /** - * Constructs a new Key. - * @memberof google.datastore.v1 - * @classdesc Represents a Key. - * @implements IKey - * @constructor - * @param {google.datastore.v1.IKey=} [properties] Properties to set - */ - function Key(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Key partitionId. - * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId - * @memberof google.datastore.v1.Key - * @instance - */ - Key.prototype.partitionId = null; - - /** - * 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.Key - * @static - * @param {google.datastore.v1.IKey=} [properties] Properties to set - * @returns {google.datastore.v1.Key} Key instance - */ - Key.create = function create(properties) { - return new Key(properties); - }; - - /** - * Encodes the specified Key message. Does not implicitly {@link google.datastore.v1.Key.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.Key - * @static - * @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 - */ - Key.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(); - return writer; - }; - - /** - * Encodes the specified Key message, length delimited. Does not implicitly {@link google.datastore.v1.Key.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.Key - * @static - * @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 - */ - Key.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Key message from the specified reader or buffer. - * @function decode - * @memberof google.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.Key} Key - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Key.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Key(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.partitionId = $root.google.datastore.v1.PartitionId.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - if (!(message.path && message.path.length)) - message.path = []; - message.path.push($root.google.datastore.v1.Key.PathElement.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Key message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.Key - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Key.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Key message. - * @function verify - * @memberof google.datastore.v1.Key - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Key.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.partitionId != null && message.hasOwnProperty("partitionId")) { - var error = $root.google.datastore.v1.PartitionId.verify(message.partitionId, long + 1); - 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], long + 1); - if (error) - return "path." + error; - } - } - return null; - }; - - /** - * Creates a Key message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.Key - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.Key} Key - */ - Key.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.Key) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a Key message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.Key - * @static - * @param {google.datastore.v1.Key} message Key - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Key.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - 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); - } - 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); - }; - - /** - * Gets the default type url for Key - * @function getTypeUrl - * @memberof google.datastore.v1.Key - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Key.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.Key"; - }; - - 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 && keys[i] !== "__proto__") - 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; - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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, long); - break; - } - } - return message; - }; - - /** - * 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 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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 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, long) { - if (object instanceof $root.google.datastore.v1.Key.PathElement) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for PathElement - * @function getTypeUrl - * @memberof google.datastore.v1.Key.PathElement - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PathElement.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.Key.PathElement"; - }; - - return PathElement; - })(); - - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ArrayValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.datastore.v1.Value.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.ArrayValue) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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); - }; - - /** - * Gets the default type url for ArrayValue - * @function getTypeUrl - * @memberof google.datastore.v1.ArrayValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ArrayValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.ArrayValue"; - }; - - return ArrayValue; - })(); - - v1.Value = (function() { - - /** - * Properties of a Value. - * @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 - */ - - /** - * Constructs a new Value. - * @memberof google.datastore.v1 - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.datastore.v1.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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. - * @function create - * @memberof google.datastore.v1.Value - * @static - * @param {google.datastore.v1.IValue=} [properties] Properties to set - * @returns {google.datastore.v1.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.Value - * @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); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.datastore.v1.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.Value - * @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.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.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.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1); - break; - } - case 5: { - message.keyValue = $root.google.datastore.v1.Key.decode(reader, reader.uint32(), undefined, long + 1); - 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(), undefined, long + 1); - break; - } - case 6: { - message.entityValue = $root.google.datastore.v1.Entity.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 9: { - message.arrayValue = $root.google.datastore.v1.ArrayValue.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 14: { - message.meaning = reader.int32(); - break; - } - case 19: { - message.excludeFromIndexes = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - 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, long + 1); - 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, long + 1); - 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, long + 1); - 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, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.Value) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - 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, long + 1); - } - 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, long + 1); - } - 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 >= 0) - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - 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"; - } - 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] === undefined ? message.nullValue : $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 Value to JSON. - * @function toJSON - * @memberof google.datastore.v1.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.datastore.v1.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.Value"; - }; - - return Value; - })(); - - v1.Entity = (function() { - - /** - * Properties of an Entity. - * @memberof google.datastore.v1 - * @interface IEntity - * @property {google.datastore.v1.IKey|null} [key] Entity key - * @property {Object.|null} [properties] Entity properties - */ - - /** - * Constructs a new Entity. - * @memberof google.datastore.v1 - * @classdesc Represents an Entity. - * @implements IEntity - * @constructor - * @param {google.datastore.v1.IEntity=} [properties] Properties to set - */ - function Entity(properties) { - this.properties = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Entity key. - * @member {google.datastore.v1.IKey|null|undefined} key - * @memberof google.datastore.v1.Entity - * @instance - */ - Entity.prototype.key = null; - - /** - * Entity properties. - * @member {Object.} properties - * @memberof google.datastore.v1.Entity - * @instance - */ - Entity.prototype.properties = $util.emptyObject; - - /** - * Creates a new Entity instance using the specified properties. - * @function create - * @memberof google.datastore.v1.Entity - * @static - * @param {google.datastore.v1.IEntity=} [properties] Properties to set - * @returns {google.datastore.v1.Entity} Entity instance - */ - Entity.create = function create(properties) { - return new Entity(properties); - }; - - /** - * Encodes the specified Entity message. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.Entity - * @static - * @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 - */ - 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 Entity message, length delimited. Does not implicitly {@link google.datastore.v1.Entity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.Entity - * @static - * @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 - */ - Entity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Entity message from the specified reader or buffer. - * @function decode - * @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.Entity} Entity - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32(), undefined, long + 1); - 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(), undefined, long + 1); - break; - default: - reader.skipType(tag2 & 7, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.properties, key); - message.properties[key] = value; - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an Entity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.Entity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Entity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Entity message. - * @function verify - * @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 - */ - Entity.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.datastore.v1.Key.verify(message.key, long + 1); - if (error) - return "key." + 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]], long + 1); - if (error) - return "properties." + error; - } - } - 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, long) { - if (object instanceof $root.google.datastore.v1.Entity) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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 (keys[i] === "__proto__") - $util.makeProp(message.properties, keys[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]], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.Entity - * @static - * @param {google.datastore.v1.Entity} message Entity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Entity.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) { - if (keys2[j] === "__proto__") - $util.makeProp(object.properties, keys2[j]); - object.properties[keys2[j]] = $root.google.datastore.v1.Value.toObject(message.properties[keys2[j]], options); - } - } - return object; - }; - - /** - * Converts this Entity to JSON. - * @function toJSON - * @memberof google.datastore.v1.Entity - * @instance - * @returns {Object.} JSON object - */ - Entity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Entity - * @function getTypeUrl - * @memberof google.datastore.v1.Entity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Entity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.Entity"; - }; - - return Entity; - })(); - - v1.EntityResult = (function() { - - /** - * Properties of an EntityResult. - * @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} [createTime] EntityResult createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] EntityResult updateTime - * @property {Uint8Array|null} [cursor] EntityResult cursor - */ - - /** - * Constructs a new EntityResult. - * @memberof google.datastore.v1 - * @classdesc Represents an EntityResult. - * @implements IEntityResult - * @constructor - * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set - */ - function EntityResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * EntityResult entity. - * @member {google.datastore.v1.IEntity|null|undefined} entity - * @memberof google.datastore.v1.EntityResult - * @instance - */ - EntityResult.prototype.entity = null; - - /** - * EntityResult version. - * @member {number|Long} version - * @memberof google.datastore.v1.EntityResult - * @instance - */ - EntityResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * EntityResult createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.datastore.v1.EntityResult - * @instance - */ - EntityResult.prototype.createTime = null; - - /** - * 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.EntityResult - * @static - * @param {google.datastore.v1.IEntityResult=} [properties] Properties to set - * @returns {google.datastore.v1.EntityResult} EntityResult instance - */ - EntityResult.create = function create(properties) { - return new EntityResult(properties); - }; - - /** - * Encodes the specified EntityResult message. Does not implicitly {@link google.datastore.v1.EntityResult.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.EntityResult - * @static - * @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 - */ - EntityResult.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.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, 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. - * @function encodeDelimited - * @memberof google.datastore.v1.EntityResult - * @static - * @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 - */ - EntityResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EntityResult message from the specified reader or buffer. - * @function decode - * @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.EntityResult} EntityResult - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.EntityResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.entity = $root.google.datastore.v1.Entity.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.version = reader.int64(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.cursor = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an EntityResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.EntityResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - EntityResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EntityResult message. - * @function verify - * @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 - */ - EntityResult.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.entity != null && message.hasOwnProperty("entity")) { - var error = $root.google.datastore.v1.Entity.verify(message.entity, long + 1); - 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.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); - 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 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, long) { - if (object instanceof $root.google.datastore.v1.EntityResult) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.datastore.v1.EntityResult.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); - } - 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, long + 1); - } - 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 >= 0) - message.cursor = object.cursor; - return message; - }; - - /** - * Creates a plain object from an EntityResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.EntityResult - * @static - * @param {google.datastore.v1.EntityResult} message EntityResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityResult.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); - } - 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; - object.createTime = 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.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - return object; - }; - - /** - * Converts this EntityResult to JSON. - * @function toJSON - * @memberof google.datastore.v1.EntityResult - * @instance - * @returns {Object.} JSON object - */ - EntityResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EntityResult - * @function getTypeUrl - * @memberof google.datastore.v1.EntityResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EntityResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.EntityResult"; - }; - - /** - * 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 - * @property {google.datastore.v1.IFindNearest|null} [findNearest] Query findNearest - */ - - /** - * 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 && keys[i] !== "__proto__") - 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 - */ - Query.prototype.startCursor = $util.newBuffer([]); - - /** - * Query endCursor. - * @member {Uint8Array} endCursor - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.endCursor = $util.newBuffer([]); - - /** - * Query offset. - * @member {number} offset - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.offset = 0; - - /** - * Query limit. - * @member {google.protobuf.IInt32Value|null|undefined} limit - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.limit = null; - - /** - * Query findNearest. - * @member {google.datastore.v1.IFindNearest|null|undefined} findNearest - * @memberof google.datastore.v1.Query - * @instance - */ - Query.prototype.findNearest = null; - - /** - * Creates a new Query instance using the specified properties. - * @function create - * @memberof google.datastore.v1.Query - * @static - * @param {google.datastore.v1.IQuery=} [properties] Properties to set - * @returns {google.datastore.v1.Query} Query instance - */ - Query.create = function create(properties) { - return new Query(properties); - }; - - /** - * Encodes the specified Query message. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.Query - * @static - * @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 - */ - Query.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.findNearest != null && Object.hasOwnProperty.call(message, "findNearest")) - $root.google.datastore.v1.FindNearest.encode(message.findNearest, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Query message, length delimited. Does not implicitly {@link google.datastore.v1.Query.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.Query - * @static - * @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 - */ - Query.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Query message from the specified reader or buffer. - * @function decode - * @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.Query} Query - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Query(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1)); - break; - } - case 3: { - if (!(message.kind && message.kind.length)) - message.kind = []; - message.kind.push($root.google.datastore.v1.KindExpression.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 4: { - message.filter = $root.google.datastore.v1.Filter.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - if (!(message.order && message.order.length)) - message.order = []; - message.order.push($root.google.datastore.v1.PropertyOrder.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 6: { - if (!(message.distinctOn && message.distinctOn.length)) - message.distinctOn = []; - message.distinctOn.push($root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32(), undefined, long + 1)); - 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(), undefined, long + 1); - break; - } - case 13: { - message.findNearest = $root.google.datastore.v1.FindNearest.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Query message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.Query - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Query.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Query message. - * @function verify - * @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 - */ - Query.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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], long + 1); - if (error) - return "kind." + error; - } - } - if (message.filter != null && message.hasOwnProperty("filter")) { - var error = $root.google.datastore.v1.Filter.verify(message.filter, long + 1); - 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], long + 1); - 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], long + 1); - 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, long + 1); - if (error) - return "limit." + error; - } - if (message.findNearest != null && message.hasOwnProperty("findNearest")) { - var error = $root.google.datastore.v1.FindNearest.verify(message.findNearest, long + 1); - if (error) - return "findNearest." + 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, long) { - if (object instanceof $root.google.datastore.v1.Query) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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], long + 1); - } - } - 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, long + 1); - } - 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], long + 1); - } - } - 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], long + 1); - } - } - 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 >= 0) - 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 >= 0) - 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, long + 1); - } - if (object.findNearest != null) { - if (typeof object.findNearest !== "object") - throw TypeError(".google.datastore.v1.Query.findNearest: object expected"); - message.findNearest = $root.google.datastore.v1.FindNearest.fromObject(object.findNearest, long + 1); - } - 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; - object.findNearest = 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); - if (message.findNearest != null && message.hasOwnProperty("findNearest")) - object.findNearest = $root.google.datastore.v1.FindNearest.toObject(message.findNearest, options); - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for Query - * @function getTypeUrl - * @memberof google.datastore.v1.Query - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Query.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.Query"; - }; - - return Query; - })(); - - v1.AggregationQuery = (function() { - - /** - * 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 - */ - - /** - * Constructs a new AggregationQuery. - * @memberof google.datastore.v1 - * @classdesc Represents an AggregationQuery. - * @implements IAggregationQuery - * @constructor - * @param {google.datastore.v1.IAggregationQuery=} [properties] Properties to set - */ - function AggregationQuery(properties) { - this.aggregations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * AggregationQuery nestedQuery. - * @member {google.datastore.v1.IQuery|null|undefined} nestedQuery - * @memberof google.datastore.v1.AggregationQuery - * @instance - */ - AggregationQuery.prototype.nestedQuery = null; - - /** - * AggregationQuery aggregations. - * @member {Array.} aggregations - * @memberof google.datastore.v1.AggregationQuery - * @instance - */ - AggregationQuery.prototype.aggregations = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * AggregationQuery queryType. - * @member {"nestedQuery"|undefined} queryType - * @memberof google.datastore.v1.AggregationQuery - * @instance - */ - Object.defineProperty(AggregationQuery.prototype, "queryType", { - get: $util.oneOfGetter($oneOfFields = ["nestedQuery"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AggregationQuery instance using the specified properties. - * @function create - * @memberof google.datastore.v1.AggregationQuery - * @static - * @param {google.datastore.v1.IAggregationQuery=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationQuery} AggregationQuery instance - */ - AggregationQuery.create = function create(properties) { - return new AggregationQuery(properties); - }; - - /** - * Encodes the specified AggregationQuery message. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.AggregationQuery - * @static - * @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 - */ - AggregationQuery.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(); - return writer; - }; - - /** - * Encodes the specified AggregationQuery message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.AggregationQuery - * @static - * @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 - */ - AggregationQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AggregationQuery message from the specified reader or buffer. - * @function decode - * @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.AggregationQuery} AggregationQuery - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nestedQuery = $root.google.datastore.v1.Query.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - if (!(message.aggregations && message.aggregations.length)) - message.aggregations = []; - message.aggregations.push($root.google.datastore.v1.AggregationQuery.Aggregation.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an AggregationQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AggregationQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - AggregationQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AggregationQuery message. - * @function verify - * @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 - */ - AggregationQuery.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.nestedQuery != null && message.hasOwnProperty("nestedQuery")) { - properties.queryType = 1; - { - var error = $root.google.datastore.v1.Query.verify(message.nestedQuery, long + 1); - if (error) - return "nestedQuery." + 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], long + 1); - if (error) - return "aggregations." + 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, long) { - if (object instanceof $root.google.datastore.v1.AggregationQuery) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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], long + 1); - } - } - 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); - }; - - /** - * Gets the default type url for AggregationQuery - * @function getTypeUrl - * @memberof google.datastore.v1.AggregationQuery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AggregationQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.AggregationQuery"; - }; - - 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 {google.datastore.v1.AggregationQuery.Aggregation.ISum|null} [sum] Aggregation sum - * @property {google.datastore.v1.AggregationQuery.Aggregation.IAvg|null} [avg] Aggregation avg - * @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 && keys[i] !== "__proto__") - 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 sum. - * @member {google.datastore.v1.AggregationQuery.Aggregation.ISum|null|undefined} sum - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @instance - */ - Aggregation.prototype.sum = null; - - /** - * Aggregation avg. - * @member {google.datastore.v1.AggregationQuery.Aggregation.IAvg|null|undefined} avg - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @instance - */ - Aggregation.prototype.avg = 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"|"sum"|"avg"|undefined} operator - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @instance - */ - Object.defineProperty(Aggregation.prototype, "operator", { - get: $util.oneOfGetter($oneOfFields = ["count", "sum", "avg"]), - 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.sum != null && Object.hasOwnProperty.call(message, "sum")) - $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.encode(message.sum, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.avg != null && Object.hasOwnProperty.call(message, "avg")) - $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.encode(message.avg, writer.uint32(/* id 3, wireType 2 =*/26).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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.count = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.sum = $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.avg = $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 7: { - message.alias = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.count != null && message.hasOwnProperty("count")) { - properties.operator = 1; - { - var error = $root.google.datastore.v1.AggregationQuery.Aggregation.Count.verify(message.count, long + 1); - if (error) - return "count." + error; - } - } - if (message.sum != null && message.hasOwnProperty("sum")) { - if (properties.operator === 1) - return "operator: multiple values"; - properties.operator = 1; - { - var error = $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.verify(message.sum, long + 1); - if (error) - return "sum." + error; - } - } - if (message.avg != null && message.hasOwnProperty("avg")) { - if (properties.operator === 1) - return "operator: multiple values"; - properties.operator = 1; - { - var error = $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.verify(message.avg, long + 1); - if (error) - return "avg." + 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. - * @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, long) { - if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - if (object.sum != null) { - if (typeof object.sum !== "object") - throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.sum: object expected"); - message.sum = $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.fromObject(object.sum, long + 1); - } - if (object.avg != null) { - if (typeof object.avg !== "object") - throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.avg: object expected"); - message.avg = $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.fromObject(object.avg, long + 1); - } - 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 (message.sum != null && message.hasOwnProperty("sum")) { - object.sum = $root.google.datastore.v1.AggregationQuery.Aggregation.Sum.toObject(message.sum, options); - if (options.oneofs) - object.operator = "sum"; - } - if (message.avg != null && message.hasOwnProperty("avg")) { - object.avg = $root.google.datastore.v1.AggregationQuery.Aggregation.Avg.toObject(message.avg, options); - if (options.oneofs) - object.operator = "avg"; - } - 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); - }; - - /** - * Gets the default type url for Aggregation - * @function getTypeUrl - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Aggregation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.AggregationQuery.Aggregation"; - }; - - Aggregation.Count = (function() { - - /** - * Properties of a Count. - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @interface ICount - * @property {google.protobuf.IInt64Value|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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Count upTo. - * @member {google.protobuf.IInt64Value|null|undefined} upTo - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @instance - */ - Count.prototype.upTo = null; - - /** - * 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")) - $root.google.protobuf.Int64Value.encode(message.upTo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.upTo = $root.google.protobuf.Int64Value.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.upTo != null && message.hasOwnProperty("upTo")) { - var error = $root.google.protobuf.Int64Value.verify(message.upTo, long + 1); - if (error) - return "upTo." + error; - } - 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, long) { - if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation.Count) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Count(); - if (object.upTo != null) { - if (typeof object.upTo !== "object") - throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.Count.upTo: object expected"); - message.upTo = $root.google.protobuf.Int64Value.fromObject(object.upTo, long + 1); - } - 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 = null; - if (message.upTo != null && message.hasOwnProperty("upTo")) - object.upTo = $root.google.protobuf.Int64Value.toObject(message.upTo, options); - 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); - }; - - /** - * Gets the default type url for Count - * @function getTypeUrl - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Count - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Count.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.AggregationQuery.Aggregation.Count"; - }; - - return Count; - })(); - - Aggregation.Sum = (function() { - - /** - * Properties of a Sum. - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @interface ISum - * @property {google.datastore.v1.IPropertyReference|null} [property] Sum property - */ - - /** - * Constructs a new Sum. - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @classdesc Represents a Sum. - * @implements ISum - * @constructor - * @param {google.datastore.v1.AggregationQuery.Aggregation.ISum=} [properties] Properties to set - */ - function Sum(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Sum property. - * @member {google.datastore.v1.IPropertyReference|null|undefined} property - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @instance - */ - Sum.prototype.property = null; - - /** - * Creates a new Sum instance using the specified properties. - * @function create - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.ISum=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Sum} Sum instance - */ - Sum.create = function create(properties) { - return new Sum(properties); - }; - - /** - * Encodes the specified Sum message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Sum.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.ISum} message Sum message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sum.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - 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 Sum message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Sum.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.ISum} message Sum message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sum.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Sum message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @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.Sum} Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sum.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Sum(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Sum message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Sum} Sum - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sum.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Sum message. - * @function verify - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Sum.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.property != null && message.hasOwnProperty("property")) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.property, long + 1); - if (error) - return "property." + error; - } - return null; - }; - - /** - * Creates a Sum message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Sum} Sum - */ - Sum.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation.Sum) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Sum(); - if (object.property != null) { - if (typeof object.property !== "object") - throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.Sum.property: object expected"); - message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a Sum message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.Sum} message Sum - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Sum.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 Sum to JSON. - * @function toJSON - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @instance - * @returns {Object.} JSON object - */ - Sum.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Sum - * @function getTypeUrl - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Sum - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Sum.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.AggregationQuery.Aggregation.Sum"; - }; - - return Sum; - })(); - - Aggregation.Avg = (function() { - - /** - * Properties of an Avg. - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @interface IAvg - * @property {google.datastore.v1.IPropertyReference|null} [property] Avg property - */ - - /** - * Constructs a new Avg. - * @memberof google.datastore.v1.AggregationQuery.Aggregation - * @classdesc Represents an Avg. - * @implements IAvg - * @constructor - * @param {google.datastore.v1.AggregationQuery.Aggregation.IAvg=} [properties] Properties to set - */ - function Avg(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Avg property. - * @member {google.datastore.v1.IPropertyReference|null|undefined} property - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @instance - */ - Avg.prototype.property = null; - - /** - * Creates a new Avg instance using the specified properties. - * @function create - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.IAvg=} [properties] Properties to set - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Avg} Avg instance - */ - Avg.create = function create(properties) { - return new Avg(properties); - }; - - /** - * Encodes the specified Avg message. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Avg.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.IAvg} message Avg message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Avg.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(); - return writer; - }; - - /** - * Encodes the specified Avg message, length delimited. Does not implicitly {@link google.datastore.v1.AggregationQuery.Aggregation.Avg.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.IAvg} message Avg message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Avg.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Avg message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @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.Avg} Avg - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Avg.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Avg(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an Avg message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Avg} Avg - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Avg.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Avg message. - * @function verify - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Avg.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.property != null && message.hasOwnProperty("property")) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.property, long + 1); - if (error) - return "property." + error; - } - return null; - }; - - /** - * Creates an Avg message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.AggregationQuery.Aggregation.Avg} Avg - */ - Avg.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.AggregationQuery.Aggregation.Avg) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.AggregationQuery.Aggregation.Avg(); - if (object.property != null) { - if (typeof object.property !== "object") - throw TypeError(".google.datastore.v1.AggregationQuery.Aggregation.Avg.property: object expected"); - message.property = $root.google.datastore.v1.PropertyReference.fromObject(object.property, long + 1); - } - return message; - }; - - /** - * Creates a plain object from an Avg message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @static - * @param {google.datastore.v1.AggregationQuery.Aggregation.Avg} message Avg - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Avg.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 Avg to JSON. - * @function toJSON - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @instance - * @returns {Object.} JSON object - */ - Avg.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Avg - * @function getTypeUrl - * @memberof google.datastore.v1.AggregationQuery.Aggregation.Avg - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Avg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.AggregationQuery.Aggregation.Avg"; - }; - - return Avg; - })(); - - return Aggregation; - })(); - - return AggregationQuery; - })(); - - v1.KindExpression = (function() { - - /** - * Properties of a KindExpression. - * @memberof google.datastore.v1 - * @interface IKindExpression - * @property {string|null} [name] KindExpression name - */ - - /** - * Constructs a new KindExpression. - * @memberof google.datastore.v1 - * @classdesc Represents a KindExpression. - * @implements IKindExpression - * @constructor - * @param {google.datastore.v1.IKindExpression=} [properties] Properties to set - */ - function KindExpression(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * KindExpression name. - * @member {string} name - * @memberof google.datastore.v1.KindExpression - * @instance - */ - KindExpression.prototype.name = ""; - - /** - * Creates a new KindExpression instance using the specified properties. - * @function create - * @memberof google.datastore.v1.KindExpression - * @static - * @param {google.datastore.v1.IKindExpression=} [properties] Properties to set - * @returns {google.datastore.v1.KindExpression} KindExpression instance - */ - KindExpression.create = function create(properties) { - return new KindExpression(properties); - }; - - /** - * Encodes the specified KindExpression message. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.KindExpression - * @static - * @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 - */ - KindExpression.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified KindExpression message, length delimited. Does not implicitly {@link google.datastore.v1.KindExpression.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.KindExpression - * @static - * @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 - */ - KindExpression.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a KindExpression message from the specified reader or buffer. - * @function decode - * @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.KindExpression} KindExpression - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.KindExpression(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a KindExpression message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.KindExpression - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - KindExpression.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KindExpression message. - * @function verify - * @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 - */ - KindExpression.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a KindExpression message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.KindExpression - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.KindExpression} KindExpression - */ - KindExpression.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.KindExpression) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 KindExpression message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.KindExpression - * @static - * @param {google.datastore.v1.KindExpression} message KindExpression - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KindExpression.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 KindExpression to JSON. - * @function toJSON - * @memberof google.datastore.v1.KindExpression - * @instance - * @returns {Object.} JSON object - */ - KindExpression.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for KindExpression - * @function getTypeUrl - * @memberof google.datastore.v1.KindExpression - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KindExpression.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.KindExpression"; - }; - - return KindExpression; - })(); - - v1.PropertyReference = (function() { - - /** - * Properties of a PropertyReference. - * @memberof google.datastore.v1 - * @interface IPropertyReference - * @property {string|null} [name] PropertyReference name - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PropertyReference name. - * @member {string} name - * @memberof google.datastore.v1.PropertyReference - * @instance - */ - PropertyReference.prototype.name = ""; - - /** - * 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); - }; - - /** - * 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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyReference(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - 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, long) { - if (object instanceof $root.google.datastore.v1.PropertyReference) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 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); - }; - - /** - * Gets the default type url for PropertyReference - * @function getTypeUrl - * @memberof google.datastore.v1.PropertyReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.PropertyReference"; - }; - - return PropertyReference; - })(); - - v1.Projection = (function() { - - /** - * Properties of a Projection. - * @memberof google.datastore.v1 - * @interface IProjection - * @property {google.datastore.v1.IPropertyReference|null} [property] Projection property - */ - - /** - * Constructs a new Projection. - * @memberof google.datastore.v1 - * @classdesc Represents a Projection. - * @implements IProjection - * @constructor - * @param {google.datastore.v1.IProjection=} [properties] Properties to set - */ - function Projection(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Projection property. - * @member {google.datastore.v1.IPropertyReference|null|undefined} property - * @memberof google.datastore.v1.Projection - * @instance - */ - Projection.prototype.property = null; - - /** - * Creates a new Projection instance using the specified properties. - * @function create - * @memberof google.datastore.v1.Projection - * @static - * @param {google.datastore.v1.IProjection=} [properties] Properties to set - * @returns {google.datastore.v1.Projection} Projection instance - */ - Projection.create = function create(properties) { - return new Projection(properties); - }; - - /** - * Encodes the specified Projection message. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.Projection - * @static - * @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 - */ - Projection.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(); - return writer; - }; - - /** - * Encodes the specified Projection message, length delimited. Does not implicitly {@link google.datastore.v1.Projection.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.Projection - * @static - * @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 - */ - Projection.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Projection message from the specified reader or buffer. - * @function decode - * @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.Projection} Projection - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Projection(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Projection message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.Projection - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - Projection.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Projection message. - * @function verify - * @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 - */ - Projection.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.property != null && message.hasOwnProperty("property")) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.property, long + 1); - if (error) - return "property." + error; - } - return null; - }; - - /** - * Creates a Projection message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.Projection - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.Projection} Projection - */ - Projection.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.Projection) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - return message; - }; - - /** - * 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 Projection to JSON. - * @function toJSON - * @memberof google.datastore.v1.Projection - * @instance - * @returns {Object.} JSON object - */ - Projection.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Projection - * @function getTypeUrl - * @memberof google.datastore.v1.Projection - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Projection.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.Projection"; - }; - - return Projection; - })(); - - v1.PropertyOrder = (function() { - - /** - * Properties of a PropertyOrder. - * @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 - */ - - /** - * Constructs a new PropertyOrder. - * @memberof google.datastore.v1 - * @classdesc Represents a PropertyOrder. - * @implements IPropertyOrder - * @constructor - * @param {google.datastore.v1.IPropertyOrder=} [properties] Properties to set - */ - function PropertyOrder(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PropertyOrder property. - * @member {google.datastore.v1.IPropertyReference|null|undefined} property - * @memberof google.datastore.v1.PropertyOrder - * @instance - */ - PropertyOrder.prototype.property = null; - - /** - * 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.PropertyOrder - * @static - * @param {google.datastore.v1.IPropertyOrder=} [properties] Properties to set - * @returns {google.datastore.v1.PropertyOrder} PropertyOrder instance - */ - PropertyOrder.create = function create(properties) { - return new PropertyOrder(properties); - }; - - /** - * 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; - }; - - /** - * 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 - */ - PropertyOrder.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyOrder(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.direction = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.property != null && message.hasOwnProperty("property")) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.property, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.PropertyOrder) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - switch (object.direction) { - default: - if (typeof object.direction === "number") { - message.direction = object.direction; - break; - } - break; - 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 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] === undefined ? message.direction : $root.google.datastore.v1.PropertyOrder.Direction[message.direction] : message.direction; - return object; - }; - - /** - * Converts this PropertyOrder to JSON. - * @function toJSON - * @memberof google.datastore.v1.PropertyOrder - * @instance - * @returns {Object.} JSON object - */ - PropertyOrder.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PropertyOrder - * @function getTypeUrl - * @memberof google.datastore.v1.PropertyOrder - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyOrder.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.PropertyOrder"; - }; - - /** - * 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; - })(); - - v1.Filter = (function() { - - /** - * 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 - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 - * @instance - */ - Filter.prototype.propertyFilter = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Filter filterType. - * @member {"compositeFilter"|"propertyFilter"|undefined} filterType - * @memberof google.datastore.v1.Filter - * @instance - */ - Object.defineProperty(Filter.prototype, "filterType", { - get: $util.oneOfGetter($oneOfFields = ["compositeFilter", "propertyFilter"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * 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); - }; - - /** - * 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 - */ - 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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Filter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.compositeFilter = $root.google.datastore.v1.CompositeFilter.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.propertyFilter = $root.google.datastore.v1.PropertyFilter.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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 - */ - Filter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.compositeFilter != null && message.hasOwnProperty("compositeFilter")) { - properties.filterType = 1; - { - var error = $root.google.datastore.v1.CompositeFilter.verify(message.compositeFilter, long + 1); - 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, long + 1); - if (error) - return "propertyFilter." + error; - } - } - return null; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.v1.Filter) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - return message; - }; - - /** - * 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 - */ - 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; - }; - - /** - * Converts this Filter to JSON. - * @function toJSON - * @memberof google.datastore.v1.Filter - * @instance - * @returns {Object.} JSON object - */ - Filter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Filter - * @function getTypeUrl - * @memberof google.datastore.v1.Filter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Filter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.Filter"; - }; - - return Filter; - })(); - - v1.CompositeFilter = (function() { - - /** - * Properties of a CompositeFilter. - * @memberof google.datastore.v1 - * @interface ICompositeFilter - * @property {google.datastore.v1.CompositeFilter.Operator|null} [op] CompositeFilter op - * @property {Array.|null} [filters] CompositeFilter filters - */ - - /** - * Constructs a new CompositeFilter. - * @memberof google.datastore.v1 - * @classdesc Represents a CompositeFilter. - * @implements ICompositeFilter - * @constructor - * @param {google.datastore.v1.ICompositeFilter=} [properties] Properties to set - */ - function CompositeFilter(properties) { - this.filters = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * CompositeFilter op. - * @member {google.datastore.v1.CompositeFilter.Operator} op - * @memberof google.datastore.v1.CompositeFilter - * @instance - */ - CompositeFilter.prototype.op = 0; - - /** - * CompositeFilter filters. - * @member {Array.} filters - * @memberof google.datastore.v1.CompositeFilter - * @instance - */ - CompositeFilter.prototype.filters = $util.emptyArray; - - /** - * Creates a new CompositeFilter instance using the specified properties. - * @function create - * @memberof google.datastore.v1.CompositeFilter - * @static - * @param {google.datastore.v1.ICompositeFilter=} [properties] Properties to set - * @returns {google.datastore.v1.CompositeFilter} CompositeFilter instance - */ - CompositeFilter.create = function create(properties) { - return new CompositeFilter(properties); - }; - - /** - * Encodes the specified CompositeFilter message. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.CompositeFilter - * @static - * @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 - */ - CompositeFilter.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(); - return writer; - }; - - /** - * Encodes the specified CompositeFilter message, length delimited. Does not implicitly {@link google.datastore.v1.CompositeFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.CompositeFilter - * @static - * @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 - */ - CompositeFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CompositeFilter message from the specified reader or buffer. - * @function decode - * @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.CompositeFilter} CompositeFilter - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CompositeFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.op = reader.int32(); - break; - } - case 2: { - if (!(message.filters && message.filters.length)) - message.filters = []; - message.filters.push($root.google.datastore.v1.Filter.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a CompositeFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.CompositeFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - CompositeFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CompositeFilter message. - * @function verify - * @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 - */ - CompositeFilter.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - if (error) - return "filters." + error; - } - } - return null; - }; - - /** - * Creates a CompositeFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.CompositeFilter - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.CompositeFilter} CompositeFilter - */ - CompositeFilter.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.CompositeFilter) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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; - break; - case "AND": - case 1: - message.op = 1; - break; - case "OR": - case 2: - message.op = 2; - break; - } - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a CompositeFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.CompositeFilter - * @static - * @param {google.datastore.v1.CompositeFilter} message CompositeFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompositeFilter.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] === 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) - object.filters[j] = $root.google.datastore.v1.Filter.toObject(message.filters[j], options); - } - return object; - }; - - /** - * Converts this CompositeFilter to JSON. - * @function toJSON - * @memberof google.datastore.v1.CompositeFilter - * @instance - * @returns {Object.} JSON object - */ - CompositeFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CompositeFilter - * @function getTypeUrl - * @memberof google.datastore.v1.CompositeFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CompositeFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.CompositeFilter"; - }; - - /** - * Operator enum. - * @name google.datastore.v1.CompositeFilter.Operator - * @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; - })(); - - return CompositeFilter; - })(); - - v1.PropertyFilter = (function() { - - /** - * Properties of a PropertyFilter. - * @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 - */ - - /** - * Constructs a new PropertyFilter. - * @memberof google.datastore.v1 - * @classdesc Represents a PropertyFilter. - * @implements IPropertyFilter - * @constructor - * @param {google.datastore.v1.IPropertyFilter=} [properties] Properties to set - */ - function PropertyFilter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PropertyFilter property. - * @member {google.datastore.v1.IPropertyReference|null|undefined} property - * @memberof google.datastore.v1.PropertyFilter - * @instance - */ - PropertyFilter.prototype.property = null; - - /** - * PropertyFilter op. - * @member {google.datastore.v1.PropertyFilter.Operator} op - * @memberof google.datastore.v1.PropertyFilter - * @instance - */ - PropertyFilter.prototype.op = 0; - - /** - * PropertyFilter value. - * @member {google.datastore.v1.IValue|null|undefined} value - * @memberof google.datastore.v1.PropertyFilter - * @instance - */ - PropertyFilter.prototype.value = null; - - /** - * Creates a new PropertyFilter instance using the specified properties. - * @function create - * @memberof google.datastore.v1.PropertyFilter - * @static - * @param {google.datastore.v1.IPropertyFilter=} [properties] Properties to set - * @returns {google.datastore.v1.PropertyFilter} PropertyFilter instance - */ - PropertyFilter.create = function create(properties) { - return new PropertyFilter(properties); - }; - - /** - * Encodes the specified PropertyFilter message. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.PropertyFilter - * @static - * @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 - */ - PropertyFilter.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(); - return writer; - }; - - /** - * Encodes the specified PropertyFilter message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyFilter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.PropertyFilter - * @static - * @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 - */ - PropertyFilter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PropertyFilter message from the specified reader or buffer. - * @function decode - * @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.PropertyFilter} PropertyFilter - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyFilter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.property = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.op = reader.int32(); - break; - } - case 3: { - message.value = $root.google.datastore.v1.Value.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a PropertyFilter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.PropertyFilter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - PropertyFilter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PropertyFilter message. - * @function verify - * @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 - */ - PropertyFilter.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.property != null && message.hasOwnProperty("property")) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.property, long + 1); - if (error) - return "property." + 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.value != null && message.hasOwnProperty("value")) { - var error = $root.google.datastore.v1.Value.verify(message.value, long + 1); - if (error) - return "value." + error; - } - return null; - }; - - /** - * Creates a PropertyFilter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.PropertyFilter - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.PropertyFilter} PropertyFilter - */ - PropertyFilter.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.PropertyFilter) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - switch (object.op) { - default: - if (typeof object.op === "number") { - message.op = object.op; - break; - } - break; - 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.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, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a PropertyFilter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.PropertyFilter - * @static - * @param {google.datastore.v1.PropertyFilter} message PropertyFilter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PropertyFilter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.property = null; - object.op = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; - object.value = 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] === 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; - }; - - /** - * Converts this PropertyFilter to JSON. - * @function toJSON - * @memberof google.datastore.v1.PropertyFilter - * @instance - * @returns {Object.} JSON object - */ - PropertyFilter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PropertyFilter - * @function getTypeUrl - * @memberof google.datastore.v1.PropertyFilter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.PropertyFilter"; - }; - - /** - * 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.FindNearest = (function() { - - /** - * Properties of a FindNearest. - * @memberof google.datastore.v1 - * @interface IFindNearest - * @property {google.datastore.v1.IPropertyReference|null} [vectorProperty] FindNearest vectorProperty - * @property {google.datastore.v1.IValue|null} [queryVector] FindNearest queryVector - * @property {google.datastore.v1.FindNearest.DistanceMeasure|null} [distanceMeasure] FindNearest distanceMeasure - * @property {google.protobuf.IInt32Value|null} [limit] FindNearest limit - * @property {string|null} [distanceResultProperty] FindNearest distanceResultProperty - * @property {google.protobuf.IDoubleValue|null} [distanceThreshold] FindNearest distanceThreshold - */ - - /** - * Constructs a new FindNearest. - * @memberof google.datastore.v1 - * @classdesc Represents a FindNearest. - * @implements IFindNearest - * @constructor - * @param {google.datastore.v1.IFindNearest=} [properties] Properties to set - */ - function FindNearest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FindNearest vectorProperty. - * @member {google.datastore.v1.IPropertyReference|null|undefined} vectorProperty - * @memberof google.datastore.v1.FindNearest - * @instance - */ - FindNearest.prototype.vectorProperty = null; - - /** - * FindNearest queryVector. - * @member {google.datastore.v1.IValue|null|undefined} queryVector - * @memberof google.datastore.v1.FindNearest - * @instance - */ - FindNearest.prototype.queryVector = null; - - /** - * FindNearest distanceMeasure. - * @member {google.datastore.v1.FindNearest.DistanceMeasure} distanceMeasure - * @memberof google.datastore.v1.FindNearest - * @instance - */ - FindNearest.prototype.distanceMeasure = 0; - - /** - * FindNearest limit. - * @member {google.protobuf.IInt32Value|null|undefined} limit - * @memberof google.datastore.v1.FindNearest - * @instance - */ - FindNearest.prototype.limit = null; - - /** - * FindNearest distanceResultProperty. - * @member {string} distanceResultProperty - * @memberof google.datastore.v1.FindNearest - * @instance - */ - FindNearest.prototype.distanceResultProperty = ""; - - /** - * FindNearest distanceThreshold. - * @member {google.protobuf.IDoubleValue|null|undefined} distanceThreshold - * @memberof google.datastore.v1.FindNearest - * @instance - */ - FindNearest.prototype.distanceThreshold = null; - - /** - * Creates a new FindNearest instance using the specified properties. - * @function create - * @memberof google.datastore.v1.FindNearest - * @static - * @param {google.datastore.v1.IFindNearest=} [properties] Properties to set - * @returns {google.datastore.v1.FindNearest} FindNearest instance - */ - FindNearest.create = function create(properties) { - return new FindNearest(properties); - }; - - /** - * Encodes the specified FindNearest message. Does not implicitly {@link google.datastore.v1.FindNearest.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.FindNearest - * @static - * @param {google.datastore.v1.IFindNearest} message FindNearest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FindNearest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.vectorProperty != null && Object.hasOwnProperty.call(message, "vectorProperty")) - $root.google.datastore.v1.PropertyReference.encode(message.vectorProperty, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.queryVector != null && Object.hasOwnProperty.call(message, "queryVector")) - $root.google.datastore.v1.Value.encode(message.queryVector, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.distanceMeasure != null && Object.hasOwnProperty.call(message, "distanceMeasure")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.distanceMeasure); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - $root.google.protobuf.Int32Value.encode(message.limit, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.distanceResultProperty != null && Object.hasOwnProperty.call(message, "distanceResultProperty")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.distanceResultProperty); - if (message.distanceThreshold != null && Object.hasOwnProperty.call(message, "distanceThreshold")) - $root.google.protobuf.DoubleValue.encode(message.distanceThreshold, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FindNearest message, length delimited. Does not implicitly {@link google.datastore.v1.FindNearest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.FindNearest - * @static - * @param {google.datastore.v1.IFindNearest} message FindNearest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FindNearest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FindNearest message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.FindNearest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.FindNearest} FindNearest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FindNearest.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.FindNearest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.vectorProperty = $root.google.datastore.v1.PropertyReference.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.queryVector = $root.google.datastore.v1.Value.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.distanceMeasure = reader.int32(); - break; - } - case 4: { - message.limit = $root.google.protobuf.Int32Value.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.distanceResultProperty = reader.string(); - break; - } - case 6: { - message.distanceThreshold = $root.google.protobuf.DoubleValue.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FindNearest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.FindNearest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.FindNearest} FindNearest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FindNearest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FindNearest message. - * @function verify - * @memberof google.datastore.v1.FindNearest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FindNearest.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.vectorProperty != null && message.hasOwnProperty("vectorProperty")) { - var error = $root.google.datastore.v1.PropertyReference.verify(message.vectorProperty, long + 1); - if (error) - return "vectorProperty." + error; - } - if (message.queryVector != null && message.hasOwnProperty("queryVector")) { - var error = $root.google.datastore.v1.Value.verify(message.queryVector, long + 1); - if (error) - return "queryVector." + error; - } - if (message.distanceMeasure != null && message.hasOwnProperty("distanceMeasure")) - switch (message.distanceMeasure) { - default: - return "distanceMeasure: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.limit != null && message.hasOwnProperty("limit")) { - var error = $root.google.protobuf.Int32Value.verify(message.limit, long + 1); - if (error) - return "limit." + error; - } - if (message.distanceResultProperty != null && message.hasOwnProperty("distanceResultProperty")) - if (!$util.isString(message.distanceResultProperty)) - return "distanceResultProperty: string expected"; - if (message.distanceThreshold != null && message.hasOwnProperty("distanceThreshold")) { - var error = $root.google.protobuf.DoubleValue.verify(message.distanceThreshold, long + 1); - if (error) - return "distanceThreshold." + error; - } - return null; - }; - - /** - * Creates a FindNearest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.FindNearest - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.FindNearest} FindNearest - */ - FindNearest.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.FindNearest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.FindNearest(); - if (object.vectorProperty != null) { - if (typeof object.vectorProperty !== "object") - throw TypeError(".google.datastore.v1.FindNearest.vectorProperty: object expected"); - message.vectorProperty = $root.google.datastore.v1.PropertyReference.fromObject(object.vectorProperty, long + 1); - } - if (object.queryVector != null) { - if (typeof object.queryVector !== "object") - throw TypeError(".google.datastore.v1.FindNearest.queryVector: object expected"); - message.queryVector = $root.google.datastore.v1.Value.fromObject(object.queryVector, long + 1); - } - switch (object.distanceMeasure) { - default: - if (typeof object.distanceMeasure === "number") { - message.distanceMeasure = object.distanceMeasure; - break; - } - break; - case "DISTANCE_MEASURE_UNSPECIFIED": - case 0: - message.distanceMeasure = 0; - break; - case "EUCLIDEAN": - case 1: - message.distanceMeasure = 1; - break; - case "COSINE": - case 2: - message.distanceMeasure = 2; - break; - case "DOT_PRODUCT": - case 3: - message.distanceMeasure = 3; - break; - } - if (object.limit != null) { - if (typeof object.limit !== "object") - throw TypeError(".google.datastore.v1.FindNearest.limit: object expected"); - message.limit = $root.google.protobuf.Int32Value.fromObject(object.limit, long + 1); - } - if (object.distanceResultProperty != null) - message.distanceResultProperty = String(object.distanceResultProperty); - if (object.distanceThreshold != null) { - if (typeof object.distanceThreshold !== "object") - throw TypeError(".google.datastore.v1.FindNearest.distanceThreshold: object expected"); - message.distanceThreshold = $root.google.protobuf.DoubleValue.fromObject(object.distanceThreshold, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a FindNearest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.FindNearest - * @static - * @param {google.datastore.v1.FindNearest} message FindNearest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FindNearest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.vectorProperty = null; - object.queryVector = null; - object.distanceMeasure = options.enums === String ? "DISTANCE_MEASURE_UNSPECIFIED" : 0; - object.limit = null; - object.distanceResultProperty = ""; - object.distanceThreshold = null; - } - if (message.vectorProperty != null && message.hasOwnProperty("vectorProperty")) - object.vectorProperty = $root.google.datastore.v1.PropertyReference.toObject(message.vectorProperty, options); - if (message.queryVector != null && message.hasOwnProperty("queryVector")) - object.queryVector = $root.google.datastore.v1.Value.toObject(message.queryVector, options); - if (message.distanceMeasure != null && message.hasOwnProperty("distanceMeasure")) - object.distanceMeasure = options.enums === String ? $root.google.datastore.v1.FindNearest.DistanceMeasure[message.distanceMeasure] === undefined ? message.distanceMeasure : $root.google.datastore.v1.FindNearest.DistanceMeasure[message.distanceMeasure] : message.distanceMeasure; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = $root.google.protobuf.Int32Value.toObject(message.limit, options); - if (message.distanceResultProperty != null && message.hasOwnProperty("distanceResultProperty")) - object.distanceResultProperty = message.distanceResultProperty; - if (message.distanceThreshold != null && message.hasOwnProperty("distanceThreshold")) - object.distanceThreshold = $root.google.protobuf.DoubleValue.toObject(message.distanceThreshold, options); - return object; - }; - - /** - * Converts this FindNearest to JSON. - * @function toJSON - * @memberof google.datastore.v1.FindNearest - * @instance - * @returns {Object.} JSON object - */ - FindNearest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FindNearest - * @function getTypeUrl - * @memberof google.datastore.v1.FindNearest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FindNearest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.FindNearest"; - }; - - /** - * DistanceMeasure enum. - * @name google.datastore.v1.FindNearest.DistanceMeasure - * @enum {number} - * @property {number} DISTANCE_MEASURE_UNSPECIFIED=0 DISTANCE_MEASURE_UNSPECIFIED value - * @property {number} EUCLIDEAN=1 EUCLIDEAN value - * @property {number} COSINE=2 COSINE value - * @property {number} DOT_PRODUCT=3 DOT_PRODUCT value - */ - FindNearest.DistanceMeasure = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DISTANCE_MEASURE_UNSPECIFIED"] = 0; - values[valuesById[1] = "EUCLIDEAN"] = 1; - values[valuesById[2] = "COSINE"] = 2; - values[valuesById[3] = "DOT_PRODUCT"] = 3; - return values; - })(); - - return FindNearest; - })(); - - v1.GqlQuery = (function() { - - /** - * Properties of a GqlQuery. - * @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 - */ - - /** - * Constructs a new GqlQuery. - * @memberof google.datastore.v1 - * @classdesc Represents a GqlQuery. - * @implements IGqlQuery - * @constructor - * @param {google.datastore.v1.IGqlQuery=} [properties] Properties to set - */ - 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 - * @instance - */ - GqlQuery.prototype.positionalBindings = $util.emptyArray; - - /** - * Creates a new GqlQuery instance using the specified properties. - * @function create - * @memberof google.datastore.v1.GqlQuery - * @static - * @param {google.datastore.v1.IGqlQuery=} [properties] Properties to set - * @returns {google.datastore.v1.GqlQuery} GqlQuery instance - */ - GqlQuery.create = function create(properties) { - return new GqlQuery(properties); - }; - - /** - * Encodes the specified GqlQuery message. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.GqlQuery - * @static - * @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 - */ - GqlQuery.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(); - } - return writer; - }; - - /** - * Encodes the specified GqlQuery message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQuery.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.GqlQuery - * @static - * @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 - */ - GqlQuery.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GqlQuery message from the specified reader or buffer. - * @function decode - * @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.GqlQuery} GqlQuery - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - 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(), undefined, long + 1); - break; - default: - reader.skipType(tag2 & 7, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.namedBindings, key); - 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(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a GqlQuery message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.GqlQuery - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - GqlQuery.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GqlQuery message. - * @function verify - * @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 - */ - GqlQuery.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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]], long + 1); - 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], long + 1); - if (error) - return "positionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a GqlQuery message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.GqlQuery - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.GqlQuery} GqlQuery - */ - GqlQuery.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.GqlQuery) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 (keys[i] === "__proto__") - $util.makeProp(message.namedBindings, keys[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]], long + 1); - } - } - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a GqlQuery message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.GqlQuery - * @static - * @param {google.datastore.v1.GqlQuery} message GqlQuery - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - 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.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) { - if (keys2[j] === "__proto__") - $util.makeProp(object.namedBindings, keys2[j]); - object.namedBindings[keys2[j]] = $root.google.datastore.v1.GqlQueryParameter.toObject(message.namedBindings[keys2[j]], options); - } - } - return object; - }; - - /** - * Converts this GqlQuery to JSON. - * @function toJSON - * @memberof google.datastore.v1.GqlQuery - * @instance - * @returns {Object.} JSON object - */ - GqlQuery.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GqlQuery - * @function getTypeUrl - * @memberof google.datastore.v1.GqlQuery - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GqlQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.GqlQuery"; - }; - - return GqlQuery; - })(); - - v1.GqlQueryParameter = (function() { - - /** - * Properties of a GqlQueryParameter. - * @memberof google.datastore.v1 - * @interface IGqlQueryParameter - * @property {google.datastore.v1.IValue|null} [value] GqlQueryParameter value - * @property {Uint8Array|null} [cursor] GqlQueryParameter cursor - */ - - /** - * Constructs a new GqlQueryParameter. - * @memberof google.datastore.v1 - * @classdesc Represents a GqlQueryParameter. - * @implements IGqlQueryParameter - * @constructor - * @param {google.datastore.v1.IGqlQueryParameter=} [properties] Properties to set - */ - function GqlQueryParameter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 - * @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.GqlQueryParameter - * @static - * @param {google.datastore.v1.IGqlQueryParameter=} [properties] Properties to set - * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter instance - */ - GqlQueryParameter.create = function create(properties) { - return new GqlQueryParameter(properties); - }; - - /** - * Encodes the specified GqlQueryParameter message. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.GqlQueryParameter - * @static - * @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 - */ - GqlQueryParameter.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); - return writer; - }; - - /** - * Encodes the specified GqlQueryParameter message, length delimited. Does not implicitly {@link google.datastore.v1.GqlQueryParameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.GqlQueryParameter - * @static - * @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 - */ - GqlQueryParameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GqlQueryParameter message from the specified reader or buffer. - * @function decode - * @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.GqlQueryParameter} GqlQueryParameter - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.GqlQueryParameter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.value = $root.google.datastore.v1.Value.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.cursor = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a GqlQueryParameter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.GqlQueryParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - GqlQueryParameter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GqlQueryParameter message. - * @function verify - * @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 - */ - GqlQueryParameter.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.value != null && message.hasOwnProperty("value")) { - properties.parameterType = 1; - { - var error = $root.google.datastore.v1.Value.verify(message.value, long + 1); - 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"; - } - return null; - }; - - /** - * Creates a GqlQueryParameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.GqlQueryParameter - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.GqlQueryParameter} GqlQueryParameter - */ - GqlQueryParameter.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.GqlQueryParameter) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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 >= 0) - message.cursor = object.cursor; - return message; - }; - - /** - * Creates a plain object from a GqlQueryParameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.GqlQueryParameter - * @static - * @param {google.datastore.v1.GqlQueryParameter} message GqlQueryParameter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GqlQueryParameter.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"; - } - return object; - }; - - /** - * Converts this GqlQueryParameter to JSON. - * @function toJSON - * @memberof google.datastore.v1.GqlQueryParameter - * @instance - * @returns {Object.} JSON object - */ - GqlQueryParameter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GqlQueryParameter - * @function getTypeUrl - * @memberof google.datastore.v1.GqlQueryParameter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GqlQueryParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.GqlQueryParameter"; - }; - - return GqlQueryParameter; - })(); - - v1.QueryResultBatch = (function() { - - /** - * Properties of a QueryResultBatch. - * @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 - */ - - /** - * Constructs a new QueryResultBatch. - * @memberof google.datastore.v1 - * @classdesc Represents a QueryResultBatch. - * @implements IQueryResultBatch - * @constructor - * @param {google.datastore.v1.IQueryResultBatch=} [properties] Properties to set - */ - function QueryResultBatch(properties) { - this.entityResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 - * @instance - */ - QueryResultBatch.prototype.readTime = null; - - /** - * Creates a new QueryResultBatch instance using the specified properties. - * @function create - * @memberof google.datastore.v1.QueryResultBatch - * @static - * @param {google.datastore.v1.IQueryResultBatch=} [properties] Properties to set - * @returns {google.datastore.v1.QueryResultBatch} QueryResultBatch instance - */ - QueryResultBatch.create = function create(properties) { - return new QueryResultBatch(properties); - }; - - /** - * Encodes the specified QueryResultBatch message. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.QueryResultBatch - * @static - * @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 - */ - QueryResultBatch.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(); - return writer; - }; - - /** - * Encodes the specified QueryResultBatch message, length delimited. Does not implicitly {@link google.datastore.v1.QueryResultBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.QueryResultBatch - * @static - * @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 - */ - QueryResultBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QueryResultBatch message from the specified reader or buffer. - * @function decode - * @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.QueryResultBatch} QueryResultBatch - * @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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.QueryResultBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1)); - 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(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a QueryResultBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.QueryResultBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @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 - */ - QueryResultBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QueryResultBatch message. - * @function verify - * @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 - */ - QueryResultBatch.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.QueryResultBatch) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 >= 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; - 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], long + 1); - } - } - 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 >= 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; - 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, long + 1); - } - 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] === 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) - 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] === 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")) - 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 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); - }; - - /** - * Gets the default type url for QueryResultBatch - * @function getTypeUrl - * @memberof google.datastore.v1.QueryResultBatch - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - QueryResultBatch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.QueryResultBatch"; - }; - - /** - * 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; - })(); - - 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; - - /** - * 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); - }; - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - /** - * 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 - */ - - /** - * 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" }); - - /** - * 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 - */ - - return Datastore; - })(); - - 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 - * @property {google.datastore.v1.IPropertyMask|null} [propertyMask] LookupRequest propertyMask - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 - * @instance - */ - LookupRequest.prototype.readOptions = null; - - /** - * LookupRequest keys. - * @member {Array.} keys - * @memberof google.datastore.v1.LookupRequest - * @instance - */ - LookupRequest.prototype.keys = $util.emptyArray; - - /** - * LookupRequest propertyMask. - * @member {google.datastore.v1.IPropertyMask|null|undefined} propertyMask - * @memberof google.datastore.v1.LookupRequest - * @instance - */ - LookupRequest.prototype.propertyMask = 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); - }; - - /** - * 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.propertyMask != null && Object.hasOwnProperty.call(message, "propertyMask")) - $root.google.datastore.v1.PropertyMask.encode(message.propertyMask, writer.uint32(/* id 5, wireType 2 =*/42).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 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1); - break; - } - case 3: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 5: { - message.propertyMask = $root.google.datastore.v1.PropertyMask.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - 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], long + 1); - if (error) - return "keys." + error; - } - } - if (message.propertyMask != null && message.hasOwnProperty("propertyMask")) { - var error = $root.google.datastore.v1.PropertyMask.verify(message.propertyMask, long + 1); - if (error) - return "propertyMask." + 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, long) { - if (object instanceof $root.google.datastore.v1.LookupRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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], long + 1); - } - } - if (object.propertyMask != null) { - if (typeof object.propertyMask !== "object") - throw TypeError(".google.datastore.v1.LookupRequest.propertyMask: object expected"); - message.propertyMask = $root.google.datastore.v1.PropertyMask.fromObject(object.propertyMask, long + 1); - } - 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.propertyMask = 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.propertyMask != null && message.hasOwnProperty("propertyMask")) - object.propertyMask = $root.google.datastore.v1.PropertyMask.toObject(message.propertyMask, 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. - * @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); - }; - - /** - * Gets the default type url for LookupRequest - * @function getTypeUrl - * @memberof google.datastore.v1.LookupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LookupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.LookupRequest"; - }; - - 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 {Uint8Array|null} [transaction] LookupResponse transaction - * @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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 transaction. - * @member {Uint8Array} transaction - * @memberof google.datastore.v1.LookupResponse - * @instance - */ - LookupResponse.prototype.transaction = $util.newBuffer([]); - - /** - * LookupResponse readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.LookupResponse - * @instance - */ - LookupResponse.prototype.readTime = null; - - /** - * 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); - }; - - /** - * 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.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.transaction); - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.LookupResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1)); - break; - } - case 2: { - if (!(message.missing && message.missing.length)) - message.missing = []; - message.missing.push($root.google.datastore.v1.EntityResult.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 3: { - if (!(message.deferred && message.deferred.length)) - message.deferred = []; - message.deferred.push($root.google.datastore.v1.Key.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 5: { - message.transaction = reader.bytes(); - break; - } - case 7: { - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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], long + 1); - 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], long + 1); - if (error) - return "deferred." + error; - } - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime, long + 1); - if (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, long) { - if (object instanceof $root.google.datastore.v1.LookupResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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], long + 1); - } - } - 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], long + 1); - } - } - 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.LookupResponse.readTime: object expected"); - message.readTime = $root.google.protobuf.Timestamp.fromObject(object.readTime, long + 1); - } - return message; - }; - - /** - * 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) { - if (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - 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.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.readTime != null && message.hasOwnProperty("readTime")) - object.readTime = $root.google.protobuf.Timestamp.toObject(message.readTime, options); - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for LookupResponse - * @function getTypeUrl - * @memberof google.datastore.v1.LookupResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LookupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.LookupResponse"; - }; - - return LookupResponse; - })(); - - v1.RunQueryRequest = (function() { - - /** - * 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 - * @property {google.datastore.v1.IPropertyMask|null} [propertyMask] RunQueryRequest propertyMask - * @property {google.datastore.v1.IExplainOptions|null} [explainOptions] RunQueryRequest explainOptions - */ - - /** - * 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 && keys[i] !== "__proto__") - 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 - * @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; - - /** - * RunQueryRequest propertyMask. - * @member {google.datastore.v1.IPropertyMask|null|undefined} propertyMask - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.propertyMask = null; - - /** - * RunQueryRequest explainOptions. - * @member {google.datastore.v1.IExplainOptions|null|undefined} explainOptions - * @memberof google.datastore.v1.RunQueryRequest - * @instance - */ - RunQueryRequest.prototype.explainOptions = 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.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); - if (message.databaseId != null && Object.hasOwnProperty.call(message, "databaseId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.databaseId); - if (message.propertyMask != null && Object.hasOwnProperty.call(message, "propertyMask")) - $root.google.datastore.v1.PropertyMask.encode(message.propertyMask, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.explainOptions != null && Object.hasOwnProperty.call(message, "explainOptions")) - $root.google.datastore.v1.ExplainOptions.encode(message.explainOptions, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1); - break; - } - case 1: { - message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 7: { - message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 10: { - message.propertyMask = $root.google.datastore.v1.PropertyMask.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 12: { - message.explainOptions = $root.google.datastore.v1.ExplainOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - if (error) - return "partitionId." + error; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions, long + 1); - 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, long + 1); - 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, long + 1); - if (error) - return "gqlQuery." + error; - } - } - if (message.propertyMask != null && message.hasOwnProperty("propertyMask")) { - var error = $root.google.datastore.v1.PropertyMask.verify(message.propertyMask, long + 1); - if (error) - return "propertyMask." + error; - } - if (message.explainOptions != null && message.hasOwnProperty("explainOptions")) { - var error = $root.google.datastore.v1.ExplainOptions.verify(message.explainOptions, long + 1); - if (error) - return "explainOptions." + 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, long) { - if (object instanceof $root.google.datastore.v1.RunQueryRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - if (object.propertyMask != null) { - if (typeof object.propertyMask !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.propertyMask: object expected"); - message.propertyMask = $root.google.datastore.v1.PropertyMask.fromObject(object.propertyMask, long + 1); - } - if (object.explainOptions != null) { - if (typeof object.explainOptions !== "object") - throw TypeError(".google.datastore.v1.RunQueryRequest.explainOptions: object expected"); - message.explainOptions = $root.google.datastore.v1.ExplainOptions.fromObject(object.explainOptions, long + 1); - } - 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 = ""; - object.propertyMask = null; - object.explainOptions = null; - } - 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; - if (message.propertyMask != null && message.hasOwnProperty("propertyMask")) - object.propertyMask = $root.google.datastore.v1.PropertyMask.toObject(message.propertyMask, options); - if (message.explainOptions != null && message.hasOwnProperty("explainOptions")) - object.explainOptions = $root.google.datastore.v1.ExplainOptions.toObject(message.explainOptions, options); - 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 - * @property {Uint8Array|null} [transaction] RunQueryResponse transaction - * @property {google.datastore.v1.IExplainMetrics|null} [explainMetrics] RunQueryResponse explainMetrics - */ - - /** - * 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 && keys[i] !== "__proto__") - 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; - - /** - * RunQueryResponse transaction. - * @member {Uint8Array} transaction - * @memberof google.datastore.v1.RunQueryResponse - * @instance - */ - RunQueryResponse.prototype.transaction = $util.newBuffer([]); - - /** - * RunQueryResponse explainMetrics. - * @member {google.datastore.v1.IExplainMetrics|null|undefined} explainMetrics - * @memberof google.datastore.v1.RunQueryResponse - * @instance - */ - RunQueryResponse.prototype.explainMetrics = 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(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.transaction); - if (message.explainMetrics != null && Object.hasOwnProperty.call(message, "explainMetrics")) - $root.google.datastore.v1.ExplainMetrics.encode(message.explainMetrics, writer.uint32(/* id 9, wireType 2 =*/74).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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunQueryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.batch = $root.google.datastore.v1.QueryResultBatch.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.query = $root.google.datastore.v1.Query.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.transaction = reader.bytes(); - break; - } - case 9: { - message.explainMetrics = $root.google.datastore.v1.ExplainMetrics.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.batch != null && message.hasOwnProperty("batch")) { - var error = $root.google.datastore.v1.QueryResultBatch.verify(message.batch, long + 1); - if (error) - return "batch." + error; - } - if (message.query != null && message.hasOwnProperty("query")) { - var error = $root.google.datastore.v1.Query.verify(message.query, long + 1); - if (error) - return "query." + error; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - if (message.explainMetrics != null && message.hasOwnProperty("explainMetrics")) { - var error = $root.google.datastore.v1.ExplainMetrics.verify(message.explainMetrics, long + 1); - if (error) - return "explainMetrics." + 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, long) { - if (object instanceof $root.google.datastore.v1.RunQueryResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - 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.explainMetrics != null) { - if (typeof object.explainMetrics !== "object") - throw TypeError(".google.datastore.v1.RunQueryResponse.explainMetrics: object expected"); - message.explainMetrics = $root.google.datastore.v1.ExplainMetrics.fromObject(object.explainMetrics, long + 1); - } - 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 (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - object.explainMetrics = 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); - 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.explainMetrics != null && message.hasOwnProperty("explainMetrics")) - object.explainMetrics = $root.google.datastore.v1.ExplainMetrics.toObject(message.explainMetrics, 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.RunAggregationQueryRequest = (function() { - - /** - * 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 - * @property {google.datastore.v1.IExplainOptions|null} [explainOptions] RunAggregationQueryRequest explainOptions - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * RunAggregationQueryRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.RunAggregationQueryRequest - * @instance - */ - RunAggregationQueryRequest.prototype.projectId = ""; - - /** - * RunAggregationQueryRequest databaseId. - * @member {string} databaseId - * @memberof google.datastore.v1.RunAggregationQueryRequest - * @instance - */ - RunAggregationQueryRequest.prototype.databaseId = ""; - - /** - * RunAggregationQueryRequest partitionId. - * @member {google.datastore.v1.IPartitionId|null|undefined} partitionId - * @memberof google.datastore.v1.RunAggregationQueryRequest - * @instance - */ - RunAggregationQueryRequest.prototype.partitionId = null; - - /** - * RunAggregationQueryRequest readOptions. - * @member {google.datastore.v1.IReadOptions|null|undefined} readOptions - * @memberof google.datastore.v1.RunAggregationQueryRequest - * @instance - */ - RunAggregationQueryRequest.prototype.readOptions = null; - - /** - * RunAggregationQueryRequest aggregationQuery. - * @member {google.datastore.v1.IAggregationQuery|null|undefined} aggregationQuery - * @memberof google.datastore.v1.RunAggregationQueryRequest - * @instance - */ - RunAggregationQueryRequest.prototype.aggregationQuery = null; - - /** - * RunAggregationQueryRequest gqlQuery. - * @member {google.datastore.v1.IGqlQuery|null|undefined} gqlQuery - * @memberof google.datastore.v1.RunAggregationQueryRequest - * @instance - */ - RunAggregationQueryRequest.prototype.gqlQuery = null; - - /** - * RunAggregationQueryRequest explainOptions. - * @member {google.datastore.v1.IExplainOptions|null|undefined} explainOptions - * @memberof google.datastore.v1.RunAggregationQueryRequest - * @instance - */ - RunAggregationQueryRequest.prototype.explainOptions = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * 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) - }); - - /** - * 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 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); - if (message.explainOptions != null && Object.hasOwnProperty.call(message, "explainOptions")) - $root.google.datastore.v1.ExplainOptions.encode(message.explainOptions, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - return writer; - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunAggregationQueryRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1); - break; - } - case 1: { - message.readOptions = $root.google.datastore.v1.ReadOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.aggregationQuery = $root.google.datastore.v1.AggregationQuery.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 7: { - message.gqlQuery = $root.google.datastore.v1.GqlQuery.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 11: { - message.explainOptions = $root.google.datastore.v1.ExplainOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - if (error) - return "partitionId." + error; - } - if (message.readOptions != null && message.hasOwnProperty("readOptions")) { - var error = $root.google.datastore.v1.ReadOptions.verify(message.readOptions, long + 1); - 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, long + 1); - if (error) - return "aggregationQuery." + 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, long + 1); - if (error) - return "gqlQuery." + error; - } - } - if (message.explainOptions != null && message.hasOwnProperty("explainOptions")) { - var error = $root.google.datastore.v1.ExplainOptions.verify(message.explainOptions, long + 1); - if (error) - return "explainOptions." + error; - } - return null; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.v1.RunAggregationQueryRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - if (object.explainOptions != null) { - if (typeof object.explainOptions !== "object") - throw TypeError(".google.datastore.v1.RunAggregationQueryRequest.explainOptions: object expected"); - message.explainOptions = $root.google.datastore.v1.ExplainOptions.fromObject(object.explainOptions, long + 1); - } - 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 = ""; - object.explainOptions = null; - } - 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 (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; - if (message.explainOptions != null && message.hasOwnProperty("explainOptions")) - object.explainOptions = $root.google.datastore.v1.ExplainOptions.toObject(message.explainOptions, 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); - }; - - /** - * Gets the default type url for RunAggregationQueryRequest - * @function getTypeUrl - * @memberof google.datastore.v1.RunAggregationQueryRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunAggregationQueryRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.RunAggregationQueryRequest"; - }; - - return RunAggregationQueryRequest; - })(); - - v1.RunAggregationQueryResponse = (function() { - - /** - * 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 - * @property {Uint8Array|null} [transaction] RunAggregationQueryResponse transaction - * @property {google.datastore.v1.IExplainMetrics|null} [explainMetrics] RunAggregationQueryResponse explainMetrics - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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; - - /** - * RunAggregationQueryResponse transaction. - * @member {Uint8Array} transaction - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @instance - */ - RunAggregationQueryResponse.prototype.transaction = $util.newBuffer([]); - - /** - * RunAggregationQueryResponse explainMetrics. - * @member {google.datastore.v1.IExplainMetrics|null|undefined} explainMetrics - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @instance - */ - RunAggregationQueryResponse.prototype.explainMetrics = null; - - /** - * 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); - }; - - /** - * 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(); - if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.transaction); - if (message.explainMetrics != null && Object.hasOwnProperty.call(message, "explainMetrics")) - $root.google.datastore.v1.ExplainMetrics.encode(message.explainMetrics, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RunAggregationQueryResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.batch = $root.google.datastore.v1.AggregationResultBatch.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.query = $root.google.datastore.v1.AggregationQuery.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.transaction = reader.bytes(); - break; - } - case 9: { - message.explainMetrics = $root.google.datastore.v1.ExplainMetrics.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.batch != null && message.hasOwnProperty("batch")) { - var error = $root.google.datastore.v1.AggregationResultBatch.verify(message.batch, long + 1); - if (error) - return "batch." + error; - } - if (message.query != null && message.hasOwnProperty("query")) { - var error = $root.google.datastore.v1.AggregationQuery.verify(message.query, long + 1); - if (error) - return "query." + error; - } - if (message.transaction != null && message.hasOwnProperty("transaction")) - if (!(message.transaction && typeof message.transaction.length === "number" || $util.isString(message.transaction))) - return "transaction: buffer expected"; - if (message.explainMetrics != null && message.hasOwnProperty("explainMetrics")) { - var error = $root.google.datastore.v1.ExplainMetrics.verify(message.explainMetrics, long + 1); - if (error) - return "explainMetrics." + error; - } - return null; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.v1.RunAggregationQueryResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - 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.explainMetrics != null) { - if (typeof object.explainMetrics !== "object") - throw TypeError(".google.datastore.v1.RunAggregationQueryResponse.explainMetrics: object expected"); - message.explainMetrics = $root.google.datastore.v1.ExplainMetrics.fromObject(object.explainMetrics, long + 1); - } - return message; - }; - - /** - * 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 (options.bytes === String) - object.transaction = ""; - else { - object.transaction = []; - if (options.bytes !== Array) - object.transaction = $util.newBuffer(object.transaction); - } - object.explainMetrics = 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); - 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.explainMetrics != null && message.hasOwnProperty("explainMetrics")) - object.explainMetrics = $root.google.datastore.v1.ExplainMetrics.toObject(message.explainMetrics, options); - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for RunAggregationQueryResponse - * @function getTypeUrl - * @memberof google.datastore.v1.RunAggregationQueryResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RunAggregationQueryResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.RunAggregationQueryResponse"; - }; - - return RunAggregationQueryResponse; - })(); - - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.BeginTransactionRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.BeginTransactionResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.transaction = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.datastore.v1.BeginTransactionResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.datastore.v1.RollbackRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.RollbackResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.datastore.v1.RollbackResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 {google.datastore.v1.ITransactionOptions|null} [singleUseTransaction] CommitRequest singleUseTransaction - * @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 && keys[i] !== "__proto__") - 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 singleUseTransaction. - * @member {google.datastore.v1.ITransactionOptions|null|undefined} singleUseTransaction - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - CommitRequest.prototype.singleUseTransaction = 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"|"singleUseTransaction"|undefined} transactionSelector - * @memberof google.datastore.v1.CommitRequest - * @instance - */ - Object.defineProperty(CommitRequest.prototype, "transactionSelector", { - get: $util.oneOfGetter($oneOfFields = ["transaction", "singleUseTransaction"]), - 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); - if (message.singleUseTransaction != null && Object.hasOwnProperty.call(message, "singleUseTransaction")) - $root.google.datastore.v1.TransactionOptions.encode(message.singleUseTransaction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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 10: { - message.singleUseTransaction = $root.google.datastore.v1.TransactionOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 6: { - if (!(message.mutations && message.mutations.length)) - message.mutations = []; - message.mutations.push($root.google.datastore.v1.Mutation.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { - if (properties.transactionSelector === 1) - return "transactionSelector: multiple values"; - properties.transactionSelector = 1; - { - var error = $root.google.datastore.v1.TransactionOptions.verify(message.singleUseTransaction, long + 1); - if (error) - return "singleUseTransaction." + error; - } - } - if (message.mutations != null && message.hasOwnProperty("mutations")) { - if (!Array.isArray(message.mutations)) - return "mutations: array expected"; - for (var i = 0; i < message.mutations.length; ++i) { - var error = $root.google.datastore.v1.Mutation.verify(message.mutations[i], long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.CommitRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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.singleUseTransaction != null) { - if (typeof object.singleUseTransaction !== "object") - throw TypeError(".google.datastore.v1.CommitRequest.singleUseTransaction: object expected"); - message.singleUseTransaction = $root.google.datastore.v1.TransactionOptions.fromObject(object.singleUseTransaction, long + 1); - } - 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], long + 1); - } - } - 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; - if (message.singleUseTransaction != null && message.hasOwnProperty("singleUseTransaction")) { - object.singleUseTransaction = $root.google.datastore.v1.TransactionOptions.toObject(message.singleUseTransaction, options); - if (options.oneofs) - object.transactionSelector = "singleUseTransaction"; - } - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.CommitResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1)); - break; - } - case 4: { - message.indexUpdates = reader.int32(); - break; - } - case 8: { - message.commitTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.CommitResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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, long + 1); - } - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - if (error) - return "keys." + error; - } - } - 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, long) { - if (object instanceof $root.google.datastore.v1.AllocateIdsRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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 (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 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); - }; - - /** - * Gets the default type url for AllocateIdsRequest - * @function getTypeUrl - * @memberof google.datastore.v1.AllocateIdsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllocateIdsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.AllocateIdsRequest"; - }; - - return AllocateIdsRequest; - })(); - - v1.AllocateIdsResponse = (function() { - - /** - * Properties of an AllocateIdsResponse. - * @memberof google.datastore.v1 - * @interface IAllocateIdsResponse - * @property {Array.|null} [keys] AllocateIdsResponse keys - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * AllocateIdsResponse keys. - * @member {Array.} keys - * @memberof google.datastore.v1.AllocateIdsResponse - * @instance - */ - AllocateIdsResponse.prototype.keys = $util.emptyArray; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.AllocateIdsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.keys && message.keys.length)) - message.keys = []; - message.keys.push($root.google.datastore.v1.Key.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.AllocateIdsResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - return message; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for AllocateIdsResponse - * @function getTypeUrl - * @memberof google.datastore.v1.AllocateIdsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllocateIdsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.AllocateIdsResponse"; - }; - - return AllocateIdsResponse; - })(); - - v1.ReserveIdsRequest = (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 - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReserveIdsRequest projectId. - * @member {string} projectId - * @memberof google.datastore.v1.ReserveIdsRequest - * @instance - */ - ReserveIdsRequest.prototype.projectId = ""; - - /** - * 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.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; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - 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(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - if (error) - return "keys." + error; - } - } - return null; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.v1.ReserveIdsRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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; - return object; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ReserveIdsRequest - * @function getTypeUrl - * @memberof google.datastore.v1.ReserveIdsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReserveIdsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.ReserveIdsRequest"; - }; - - return ReserveIdsRequest; - })(); - - v1.ReserveIdsResponse = (function() { - - /** - * Properties of a ReserveIdsResponse. - * @memberof google.datastore.v1 - * @interface IReserveIdsResponse - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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 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 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 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReserveIdsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7, long); - break; - } - } - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.datastore.v1.ReserveIdsResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 {}; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ReserveIdsResponse - * @function getTypeUrl - * @memberof google.datastore.v1.ReserveIdsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReserveIdsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.ReserveIdsResponse"; - }; - - return ReserveIdsResponse; - })(); - - v1.Mutation = (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 - * @property {google.datastore.v1.Mutation.ConflictResolutionStrategy|null} [conflictResolutionStrategy] Mutation conflictResolutionStrategy - * @property {google.datastore.v1.IPropertyMask|null} [propertyMask] Mutation propertyMask - * @property {Array.|null} [propertyTransforms] Mutation propertyTransforms - */ - - /** - * 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) { - this.propertyTransforms = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * 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; - - /** - * 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; - - /** - * Mutation conflictResolutionStrategy. - * @member {google.datastore.v1.Mutation.ConflictResolutionStrategy} conflictResolutionStrategy - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.conflictResolutionStrategy = 0; - - /** - * Mutation propertyMask. - * @member {google.datastore.v1.IPropertyMask|null|undefined} propertyMask - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.propertyMask = null; - - /** - * Mutation propertyTransforms. - * @member {Array.} propertyTransforms - * @memberof google.datastore.v1.Mutation - * @instance - */ - Mutation.prototype.propertyTransforms = $util.emptyArray; - - // 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.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); - }; - - /** - * 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.propertyMask != null && Object.hasOwnProperty.call(message, "propertyMask")) - $root.google.datastore.v1.PropertyMask.encode(message.propertyMask, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.conflictResolutionStrategy != null && Object.hasOwnProperty.call(message, "conflictResolutionStrategy")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.conflictResolutionStrategy); - 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(); - if (message.propertyTransforms != null && message.propertyTransforms.length) - for (var i = 0; i < message.propertyTransforms.length; ++i) - $root.google.datastore.v1.PropertyTransform.encode(message.propertyTransforms[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - return writer; - }; - - /** - * 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(); - }; - - /** - * 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.Mutation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.insert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.update = $root.google.datastore.v1.Entity.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 6: { - message.upsert = $root.google.datastore.v1.Entity.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 7: { - message["delete"] = $root.google.datastore.v1.Key.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 8: { - message.baseVersion = reader.int64(); - break; - } - case 11: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 10: { - message.conflictResolutionStrategy = reader.int32(); - break; - } - case 9: { - message.propertyMask = $root.google.datastore.v1.PropertyMask.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 12: { - if (!(message.propertyTransforms && message.propertyTransforms.length)) - message.propertyTransforms = []; - message.propertyTransforms.push($root.google.datastore.v1.PropertyTransform.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.insert != null && message.hasOwnProperty("insert")) { - properties.operation = 1; - { - var error = $root.google.datastore.v1.Entity.verify(message.insert, long + 1); - 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, long + 1); - 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, long + 1); - 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"], long + 1); - 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, long + 1); - if (error) - return "updateTime." + error; - } - } - if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) - switch (message.conflictResolutionStrategy) { - default: - return "conflictResolutionStrategy: enum value expected"; - case 0: - case 1: - case 3: - break; - } - if (message.propertyMask != null && message.hasOwnProperty("propertyMask")) { - var error = $root.google.datastore.v1.PropertyMask.verify(message.propertyMask, long + 1); - if (error) - return "propertyMask." + error; - } - if (message.propertyTransforms != null && message.hasOwnProperty("propertyTransforms")) { - if (!Array.isArray(message.propertyTransforms)) - return "propertyTransforms: array expected"; - for (var i = 0; i < message.propertyTransforms.length; ++i) { - var error = $root.google.datastore.v1.PropertyTransform.verify(message.propertyTransforms[i], long + 1); - if (error) - return "propertyTransforms." + 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, long) { - if (object instanceof $root.google.datastore.v1.Mutation) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - 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, long + 1); - } - 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"], long + 1); - } - 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, long + 1); - } - switch (object.conflictResolutionStrategy) { - default: - if (typeof object.conflictResolutionStrategy === "number") { - message.conflictResolutionStrategy = object.conflictResolutionStrategy; - break; - } - break; - case "STRATEGY_UNSPECIFIED": - case 0: - message.conflictResolutionStrategy = 0; - break; - case "SERVER_VALUE": - case 1: - message.conflictResolutionStrategy = 1; - break; - case "FAIL": - case 3: - message.conflictResolutionStrategy = 3; - break; - } - if (object.propertyMask != null) { - if (typeof object.propertyMask !== "object") - throw TypeError(".google.datastore.v1.Mutation.propertyMask: object expected"); - message.propertyMask = $root.google.datastore.v1.PropertyMask.fromObject(object.propertyMask, long + 1); - } - if (object.propertyTransforms) { - if (!Array.isArray(object.propertyTransforms)) - throw TypeError(".google.datastore.v1.Mutation.propertyTransforms: array expected"); - message.propertyTransforms = []; - for (var i = 0; i < object.propertyTransforms.length; ++i) { - if (typeof object.propertyTransforms[i] !== "object") - throw TypeError(".google.datastore.v1.Mutation.propertyTransforms: object expected"); - message.propertyTransforms[i] = $root.google.datastore.v1.PropertyTransform.fromObject(object.propertyTransforms[i], long + 1); - } - } - 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 (options.arrays || options.defaults) - object.propertyTransforms = []; - if (options.defaults) { - object.propertyMask = null; - object.conflictResolutionStrategy = options.enums === String ? "STRATEGY_UNSPECIFIED" : 0; - } - 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.propertyMask != null && message.hasOwnProperty("propertyMask")) - object.propertyMask = $root.google.datastore.v1.PropertyMask.toObject(message.propertyMask, options); - if (message.conflictResolutionStrategy != null && message.hasOwnProperty("conflictResolutionStrategy")) - object.conflictResolutionStrategy = options.enums === String ? $root.google.datastore.v1.Mutation.ConflictResolutionStrategy[message.conflictResolutionStrategy] === undefined ? message.conflictResolutionStrategy : $root.google.datastore.v1.Mutation.ConflictResolutionStrategy[message.conflictResolutionStrategy] : message.conflictResolutionStrategy; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (options.oneofs) - object.conflictDetectionStrategy = "updateTime"; - } - if (message.propertyTransforms && message.propertyTransforms.length) { - object.propertyTransforms = []; - for (var j = 0; j < message.propertyTransforms.length; ++j) - object.propertyTransforms[j] = $root.google.datastore.v1.PropertyTransform.toObject(message.propertyTransforms[j], options); - } - 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); - }; - - /** - * Gets the default type url for Mutation - * @function getTypeUrl - * @memberof google.datastore.v1.Mutation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Mutation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.Mutation"; - }; - - /** - * ConflictResolutionStrategy enum. - * @name google.datastore.v1.Mutation.ConflictResolutionStrategy - * @enum {number} - * @property {number} STRATEGY_UNSPECIFIED=0 STRATEGY_UNSPECIFIED value - * @property {number} SERVER_VALUE=1 SERVER_VALUE value - * @property {number} FAIL=3 FAIL value - */ - Mutation.ConflictResolutionStrategy = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRATEGY_UNSPECIFIED"] = 0; - values[valuesById[1] = "SERVER_VALUE"] = 1; - values[valuesById[3] = "FAIL"] = 3; - return values; - })(); - - return Mutation; - })(); - - v1.PropertyTransform = (function() { - - /** - * Properties of a PropertyTransform. - * @memberof google.datastore.v1 - * @interface IPropertyTransform - * @property {string|null} [property] PropertyTransform property - * @property {google.datastore.v1.PropertyTransform.ServerValue|null} [setToServerValue] PropertyTransform setToServerValue - * @property {google.datastore.v1.IValue|null} [increment] PropertyTransform increment - * @property {google.datastore.v1.IValue|null} [maximum] PropertyTransform maximum - * @property {google.datastore.v1.IValue|null} [minimum] PropertyTransform minimum - * @property {google.datastore.v1.IArrayValue|null} [appendMissingElements] PropertyTransform appendMissingElements - * @property {google.datastore.v1.IArrayValue|null} [removeAllFromArray] PropertyTransform removeAllFromArray - */ - - /** - * Constructs a new PropertyTransform. - * @memberof google.datastore.v1 - * @classdesc Represents a PropertyTransform. - * @implements IPropertyTransform - * @constructor - * @param {google.datastore.v1.IPropertyTransform=} [properties] Properties to set - */ - function PropertyTransform(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PropertyTransform property. - * @member {string} property - * @memberof google.datastore.v1.PropertyTransform - * @instance - */ - PropertyTransform.prototype.property = ""; - - /** - * PropertyTransform setToServerValue. - * @member {google.datastore.v1.PropertyTransform.ServerValue|null|undefined} setToServerValue - * @memberof google.datastore.v1.PropertyTransform - * @instance - */ - PropertyTransform.prototype.setToServerValue = null; - - /** - * PropertyTransform increment. - * @member {google.datastore.v1.IValue|null|undefined} increment - * @memberof google.datastore.v1.PropertyTransform - * @instance - */ - PropertyTransform.prototype.increment = null; - - /** - * PropertyTransform maximum. - * @member {google.datastore.v1.IValue|null|undefined} maximum - * @memberof google.datastore.v1.PropertyTransform - * @instance - */ - PropertyTransform.prototype.maximum = null; - - /** - * PropertyTransform minimum. - * @member {google.datastore.v1.IValue|null|undefined} minimum - * @memberof google.datastore.v1.PropertyTransform - * @instance - */ - PropertyTransform.prototype.minimum = null; - - /** - * PropertyTransform appendMissingElements. - * @member {google.datastore.v1.IArrayValue|null|undefined} appendMissingElements - * @memberof google.datastore.v1.PropertyTransform - * @instance - */ - PropertyTransform.prototype.appendMissingElements = null; - - /** - * PropertyTransform removeAllFromArray. - * @member {google.datastore.v1.IArrayValue|null|undefined} removeAllFromArray - * @memberof google.datastore.v1.PropertyTransform - * @instance - */ - PropertyTransform.prototype.removeAllFromArray = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * PropertyTransform transformType. - * @member {"setToServerValue"|"increment"|"maximum"|"minimum"|"appendMissingElements"|"removeAllFromArray"|undefined} transformType - * @memberof google.datastore.v1.PropertyTransform - * @instance - */ - Object.defineProperty(PropertyTransform.prototype, "transformType", { - get: $util.oneOfGetter($oneOfFields = ["setToServerValue", "increment", "maximum", "minimum", "appendMissingElements", "removeAllFromArray"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new PropertyTransform instance using the specified properties. - * @function create - * @memberof google.datastore.v1.PropertyTransform - * @static - * @param {google.datastore.v1.IPropertyTransform=} [properties] Properties to set - * @returns {google.datastore.v1.PropertyTransform} PropertyTransform instance - */ - PropertyTransform.create = function create(properties) { - return new PropertyTransform(properties); - }; - - /** - * Encodes the specified PropertyTransform message. Does not implicitly {@link google.datastore.v1.PropertyTransform.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.PropertyTransform - * @static - * @param {google.datastore.v1.IPropertyTransform} message PropertyTransform message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyTransform.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.property != null && Object.hasOwnProperty.call(message, "property")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.property); - if (message.setToServerValue != null && Object.hasOwnProperty.call(message, "setToServerValue")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.setToServerValue); - if (message.increment != null && Object.hasOwnProperty.call(message, "increment")) - $root.google.datastore.v1.Value.encode(message.increment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.maximum != null && Object.hasOwnProperty.call(message, "maximum")) - $root.google.datastore.v1.Value.encode(message.maximum, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.minimum != null && Object.hasOwnProperty.call(message, "minimum")) - $root.google.datastore.v1.Value.encode(message.minimum, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.appendMissingElements != null && Object.hasOwnProperty.call(message, "appendMissingElements")) - $root.google.datastore.v1.ArrayValue.encode(message.appendMissingElements, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.removeAllFromArray != null && Object.hasOwnProperty.call(message, "removeAllFromArray")) - $root.google.datastore.v1.ArrayValue.encode(message.removeAllFromArray, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PropertyTransform message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyTransform.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.PropertyTransform - * @static - * @param {google.datastore.v1.IPropertyTransform} message PropertyTransform message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyTransform.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PropertyTransform message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.PropertyTransform - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.PropertyTransform} PropertyTransform - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyTransform.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyTransform(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.property = reader.string(); - break; - } - case 2: { - message.setToServerValue = reader.int32(); - break; - } - case 3: { - message.increment = $root.google.datastore.v1.Value.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.maximum = $root.google.datastore.v1.Value.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.minimum = $root.google.datastore.v1.Value.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 6: { - message.appendMissingElements = $root.google.datastore.v1.ArrayValue.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 7: { - message.removeAllFromArray = $root.google.datastore.v1.ArrayValue.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a PropertyTransform message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.PropertyTransform - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.PropertyTransform} PropertyTransform - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyTransform.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PropertyTransform message. - * @function verify - * @memberof google.datastore.v1.PropertyTransform - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PropertyTransform.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.property != null && message.hasOwnProperty("property")) - if (!$util.isString(message.property)) - return "property: string expected"; - if (message.setToServerValue != null && message.hasOwnProperty("setToServerValue")) { - properties.transformType = 1; - switch (message.setToServerValue) { - default: - return "setToServerValue: enum value expected"; - case 0: - case 1: - break; - } - } - if (message.increment != null && message.hasOwnProperty("increment")) { - if (properties.transformType === 1) - return "transformType: multiple values"; - properties.transformType = 1; - { - var error = $root.google.datastore.v1.Value.verify(message.increment, long + 1); - if (error) - return "increment." + error; - } - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - if (properties.transformType === 1) - return "transformType: multiple values"; - properties.transformType = 1; - { - var error = $root.google.datastore.v1.Value.verify(message.maximum, long + 1); - if (error) - return "maximum." + error; - } - } - if (message.minimum != null && message.hasOwnProperty("minimum")) { - if (properties.transformType === 1) - return "transformType: multiple values"; - properties.transformType = 1; - { - var error = $root.google.datastore.v1.Value.verify(message.minimum, long + 1); - if (error) - return "minimum." + error; - } - } - if (message.appendMissingElements != null && message.hasOwnProperty("appendMissingElements")) { - if (properties.transformType === 1) - return "transformType: multiple values"; - properties.transformType = 1; - { - var error = $root.google.datastore.v1.ArrayValue.verify(message.appendMissingElements, long + 1); - if (error) - return "appendMissingElements." + error; - } - } - if (message.removeAllFromArray != null && message.hasOwnProperty("removeAllFromArray")) { - if (properties.transformType === 1) - return "transformType: multiple values"; - properties.transformType = 1; - { - var error = $root.google.datastore.v1.ArrayValue.verify(message.removeAllFromArray, long + 1); - if (error) - return "removeAllFromArray." + error; - } - } - return null; - }; - - /** - * Creates a PropertyTransform message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.PropertyTransform - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.PropertyTransform} PropertyTransform - */ - PropertyTransform.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.PropertyTransform) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.PropertyTransform(); - if (object.property != null) - message.property = String(object.property); - switch (object.setToServerValue) { - default: - if (typeof object.setToServerValue === "number") { - message.setToServerValue = object.setToServerValue; - break; - } - break; - case "SERVER_VALUE_UNSPECIFIED": - case 0: - message.setToServerValue = 0; - break; - case "REQUEST_TIME": - case 1: - message.setToServerValue = 1; - break; - } - if (object.increment != null) { - if (typeof object.increment !== "object") - throw TypeError(".google.datastore.v1.PropertyTransform.increment: object expected"); - message.increment = $root.google.datastore.v1.Value.fromObject(object.increment, long + 1); - } - if (object.maximum != null) { - if (typeof object.maximum !== "object") - throw TypeError(".google.datastore.v1.PropertyTransform.maximum: object expected"); - message.maximum = $root.google.datastore.v1.Value.fromObject(object.maximum, long + 1); - } - if (object.minimum != null) { - if (typeof object.minimum !== "object") - throw TypeError(".google.datastore.v1.PropertyTransform.minimum: object expected"); - message.minimum = $root.google.datastore.v1.Value.fromObject(object.minimum, long + 1); - } - if (object.appendMissingElements != null) { - if (typeof object.appendMissingElements !== "object") - throw TypeError(".google.datastore.v1.PropertyTransform.appendMissingElements: object expected"); - message.appendMissingElements = $root.google.datastore.v1.ArrayValue.fromObject(object.appendMissingElements, long + 1); - } - if (object.removeAllFromArray != null) { - if (typeof object.removeAllFromArray !== "object") - throw TypeError(".google.datastore.v1.PropertyTransform.removeAllFromArray: object expected"); - message.removeAllFromArray = $root.google.datastore.v1.ArrayValue.fromObject(object.removeAllFromArray, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a PropertyTransform message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.PropertyTransform - * @static - * @param {google.datastore.v1.PropertyTransform} message PropertyTransform - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PropertyTransform.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.property = ""; - if (message.property != null && message.hasOwnProperty("property")) - object.property = message.property; - if (message.setToServerValue != null && message.hasOwnProperty("setToServerValue")) { - object.setToServerValue = options.enums === String ? $root.google.datastore.v1.PropertyTransform.ServerValue[message.setToServerValue] === undefined ? message.setToServerValue : $root.google.datastore.v1.PropertyTransform.ServerValue[message.setToServerValue] : message.setToServerValue; - if (options.oneofs) - object.transformType = "setToServerValue"; - } - if (message.increment != null && message.hasOwnProperty("increment")) { - object.increment = $root.google.datastore.v1.Value.toObject(message.increment, options); - if (options.oneofs) - object.transformType = "increment"; - } - if (message.maximum != null && message.hasOwnProperty("maximum")) { - object.maximum = $root.google.datastore.v1.Value.toObject(message.maximum, options); - if (options.oneofs) - object.transformType = "maximum"; - } - if (message.minimum != null && message.hasOwnProperty("minimum")) { - object.minimum = $root.google.datastore.v1.Value.toObject(message.minimum, options); - if (options.oneofs) - object.transformType = "minimum"; - } - if (message.appendMissingElements != null && message.hasOwnProperty("appendMissingElements")) { - object.appendMissingElements = $root.google.datastore.v1.ArrayValue.toObject(message.appendMissingElements, options); - if (options.oneofs) - object.transformType = "appendMissingElements"; - } - if (message.removeAllFromArray != null && message.hasOwnProperty("removeAllFromArray")) { - object.removeAllFromArray = $root.google.datastore.v1.ArrayValue.toObject(message.removeAllFromArray, options); - if (options.oneofs) - object.transformType = "removeAllFromArray"; - } - return object; - }; - - /** - * Converts this PropertyTransform to JSON. - * @function toJSON - * @memberof google.datastore.v1.PropertyTransform - * @instance - * @returns {Object.} JSON object - */ - PropertyTransform.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PropertyTransform - * @function getTypeUrl - * @memberof google.datastore.v1.PropertyTransform - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyTransform.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.PropertyTransform"; - }; - - /** - * ServerValue enum. - * @name google.datastore.v1.PropertyTransform.ServerValue - * @enum {number} - * @property {number} SERVER_VALUE_UNSPECIFIED=0 SERVER_VALUE_UNSPECIFIED value - * @property {number} REQUEST_TIME=1 REQUEST_TIME value - */ - PropertyTransform.ServerValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SERVER_VALUE_UNSPECIFIED"] = 0; - values[valuesById[1] = "REQUEST_TIME"] = 1; - return values; - })(); - - return PropertyTransform; - })(); - - v1.MutationResult = (function() { - - /** - * 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} [createTime] MutationResult createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] MutationResult updateTime - * @property {boolean|null} [conflictDetected] MutationResult conflictDetected - * @property {Array.|null} [transformResults] MutationResult transformResults - */ - - /** - * 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) { - this.transformResults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * MutationResult key. - * @member {google.datastore.v1.IKey|null|undefined} key - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.key = null; - - /** - * MutationResult version. - * @member {number|Long} version - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.version = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * MutationResult createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.createTime = null; - - /** - * MutationResult updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.updateTime = null; - - /** - * MutationResult conflictDetected. - * @member {boolean} conflictDetected - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.conflictDetected = false; - - /** - * MutationResult transformResults. - * @member {Array.} transformResults - * @memberof google.datastore.v1.MutationResult - * @instance - */ - MutationResult.prototype.transformResults = $util.emptyArray; - - /** - * 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); - }; - - /** - * 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(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.transformResults != null && message.transformResults.length) - for (var i = 0; i < message.transformResults.length; ++i) - $root.google.datastore.v1.Value.encode(message.transformResults[i], writer.uint32(/* id 8, wireType 2 =*/66).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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.MutationResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.key = $root.google.datastore.v1.Key.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.version = reader.int64(); - break; - } - case 7: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.conflictDetected = reader.bool(); - break; - } - case 8: { - if (!(message.transformResults && message.transformResults.length)) - message.transformResults = []; - message.transformResults.push($root.google.datastore.v1.Value.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * 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 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.key != null && message.hasOwnProperty("key")) { - var error = $root.google.datastore.v1.Key.verify(message.key, long + 1); - 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.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime, long + 1); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime, long + 1); - if (error) - return "updateTime." + error; - } - if (message.conflictDetected != null && message.hasOwnProperty("conflictDetected")) - if (typeof message.conflictDetected !== "boolean") - return "conflictDetected: boolean expected"; - if (message.transformResults != null && message.hasOwnProperty("transformResults")) { - if (!Array.isArray(message.transformResults)) - return "transformResults: array expected"; - for (var i = 0; i < message.transformResults.length; ++i) { - var error = $root.google.datastore.v1.Value.verify(message.transformResults[i], long + 1); - if (error) - return "transformResults." + error; - } - } - return null; - }; - - /** - * 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, long) { - if (object instanceof $root.google.datastore.v1.MutationResult) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.datastore.v1.MutationResult.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime, long + 1); - } - 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, long + 1); - } - if (object.conflictDetected != null) - message.conflictDetected = Boolean(object.conflictDetected); - if (object.transformResults) { - if (!Array.isArray(object.transformResults)) - throw TypeError(".google.datastore.v1.MutationResult.transformResults: array expected"); - message.transformResults = []; - for (var i = 0; i < object.transformResults.length; ++i) { - if (typeof object.transformResults[i] !== "object") - throw TypeError(".google.datastore.v1.MutationResult.transformResults: object expected"); - message.transformResults[i] = $root.google.datastore.v1.Value.fromObject(object.transformResults[i], long + 1); - } - } - 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.arrays || options.defaults) - object.transformResults = []; - 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; - object.createTime = 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); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.transformResults && message.transformResults.length) { - object.transformResults = []; - for (var j = 0; j < message.transformResults.length; ++j) - object.transformResults[j] = $root.google.datastore.v1.Value.toObject(message.transformResults[j], 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); - }; - - /** - * Gets the default type url for MutationResult - * @function getTypeUrl - * @memberof google.datastore.v1.MutationResult - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MutationResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.MutationResult"; - }; - - return MutationResult; - })(); - - v1.PropertyMask = (function() { - - /** - * Properties of a PropertyMask. - * @memberof google.datastore.v1 - * @interface IPropertyMask - * @property {Array.|null} [paths] PropertyMask paths - */ - - /** - * Constructs a new PropertyMask. - * @memberof google.datastore.v1 - * @classdesc Represents a PropertyMask. - * @implements IPropertyMask - * @constructor - * @param {google.datastore.v1.IPropertyMask=} [properties] Properties to set - */ - function PropertyMask(properties) { - this.paths = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PropertyMask paths. - * @member {Array.} paths - * @memberof google.datastore.v1.PropertyMask - * @instance - */ - PropertyMask.prototype.paths = $util.emptyArray; - - /** - * Creates a new PropertyMask instance using the specified properties. - * @function create - * @memberof google.datastore.v1.PropertyMask - * @static - * @param {google.datastore.v1.IPropertyMask=} [properties] Properties to set - * @returns {google.datastore.v1.PropertyMask} PropertyMask instance - */ - PropertyMask.create = function create(properties) { - return new PropertyMask(properties); - }; - - /** - * Encodes the specified PropertyMask message. Does not implicitly {@link google.datastore.v1.PropertyMask.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.PropertyMask - * @static - * @param {google.datastore.v1.IPropertyMask} message PropertyMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyMask.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.paths != null && message.paths.length) - for (var i = 0; i < message.paths.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); - return writer; - }; - - /** - * Encodes the specified PropertyMask message, length delimited. Does not implicitly {@link google.datastore.v1.PropertyMask.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.PropertyMask - * @static - * @param {google.datastore.v1.IPropertyMask} message PropertyMask message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PropertyMask.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PropertyMask message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.PropertyMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.PropertyMask} PropertyMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyMask.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PropertyMask(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.paths && message.paths.length)) - message.paths = []; - message.paths.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a PropertyMask message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.PropertyMask - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.PropertyMask} PropertyMask - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PropertyMask.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PropertyMask message. - * @function verify - * @memberof google.datastore.v1.PropertyMask - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PropertyMask.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.paths != null && message.hasOwnProperty("paths")) { - if (!Array.isArray(message.paths)) - return "paths: array expected"; - for (var i = 0; i < message.paths.length; ++i) - if (!$util.isString(message.paths[i])) - return "paths: string[] expected"; - } - return null; - }; - - /** - * Creates a PropertyMask message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.PropertyMask - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.PropertyMask} PropertyMask - */ - PropertyMask.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.PropertyMask) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.PropertyMask(); - if (object.paths) { - if (!Array.isArray(object.paths)) - throw TypeError(".google.datastore.v1.PropertyMask.paths: array expected"); - message.paths = []; - for (var i = 0; i < object.paths.length; ++i) - message.paths[i] = String(object.paths[i]); - } - return message; - }; - - /** - * Creates a plain object from a PropertyMask message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.PropertyMask - * @static - * @param {google.datastore.v1.PropertyMask} message PropertyMask - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PropertyMask.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.paths = []; - if (message.paths && message.paths.length) { - object.paths = []; - for (var j = 0; j < message.paths.length; ++j) - object.paths[j] = message.paths[j]; - } - return object; - }; - - /** - * Converts this PropertyMask to JSON. - * @function toJSON - * @memberof google.datastore.v1.PropertyMask - * @instance - * @returns {Object.} JSON object - */ - PropertyMask.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PropertyMask - * @function getTypeUrl - * @memberof google.datastore.v1.PropertyMask - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PropertyMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.PropertyMask"; - }; - - return PropertyMask; - })(); - - 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.datastore.v1.ITransactionOptions|null} [newTransaction] ReadOptions newTransaction - * @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 && keys[i] !== "__proto__") - 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; - - /** - * ReadOptions transaction. - * @member {Uint8Array|null|undefined} transaction - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - ReadOptions.prototype.transaction = null; - - /** - * ReadOptions newTransaction. - * @member {google.datastore.v1.ITransactionOptions|null|undefined} newTransaction - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - ReadOptions.prototype.newTransaction = null; - - /** - * ReadOptions readTime. - * @member {google.protobuf.ITimestamp|null|undefined} readTime - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - ReadOptions.prototype.readTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReadOptions consistencyType. - * @member {"readConsistency"|"transaction"|"newTransaction"|"readTime"|undefined} consistencyType - * @memberof google.datastore.v1.ReadOptions - * @instance - */ - Object.defineProperty(ReadOptions.prototype, "consistencyType", { - get: $util.oneOfGetter($oneOfFields = ["readConsistency", "transaction", "newTransaction", "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.newTransaction != null && Object.hasOwnProperty.call(message, "newTransaction")) - $root.google.datastore.v1.TransactionOptions.encode(message.newTransaction, 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 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ReadOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.readConsistency = reader.int32(); - break; - } - case 2: { - message.transaction = reader.bytes(); - break; - } - case 3: { - message.newTransaction = $root.google.datastore.v1.TransactionOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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.newTransaction != null && message.hasOwnProperty("newTransaction")) { - if (properties.consistencyType === 1) - return "consistencyType: multiple values"; - properties.consistencyType = 1; - { - var error = $root.google.datastore.v1.TransactionOptions.verify(message.newTransaction, long + 1); - if (error) - return "newTransaction." + error; - } - } - 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, long + 1); - if (error) - return "readTime." + error; - } - } - 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, long) { - if (object instanceof $root.google.datastore.v1.ReadOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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.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 >= 0) - message.transaction = object.transaction; - if (object.newTransaction != null) { - if (typeof object.newTransaction !== "object") - throw TypeError(".google.datastore.v1.ReadOptions.newTransaction: object expected"); - message.newTransaction = $root.google.datastore.v1.TransactionOptions.fromObject(object.newTransaction, long + 1); - } - 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, long + 1); - } - 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.newTransaction != null && message.hasOwnProperty("newTransaction")) { - object.newTransaction = $root.google.datastore.v1.TransactionOptions.toObject(message.newTransaction, options); - if (options.oneofs) - object.consistencyType = "newTransaction"; - } - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.TransactionOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.readWrite = $root.google.datastore.v1.TransactionOptions.ReadWrite.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.readOnly = $root.google.datastore.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.readWrite != null && message.hasOwnProperty("readWrite")) { - properties.mode = 1; - { - var error = $root.google.datastore.v1.TransactionOptions.ReadWrite.verify(message.readWrite, long + 1); - 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, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.TransactionOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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, long + 1); - } - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.previousTransaction = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadWrite) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.readTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - 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()); - }; - - /** - * 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.readTime != null && message.hasOwnProperty("readTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.readTime, long + 1); - 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, long) { - if (object instanceof $root.google.datastore.v1.TransactionOptions.ReadOnly) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - return message; - }; - - /** - * 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; - }; - - /** - * 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); - }; - - /** - * Gets the default type url for ReadOnly - * @function getTypeUrl - * @memberof google.datastore.v1.TransactionOptions.ReadOnly - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadOnly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.TransactionOptions.ReadOnly"; - }; - - return ReadOnly; - })(); - - return TransactionOptions; - })(); - - v1.ExplainOptions = (function() { - - /** - * Properties of an ExplainOptions. - * @memberof google.datastore.v1 - * @interface IExplainOptions - * @property {boolean|null} [analyze] ExplainOptions analyze - */ - - /** - * Constructs a new ExplainOptions. - * @memberof google.datastore.v1 - * @classdesc Represents an ExplainOptions. - * @implements IExplainOptions - * @constructor - * @param {google.datastore.v1.IExplainOptions=} [properties] Properties to set - */ - function ExplainOptions(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExplainOptions analyze. - * @member {boolean} analyze - * @memberof google.datastore.v1.ExplainOptions - * @instance - */ - ExplainOptions.prototype.analyze = false; - - /** - * Creates a new ExplainOptions instance using the specified properties. - * @function create - * @memberof google.datastore.v1.ExplainOptions - * @static - * @param {google.datastore.v1.IExplainOptions=} [properties] Properties to set - * @returns {google.datastore.v1.ExplainOptions} ExplainOptions instance - */ - ExplainOptions.create = function create(properties) { - return new ExplainOptions(properties); - }; - - /** - * Encodes the specified ExplainOptions message. Does not implicitly {@link google.datastore.v1.ExplainOptions.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.ExplainOptions - * @static - * @param {google.datastore.v1.IExplainOptions} message ExplainOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExplainOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.analyze != null && Object.hasOwnProperty.call(message, "analyze")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.analyze); - return writer; - }; - - /** - * Encodes the specified ExplainOptions message, length delimited. Does not implicitly {@link google.datastore.v1.ExplainOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.ExplainOptions - * @static - * @param {google.datastore.v1.IExplainOptions} message ExplainOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExplainOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExplainOptions message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.ExplainOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.ExplainOptions} ExplainOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExplainOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ExplainOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.analyze = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an ExplainOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.ExplainOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ExplainOptions} ExplainOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExplainOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExplainOptions message. - * @function verify - * @memberof google.datastore.v1.ExplainOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExplainOptions.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.analyze != null && message.hasOwnProperty("analyze")) - if (typeof message.analyze !== "boolean") - return "analyze: boolean expected"; - return null; - }; - - /** - * Creates an ExplainOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.ExplainOptions - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.ExplainOptions} ExplainOptions - */ - ExplainOptions.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.ExplainOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.ExplainOptions(); - if (object.analyze != null) - message.analyze = Boolean(object.analyze); - return message; - }; - - /** - * Creates a plain object from an ExplainOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ExplainOptions - * @static - * @param {google.datastore.v1.ExplainOptions} message ExplainOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExplainOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.analyze = false; - if (message.analyze != null && message.hasOwnProperty("analyze")) - object.analyze = message.analyze; - return object; - }; - - /** - * Converts this ExplainOptions to JSON. - * @function toJSON - * @memberof google.datastore.v1.ExplainOptions - * @instance - * @returns {Object.} JSON object - */ - ExplainOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExplainOptions - * @function getTypeUrl - * @memberof google.datastore.v1.ExplainOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExplainOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.ExplainOptions"; - }; - - return ExplainOptions; - })(); - - v1.ExplainMetrics = (function() { - - /** - * Properties of an ExplainMetrics. - * @memberof google.datastore.v1 - * @interface IExplainMetrics - * @property {google.datastore.v1.IPlanSummary|null} [planSummary] ExplainMetrics planSummary - * @property {google.datastore.v1.IExecutionStats|null} [executionStats] ExplainMetrics executionStats - */ - - /** - * Constructs a new ExplainMetrics. - * @memberof google.datastore.v1 - * @classdesc Represents an ExplainMetrics. - * @implements IExplainMetrics - * @constructor - * @param {google.datastore.v1.IExplainMetrics=} [properties] Properties to set - */ - function ExplainMetrics(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExplainMetrics planSummary. - * @member {google.datastore.v1.IPlanSummary|null|undefined} planSummary - * @memberof google.datastore.v1.ExplainMetrics - * @instance - */ - ExplainMetrics.prototype.planSummary = null; - - /** - * ExplainMetrics executionStats. - * @member {google.datastore.v1.IExecutionStats|null|undefined} executionStats - * @memberof google.datastore.v1.ExplainMetrics - * @instance - */ - ExplainMetrics.prototype.executionStats = null; - - /** - * Creates a new ExplainMetrics instance using the specified properties. - * @function create - * @memberof google.datastore.v1.ExplainMetrics - * @static - * @param {google.datastore.v1.IExplainMetrics=} [properties] Properties to set - * @returns {google.datastore.v1.ExplainMetrics} ExplainMetrics instance - */ - ExplainMetrics.create = function create(properties) { - return new ExplainMetrics(properties); - }; - - /** - * Encodes the specified ExplainMetrics message. Does not implicitly {@link google.datastore.v1.ExplainMetrics.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.ExplainMetrics - * @static - * @param {google.datastore.v1.IExplainMetrics} message ExplainMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExplainMetrics.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.planSummary != null && Object.hasOwnProperty.call(message, "planSummary")) - $root.google.datastore.v1.PlanSummary.encode(message.planSummary, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.executionStats != null && Object.hasOwnProperty.call(message, "executionStats")) - $root.google.datastore.v1.ExecutionStats.encode(message.executionStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExplainMetrics message, length delimited. Does not implicitly {@link google.datastore.v1.ExplainMetrics.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.ExplainMetrics - * @static - * @param {google.datastore.v1.IExplainMetrics} message ExplainMetrics message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExplainMetrics.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExplainMetrics message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.ExplainMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.ExplainMetrics} ExplainMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExplainMetrics.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ExplainMetrics(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.planSummary = $root.google.datastore.v1.PlanSummary.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.executionStats = $root.google.datastore.v1.ExecutionStats.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an ExplainMetrics message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.ExplainMetrics - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ExplainMetrics} ExplainMetrics - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExplainMetrics.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExplainMetrics message. - * @function verify - * @memberof google.datastore.v1.ExplainMetrics - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExplainMetrics.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.planSummary != null && message.hasOwnProperty("planSummary")) { - var error = $root.google.datastore.v1.PlanSummary.verify(message.planSummary, long + 1); - if (error) - return "planSummary." + error; - } - if (message.executionStats != null && message.hasOwnProperty("executionStats")) { - var error = $root.google.datastore.v1.ExecutionStats.verify(message.executionStats, long + 1); - if (error) - return "executionStats." + error; - } - return null; - }; - - /** - * Creates an ExplainMetrics message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.ExplainMetrics - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.ExplainMetrics} ExplainMetrics - */ - ExplainMetrics.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.ExplainMetrics) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.ExplainMetrics(); - if (object.planSummary != null) { - if (typeof object.planSummary !== "object") - throw TypeError(".google.datastore.v1.ExplainMetrics.planSummary: object expected"); - message.planSummary = $root.google.datastore.v1.PlanSummary.fromObject(object.planSummary, long + 1); - } - if (object.executionStats != null) { - if (typeof object.executionStats !== "object") - throw TypeError(".google.datastore.v1.ExplainMetrics.executionStats: object expected"); - message.executionStats = $root.google.datastore.v1.ExecutionStats.fromObject(object.executionStats, long + 1); - } - return message; - }; - - /** - * Creates a plain object from an ExplainMetrics message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ExplainMetrics - * @static - * @param {google.datastore.v1.ExplainMetrics} message ExplainMetrics - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExplainMetrics.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.planSummary = null; - object.executionStats = null; - } - if (message.planSummary != null && message.hasOwnProperty("planSummary")) - object.planSummary = $root.google.datastore.v1.PlanSummary.toObject(message.planSummary, options); - if (message.executionStats != null && message.hasOwnProperty("executionStats")) - object.executionStats = $root.google.datastore.v1.ExecutionStats.toObject(message.executionStats, options); - return object; - }; - - /** - * Converts this ExplainMetrics to JSON. - * @function toJSON - * @memberof google.datastore.v1.ExplainMetrics - * @instance - * @returns {Object.} JSON object - */ - ExplainMetrics.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExplainMetrics - * @function getTypeUrl - * @memberof google.datastore.v1.ExplainMetrics - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExplainMetrics.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.ExplainMetrics"; - }; - - return ExplainMetrics; - })(); - - v1.PlanSummary = (function() { - - /** - * Properties of a PlanSummary. - * @memberof google.datastore.v1 - * @interface IPlanSummary - * @property {Array.|null} [indexesUsed] PlanSummary indexesUsed - */ - - /** - * Constructs a new PlanSummary. - * @memberof google.datastore.v1 - * @classdesc Represents a PlanSummary. - * @implements IPlanSummary - * @constructor - * @param {google.datastore.v1.IPlanSummary=} [properties] Properties to set - */ - function PlanSummary(properties) { - this.indexesUsed = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PlanSummary indexesUsed. - * @member {Array.} indexesUsed - * @memberof google.datastore.v1.PlanSummary - * @instance - */ - PlanSummary.prototype.indexesUsed = $util.emptyArray; - - /** - * Creates a new PlanSummary instance using the specified properties. - * @function create - * @memberof google.datastore.v1.PlanSummary - * @static - * @param {google.datastore.v1.IPlanSummary=} [properties] Properties to set - * @returns {google.datastore.v1.PlanSummary} PlanSummary instance - */ - PlanSummary.create = function create(properties) { - return new PlanSummary(properties); - }; - - /** - * Encodes the specified PlanSummary message. Does not implicitly {@link google.datastore.v1.PlanSummary.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.PlanSummary - * @static - * @param {google.datastore.v1.IPlanSummary} message PlanSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlanSummary.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.indexesUsed != null && message.indexesUsed.length) - for (var i = 0; i < message.indexesUsed.length; ++i) - $root.google.protobuf.Struct.encode(message.indexesUsed[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PlanSummary message, length delimited. Does not implicitly {@link google.datastore.v1.PlanSummary.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.PlanSummary - * @static - * @param {google.datastore.v1.IPlanSummary} message PlanSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PlanSummary.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PlanSummary message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.PlanSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.PlanSummary} PlanSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlanSummary.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.PlanSummary(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.indexesUsed && message.indexesUsed.length)) - message.indexesUsed = []; - message.indexesUsed.push($root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a PlanSummary message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.PlanSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.PlanSummary} PlanSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PlanSummary.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PlanSummary message. - * @function verify - * @memberof google.datastore.v1.PlanSummary - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PlanSummary.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.indexesUsed != null && message.hasOwnProperty("indexesUsed")) { - if (!Array.isArray(message.indexesUsed)) - return "indexesUsed: array expected"; - for (var i = 0; i < message.indexesUsed.length; ++i) { - var error = $root.google.protobuf.Struct.verify(message.indexesUsed[i], long + 1); - if (error) - return "indexesUsed." + error; - } - } - return null; - }; - - /** - * Creates a PlanSummary message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.PlanSummary - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.PlanSummary} PlanSummary - */ - PlanSummary.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.PlanSummary) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.PlanSummary(); - if (object.indexesUsed) { - if (!Array.isArray(object.indexesUsed)) - throw TypeError(".google.datastore.v1.PlanSummary.indexesUsed: array expected"); - message.indexesUsed = []; - for (var i = 0; i < object.indexesUsed.length; ++i) { - if (typeof object.indexesUsed[i] !== "object") - throw TypeError(".google.datastore.v1.PlanSummary.indexesUsed: object expected"); - message.indexesUsed[i] = $root.google.protobuf.Struct.fromObject(object.indexesUsed[i], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a PlanSummary message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.PlanSummary - * @static - * @param {google.datastore.v1.PlanSummary} message PlanSummary - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PlanSummary.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.indexesUsed = []; - if (message.indexesUsed && message.indexesUsed.length) { - object.indexesUsed = []; - for (var j = 0; j < message.indexesUsed.length; ++j) - object.indexesUsed[j] = $root.google.protobuf.Struct.toObject(message.indexesUsed[j], options); - } - return object; - }; - - /** - * Converts this PlanSummary to JSON. - * @function toJSON - * @memberof google.datastore.v1.PlanSummary - * @instance - * @returns {Object.} JSON object - */ - PlanSummary.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PlanSummary - * @function getTypeUrl - * @memberof google.datastore.v1.PlanSummary - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PlanSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.PlanSummary"; - }; - - return PlanSummary; - })(); - - v1.ExecutionStats = (function() { - - /** - * Properties of an ExecutionStats. - * @memberof google.datastore.v1 - * @interface IExecutionStats - * @property {number|Long|null} [resultsReturned] ExecutionStats resultsReturned - * @property {google.protobuf.IDuration|null} [executionDuration] ExecutionStats executionDuration - * @property {number|Long|null} [readOperations] ExecutionStats readOperations - * @property {google.protobuf.IStruct|null} [debugStats] ExecutionStats debugStats - */ - - /** - * Constructs a new ExecutionStats. - * @memberof google.datastore.v1 - * @classdesc Represents an ExecutionStats. - * @implements IExecutionStats - * @constructor - * @param {google.datastore.v1.IExecutionStats=} [properties] Properties to set - */ - function ExecutionStats(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExecutionStats resultsReturned. - * @member {number|Long} resultsReturned - * @memberof google.datastore.v1.ExecutionStats - * @instance - */ - ExecutionStats.prototype.resultsReturned = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ExecutionStats executionDuration. - * @member {google.protobuf.IDuration|null|undefined} executionDuration - * @memberof google.datastore.v1.ExecutionStats - * @instance - */ - ExecutionStats.prototype.executionDuration = null; - - /** - * ExecutionStats readOperations. - * @member {number|Long} readOperations - * @memberof google.datastore.v1.ExecutionStats - * @instance - */ - ExecutionStats.prototype.readOperations = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ExecutionStats debugStats. - * @member {google.protobuf.IStruct|null|undefined} debugStats - * @memberof google.datastore.v1.ExecutionStats - * @instance - */ - ExecutionStats.prototype.debugStats = null; - - /** - * Creates a new ExecutionStats instance using the specified properties. - * @function create - * @memberof google.datastore.v1.ExecutionStats - * @static - * @param {google.datastore.v1.IExecutionStats=} [properties] Properties to set - * @returns {google.datastore.v1.ExecutionStats} ExecutionStats instance - */ - ExecutionStats.create = function create(properties) { - return new ExecutionStats(properties); - }; - - /** - * Encodes the specified ExecutionStats message. Does not implicitly {@link google.datastore.v1.ExecutionStats.verify|verify} messages. - * @function encode - * @memberof google.datastore.v1.ExecutionStats - * @static - * @param {google.datastore.v1.IExecutionStats} message ExecutionStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionStats.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resultsReturned != null && Object.hasOwnProperty.call(message, "resultsReturned")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.resultsReturned); - if (message.executionDuration != null && Object.hasOwnProperty.call(message, "executionDuration")) - $root.google.protobuf.Duration.encode(message.executionDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.readOperations != null && Object.hasOwnProperty.call(message, "readOperations")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.readOperations); - if (message.debugStats != null && Object.hasOwnProperty.call(message, "debugStats")) - $root.google.protobuf.Struct.encode(message.debugStats, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExecutionStats message, length delimited. Does not implicitly {@link google.datastore.v1.ExecutionStats.verify|verify} messages. - * @function encodeDelimited - * @memberof google.datastore.v1.ExecutionStats - * @static - * @param {google.datastore.v1.IExecutionStats} message ExecutionStats message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExecutionStats.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExecutionStats message from the specified reader or buffer. - * @function decode - * @memberof google.datastore.v1.ExecutionStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.datastore.v1.ExecutionStats} ExecutionStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionStats.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.datastore.v1.ExecutionStats(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.resultsReturned = reader.int64(); - break; - } - case 3: { - message.executionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.readOperations = reader.int64(); - break; - } - case 5: { - message.debugStats = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an ExecutionStats message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.datastore.v1.ExecutionStats - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.datastore.v1.ExecutionStats} ExecutionStats - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExecutionStats.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExecutionStats message. - * @function verify - * @memberof google.datastore.v1.ExecutionStats - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExecutionStats.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.resultsReturned != null && message.hasOwnProperty("resultsReturned")) - if (!$util.isInteger(message.resultsReturned) && !(message.resultsReturned && $util.isInteger(message.resultsReturned.low) && $util.isInteger(message.resultsReturned.high))) - return "resultsReturned: integer|Long expected"; - if (message.executionDuration != null && message.hasOwnProperty("executionDuration")) { - var error = $root.google.protobuf.Duration.verify(message.executionDuration, long + 1); - if (error) - return "executionDuration." + error; - } - if (message.readOperations != null && message.hasOwnProperty("readOperations")) - if (!$util.isInteger(message.readOperations) && !(message.readOperations && $util.isInteger(message.readOperations.low) && $util.isInteger(message.readOperations.high))) - return "readOperations: integer|Long expected"; - if (message.debugStats != null && message.hasOwnProperty("debugStats")) { - var error = $root.google.protobuf.Struct.verify(message.debugStats, long + 1); - if (error) - return "debugStats." + error; - } - return null; - }; - - /** - * Creates an ExecutionStats message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.datastore.v1.ExecutionStats - * @static - * @param {Object.} object Plain object - * @returns {google.datastore.v1.ExecutionStats} ExecutionStats - */ - ExecutionStats.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.datastore.v1.ExecutionStats) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.datastore.v1.ExecutionStats(); - if (object.resultsReturned != null) - if ($util.Long) - (message.resultsReturned = $util.Long.fromValue(object.resultsReturned)).unsigned = false; - else if (typeof object.resultsReturned === "string") - message.resultsReturned = parseInt(object.resultsReturned, 10); - else if (typeof object.resultsReturned === "number") - message.resultsReturned = object.resultsReturned; - else if (typeof object.resultsReturned === "object") - message.resultsReturned = new $util.LongBits(object.resultsReturned.low >>> 0, object.resultsReturned.high >>> 0).toNumber(); - if (object.executionDuration != null) { - if (typeof object.executionDuration !== "object") - throw TypeError(".google.datastore.v1.ExecutionStats.executionDuration: object expected"); - message.executionDuration = $root.google.protobuf.Duration.fromObject(object.executionDuration, long + 1); - } - if (object.readOperations != null) - if ($util.Long) - (message.readOperations = $util.Long.fromValue(object.readOperations)).unsigned = false; - else if (typeof object.readOperations === "string") - message.readOperations = parseInt(object.readOperations, 10); - else if (typeof object.readOperations === "number") - message.readOperations = object.readOperations; - else if (typeof object.readOperations === "object") - message.readOperations = new $util.LongBits(object.readOperations.low >>> 0, object.readOperations.high >>> 0).toNumber(); - if (object.debugStats != null) { - if (typeof object.debugStats !== "object") - throw TypeError(".google.datastore.v1.ExecutionStats.debugStats: object expected"); - message.debugStats = $root.google.protobuf.Struct.fromObject(object.debugStats, long + 1); - } - return message; - }; - - /** - * Creates a plain object from an ExecutionStats message. Also converts values to other types if specified. - * @function toObject - * @memberof google.datastore.v1.ExecutionStats - * @static - * @param {google.datastore.v1.ExecutionStats} message ExecutionStats - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExecutionStats.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.resultsReturned = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.resultsReturned = options.longs === String ? "0" : 0; - object.executionDuration = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.readOperations = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.readOperations = options.longs === String ? "0" : 0; - object.debugStats = null; - } - if (message.resultsReturned != null && message.hasOwnProperty("resultsReturned")) - if (typeof message.resultsReturned === "number") - object.resultsReturned = options.longs === String ? String(message.resultsReturned) : message.resultsReturned; - else - object.resultsReturned = options.longs === String ? $util.Long.prototype.toString.call(message.resultsReturned) : options.longs === Number ? new $util.LongBits(message.resultsReturned.low >>> 0, message.resultsReturned.high >>> 0).toNumber() : message.resultsReturned; - if (message.executionDuration != null && message.hasOwnProperty("executionDuration")) - object.executionDuration = $root.google.protobuf.Duration.toObject(message.executionDuration, options); - if (message.readOperations != null && message.hasOwnProperty("readOperations")) - if (typeof message.readOperations === "number") - object.readOperations = options.longs === String ? String(message.readOperations) : message.readOperations; - else - object.readOperations = options.longs === String ? $util.Long.prototype.toString.call(message.readOperations) : options.longs === Number ? new $util.LongBits(message.readOperations.low >>> 0, message.readOperations.high >>> 0).toNumber() : message.readOperations; - if (message.debugStats != null && message.hasOwnProperty("debugStats")) - object.debugStats = $root.google.protobuf.Struct.toObject(message.debugStats, options); - return object; - }; - - /** - * Converts this ExecutionStats to JSON. - * @function toJSON - * @memberof google.datastore.v1.ExecutionStats - * @instance - * @returns {Object.} JSON object - */ - ExecutionStats.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExecutionStats - * @function getTypeUrl - * @memberof google.datastore.v1.ExecutionStats - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExecutionStats.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.datastore.v1.ExecutionStats"; - }; - - return ExecutionStats; - })(); - - 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http - * @instance - */ - Http.prototype.rules = $util.emptyArray; - - /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http - * @instance - */ - Http.prototype.fullyDecodeReservedExpansion = false; - - /** - * Creates a new Http instance using the specified properties. - * @function create - * @memberof google.api.Http - * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance - */ - Http.create = function create(properties) { - return new Http(properties); - }; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encode - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rules != null && message.rules.length) - for (var i = 0; i < message.rules.length; ++i) - $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); - return writer; - }; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Http - * @static - * @param {google.api.IHttp} message Http message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Http.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Http message from the specified reader or buffer. - * @function decode - * @memberof google.api.Http - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Http} Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Http.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 2: { - message.fullyDecodeReservedExpansion = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - if (error) - return "rules." + error; - } - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - if (typeof message.fullyDecodeReservedExpansion !== "boolean") - return "fullyDecodeReservedExpansion: boolean expected"; - return null; - }; - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Http - * @static - * @param {Object.} object Plain object - * @returns {google.api.Http} Http - */ - Http.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.Http) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - if (object.fullyDecodeReservedExpansion != null) - message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); - return message; - }; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Http - * @static - * @param {google.api.Http} message Http - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Http.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rules = []; - if (options.defaults) - object.fullyDecodeReservedExpansion = false; - if (message.rules && message.rules.length) { - object.rules = []; - for (var j = 0; j < message.rules.length; ++j) - object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); - } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; - return object; - }; - - /** - * Converts this Http to JSON. - * @function toJSON - * @memberof google.api.Http - * @instance - * @returns {Object.} JSON object - */ - Http.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Http - * @function getTypeUrl - * @memberof google.api.Http - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Http"; - }; - - return Http; - })(); - - api.HttpRule = (function() { - - /** - * Properties of a HttpRule. - * @memberof google.api - * @interface IHttpRule - * @property {string|null} [selector] HttpRule selector - * @property {string|null} [get] HttpRule get - * @property {string|null} [put] HttpRule put - * @property {string|null} [post] HttpRule post - * @property {string|null} ["delete"] HttpRule delete - * @property {string|null} [patch] HttpRule patch - * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom - * @property {string|null} [body] HttpRule body - * @property {string|null} [responseBody] HttpRule responseBody - * @property {Array.|null} [additionalBindings] HttpRule additionalBindings - */ - - /** - * Constructs a new HttpRule. - * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule - * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set - */ - function HttpRule(properties) { - this.additionalBindings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * HttpRule selector. - * @member {string} selector - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.selector = ""; - - /** - * HttpRule get. - * @member {string|null|undefined} get - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.get = null; - - /** - * HttpRule put. - * @member {string|null|undefined} put - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.put = null; - - /** - * HttpRule post. - * @member {string|null|undefined} post - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.post = null; - - /** - * HttpRule delete. - * @member {string|null|undefined} delete - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype["delete"] = null; - - /** - * HttpRule patch. - * @member {string|null|undefined} patch - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.patch = null; - - /** - * HttpRule custom. - * @member {google.api.ICustomHttpPattern|null|undefined} custom - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.custom = null; - - /** - * HttpRule body. - * @member {string} body - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.body = ""; - - /** - * HttpRule responseBody. - * @member {string} responseBody - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.responseBody = ""; - - /** - * HttpRule additionalBindings. - * @member {Array.} additionalBindings - * @memberof google.api.HttpRule - * @instance - */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule - * @instance - */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new HttpRule instance using the specified properties. - * @function create - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance - */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); - }; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encode - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && Object.hasOwnProperty.call(message, "get")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && Object.hasOwnProperty.call(message, "put")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && Object.hasOwnProperty.call(message, "post")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) - $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.additionalBindings != null && message.additionalBindings.length) - for (var i = 0; i < message.additionalBindings.length; ++i) - $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); - return writer; - }; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.get = reader.string(); - break; - } - case 3: { - message.put = reader.string(); - break; - } - case 4: { - message.post = reader.string(); - break; - } - case 5: { - message["delete"] = reader.string(); - break; - } - case 6: { - message.patch = reader.string(); - break; - } - case 8: { - message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32(), undefined, long + 1); - 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(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.HttpRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a HttpRule message. - * @function verify - * @memberof google.api.HttpRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - HttpRule.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - 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], long + 1); - if (error) - return "additionalBindings." + error; - } - } - return null; - }; - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.HttpRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule - */ - HttpRule.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.HttpRule) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.HttpRule - * @static - * @param {google.api.HttpRule} message HttpRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - HttpRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.additionalBindings = []; - if (options.defaults) { - object.selector = ""; - object.body = ""; - object.responseBody = ""; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.get != null && message.hasOwnProperty("get")) { - object.get = message.get; - if (options.oneofs) - object.pattern = "get"; - } - if (message.put != null && message.hasOwnProperty("put")) { - object.put = message.put; - if (options.oneofs) - object.pattern = "put"; - } - if (message.post != null && message.hasOwnProperty("post")) { - object.post = message.post; - if (options.oneofs) - object.pattern = "post"; - } - if (message["delete"] != null && message.hasOwnProperty("delete")) { - object["delete"] = message["delete"]; - if (options.oneofs) - object.pattern = "delete"; - } - if (message.patch != null && message.hasOwnProperty("patch")) { - object.patch = message.patch; - if (options.oneofs) - object.pattern = "patch"; - } - if (message.body != null && message.hasOwnProperty("body")) - object.body = message.body; - if (message.custom != null && message.hasOwnProperty("custom")) { - object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); - if (options.oneofs) - object.pattern = "custom"; - } - if (message.additionalBindings && message.additionalBindings.length) { - object.additionalBindings = []; - for (var j = 0; j < message.additionalBindings.length; ++j) - object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); - } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; - return object; - }; - - /** - * Converts this HttpRule to JSON. - * @function toJSON - * @memberof google.api.HttpRule - * @instance - * @returns {Object.} JSON object - */ - HttpRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for HttpRule - * @function getTypeUrl - * @memberof google.api.HttpRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.HttpRule"; - }; - - return HttpRule; - })(); - - api.CustomHttpPattern = (function() { - - /** - * Properties of a CustomHttpPattern. - * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path - */ - - /** - * Constructs a new CustomHttpPattern. - * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern - * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - */ - function CustomHttpPattern(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.kind = ""; - - /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern - * @instance - */ - CustomHttpPattern.prototype.path = ""; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @function create - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance - */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); - }; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encode - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); - return writer; - }; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @function decode - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kind = reader.string(); - break; - } - case 2: { - message.path = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CustomHttpPattern - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomHttpPattern message. - * @function verify - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomHttpPattern.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.kind != null && message.hasOwnProperty("kind")) - if (!$util.isString(message.kind)) - return "kind: string expected"; - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; - return null; - }; - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern - */ - CustomHttpPattern.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.CustomHttpPattern) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.CustomHttpPattern(); - if (object.kind != null) - message.kind = String(object.kind); - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CustomHttpPattern - * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomHttpPattern.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this CustomHttpPattern to JSON. - * @function toJSON - * @memberof google.api.CustomHttpPattern - * @instance - * @returns {Object.} JSON object - */ - CustomHttpPattern.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomHttpPattern - * @function getTypeUrl - * @memberof google.api.CustomHttpPattern - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CustomHttpPattern"; - }; - - return CustomHttpPattern; - })(); - - api.CommonLanguageSettings = (function() { - - /** - * Properties of a CommonLanguageSettings. - * @memberof google.api - * @interface ICommonLanguageSettings - * @property {string|null} [referenceDocsUri] CommonLanguageSettings referenceDocsUri - * @property {Array.|null} [destinations] CommonLanguageSettings destinations - * @property {google.api.ISelectiveGapicGeneration|null} [selectiveGapicGeneration] CommonLanguageSettings selectiveGapicGeneration - */ - - /** - * Constructs a new CommonLanguageSettings. - * @memberof google.api - * @classdesc Represents a CommonLanguageSettings. - * @implements ICommonLanguageSettings - * @constructor - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - */ - function CommonLanguageSettings(properties) { - this.destinations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * CommonLanguageSettings referenceDocsUri. - * @member {string} referenceDocsUri - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.referenceDocsUri = ""; - - /** - * CommonLanguageSettings destinations. - * @member {Array.} destinations - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.destinations = $util.emptyArray; - - /** - * CommonLanguageSettings selectiveGapicGeneration. - * @member {google.api.ISelectiveGapicGeneration|null|undefined} selectiveGapicGeneration - * @memberof google.api.CommonLanguageSettings - * @instance - */ - CommonLanguageSettings.prototype.selectiveGapicGeneration = null; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @function create - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings=} [properties] Properties to set - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings instance - */ - CommonLanguageSettings.create = function create(properties) { - return new CommonLanguageSettings(properties); - }; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.referenceDocsUri != null && Object.hasOwnProperty.call(message, "referenceDocsUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.referenceDocsUri); - if (message.destinations != null && message.destinations.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.destinations.length; ++i) - writer.int32(message.destinations[i]); - writer.ldelim(); - } - if (message.selectiveGapicGeneration != null && Object.hasOwnProperty.call(message, "selectiveGapicGeneration")) - $root.google.api.SelectiveGapicGeneration.encode(message.selectiveGapicGeneration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.ICommonLanguageSettings} message CommonLanguageSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CommonLanguageSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CommonLanguageSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.referenceDocsUri = reader.string(); - break; - } - case 2: { - if (!(message.destinations && message.destinations.length)) - message.destinations = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.destinations.push(reader.int32()); - } else - message.destinations.push(reader.int32()); - break; - } - case 3: { - message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CommonLanguageSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CommonLanguageSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CommonLanguageSettings message. - * @function verify - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CommonLanguageSettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - if (!$util.isString(message.referenceDocsUri)) - return "referenceDocsUri: string expected"; - if (message.destinations != null && message.hasOwnProperty("destinations")) { - if (!Array.isArray(message.destinations)) - return "destinations: array expected"; - for (var i = 0; i < message.destinations.length; ++i) - switch (message.destinations[i]) { - default: - return "destinations: enum value[] expected"; - case 0: - case 10: - case 20: - break; - } - } - if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) { - var error = $root.google.api.SelectiveGapicGeneration.verify(message.selectiveGapicGeneration, long + 1); - if (error) - return "selectiveGapicGeneration." + error; - } - return null; - }; - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CommonLanguageSettings} CommonLanguageSettings - */ - CommonLanguageSettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.CommonLanguageSettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.CommonLanguageSettings(); - if (object.referenceDocsUri != null) - message.referenceDocsUri = String(object.referenceDocsUri); - if (object.destinations) { - if (!Array.isArray(object.destinations)) - throw TypeError(".google.api.CommonLanguageSettings.destinations: array expected"); - message.destinations = []; - for (var i = 0; i < object.destinations.length; ++i) - switch (object.destinations[i]) { - default: - if (typeof object.destinations[i] === "number") { - message.destinations[i] = object.destinations[i]; - break; - } - case "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": - case 0: - message.destinations[i] = 0; - break; - case "GITHUB": - case 10: - message.destinations[i] = 10; - break; - case "PACKAGE_MANAGER": - case 20: - message.destinations[i] = 20; - break; - } - } - if (object.selectiveGapicGeneration != null) { - if (typeof object.selectiveGapicGeneration !== "object") - throw TypeError(".google.api.CommonLanguageSettings.selectiveGapicGeneration: object expected"); - message.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.fromObject(object.selectiveGapicGeneration, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CommonLanguageSettings - * @static - * @param {google.api.CommonLanguageSettings} message CommonLanguageSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CommonLanguageSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.destinations = []; - if (options.defaults) { - object.referenceDocsUri = ""; - object.selectiveGapicGeneration = null; - } - if (message.referenceDocsUri != null && message.hasOwnProperty("referenceDocsUri")) - object.referenceDocsUri = message.referenceDocsUri; - if (message.destinations && message.destinations.length) { - object.destinations = []; - for (var j = 0; j < message.destinations.length; ++j) - object.destinations[j] = options.enums === String ? $root.google.api.ClientLibraryDestination[message.destinations[j]] === undefined ? message.destinations[j] : $root.google.api.ClientLibraryDestination[message.destinations[j]] : message.destinations[j]; - } - if (message.selectiveGapicGeneration != null && message.hasOwnProperty("selectiveGapicGeneration")) - object.selectiveGapicGeneration = $root.google.api.SelectiveGapicGeneration.toObject(message.selectiveGapicGeneration, options); - return object; - }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @function toJSON - * @memberof google.api.CommonLanguageSettings - * @instance - * @returns {Object.} JSON object - */ - CommonLanguageSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CommonLanguageSettings - * @function getTypeUrl - * @memberof google.api.CommonLanguageSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CommonLanguageSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CommonLanguageSettings"; - }; - - return CommonLanguageSettings; - })(); - - api.ClientLibrarySettings = (function() { - - /** - * Properties of a ClientLibrarySettings. - * @memberof google.api - * @interface IClientLibrarySettings - * @property {string|null} [version] ClientLibrarySettings version - * @property {google.api.LaunchStage|null} [launchStage] ClientLibrarySettings launchStage - * @property {boolean|null} [restNumericEnums] ClientLibrarySettings restNumericEnums - * @property {google.api.IJavaSettings|null} [javaSettings] ClientLibrarySettings javaSettings - * @property {google.api.ICppSettings|null} [cppSettings] ClientLibrarySettings cppSettings - * @property {google.api.IPhpSettings|null} [phpSettings] ClientLibrarySettings phpSettings - * @property {google.api.IPythonSettings|null} [pythonSettings] ClientLibrarySettings pythonSettings - * @property {google.api.INodeSettings|null} [nodeSettings] ClientLibrarySettings nodeSettings - * @property {google.api.IDotnetSettings|null} [dotnetSettings] ClientLibrarySettings dotnetSettings - * @property {google.api.IRubySettings|null} [rubySettings] ClientLibrarySettings rubySettings - * @property {google.api.IGoSettings|null} [goSettings] ClientLibrarySettings goSettings - */ - - /** - * Constructs a new ClientLibrarySettings. - * @memberof google.api - * @classdesc Represents a ClientLibrarySettings. - * @implements IClientLibrarySettings - * @constructor - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - */ - function ClientLibrarySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ClientLibrarySettings version. - * @member {string} version - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.version = ""; - - /** - * ClientLibrarySettings launchStage. - * @member {google.api.LaunchStage} launchStage - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.launchStage = 0; - - /** - * ClientLibrarySettings restNumericEnums. - * @member {boolean} restNumericEnums - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.restNumericEnums = false; - - /** - * ClientLibrarySettings javaSettings. - * @member {google.api.IJavaSettings|null|undefined} javaSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.javaSettings = null; - - /** - * ClientLibrarySettings cppSettings. - * @member {google.api.ICppSettings|null|undefined} cppSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.cppSettings = null; - - /** - * ClientLibrarySettings phpSettings. - * @member {google.api.IPhpSettings|null|undefined} phpSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.phpSettings = null; - - /** - * ClientLibrarySettings pythonSettings. - * @member {google.api.IPythonSettings|null|undefined} pythonSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.pythonSettings = null; - - /** - * ClientLibrarySettings nodeSettings. - * @member {google.api.INodeSettings|null|undefined} nodeSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.nodeSettings = null; - - /** - * ClientLibrarySettings dotnetSettings. - * @member {google.api.IDotnetSettings|null|undefined} dotnetSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.dotnetSettings = null; - - /** - * ClientLibrarySettings rubySettings. - * @member {google.api.IRubySettings|null|undefined} rubySettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.rubySettings = null; - - /** - * ClientLibrarySettings goSettings. - * @member {google.api.IGoSettings|null|undefined} goSettings - * @memberof google.api.ClientLibrarySettings - * @instance - */ - ClientLibrarySettings.prototype.goSettings = null; - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @function create - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings=} [properties] Properties to set - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings instance - */ - ClientLibrarySettings.create = function create(properties) { - return new ClientLibrarySettings(properties); - }; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.version); - if (message.launchStage != null && Object.hasOwnProperty.call(message, "launchStage")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.launchStage); - if (message.restNumericEnums != null && Object.hasOwnProperty.call(message, "restNumericEnums")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.restNumericEnums); - if (message.javaSettings != null && Object.hasOwnProperty.call(message, "javaSettings")) - $root.google.api.JavaSettings.encode(message.javaSettings, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.cppSettings != null && Object.hasOwnProperty.call(message, "cppSettings")) - $root.google.api.CppSettings.encode(message.cppSettings, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.phpSettings != null && Object.hasOwnProperty.call(message, "phpSettings")) - $root.google.api.PhpSettings.encode(message.phpSettings, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.pythonSettings != null && Object.hasOwnProperty.call(message, "pythonSettings")) - $root.google.api.PythonSettings.encode(message.pythonSettings, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.nodeSettings != null && Object.hasOwnProperty.call(message, "nodeSettings")) - $root.google.api.NodeSettings.encode(message.nodeSettings, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dotnetSettings != null && Object.hasOwnProperty.call(message, "dotnetSettings")) - $root.google.api.DotnetSettings.encode(message.dotnetSettings, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.rubySettings != null && Object.hasOwnProperty.call(message, "rubySettings")) - $root.google.api.RubySettings.encode(message.rubySettings, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.goSettings != null && Object.hasOwnProperty.call(message, "goSettings")) - $root.google.api.GoSettings.encode(message.goSettings, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.IClientLibrarySettings} message ClientLibrarySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ClientLibrarySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ClientLibrarySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.version = reader.string(); - break; - } - case 2: { - message.launchStage = reader.int32(); - break; - } - case 3: { - message.restNumericEnums = reader.bool(); - break; - } - case 21: { - message.javaSettings = $root.google.api.JavaSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 22: { - message.cppSettings = $root.google.api.CppSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 23: { - message.phpSettings = $root.google.api.PhpSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 24: { - message.pythonSettings = $root.google.api.PythonSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 25: { - message.nodeSettings = $root.google.api.NodeSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 26: { - message.dotnetSettings = $root.google.api.DotnetSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 27: { - message.rubySettings = $root.google.api.RubySettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 28: { - message.goSettings = $root.google.api.GoSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.ClientLibrarySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ClientLibrarySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ClientLibrarySettings message. - * @function verify - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ClientLibrarySettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - switch (message.launchStage) { - default: - return "launchStage: enum value expected"; - case 0: - case 6: - case 7: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - if (typeof message.restNumericEnums !== "boolean") - return "restNumericEnums: boolean expected"; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) { - var error = $root.google.api.JavaSettings.verify(message.javaSettings, long + 1); - if (error) - return "javaSettings." + error; - } - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) { - var error = $root.google.api.CppSettings.verify(message.cppSettings, long + 1); - if (error) - return "cppSettings." + error; - } - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) { - var error = $root.google.api.PhpSettings.verify(message.phpSettings, long + 1); - if (error) - return "phpSettings." + error; - } - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) { - var error = $root.google.api.PythonSettings.verify(message.pythonSettings, long + 1); - if (error) - return "pythonSettings." + error; - } - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) { - var error = $root.google.api.NodeSettings.verify(message.nodeSettings, long + 1); - if (error) - return "nodeSettings." + error; - } - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) { - var error = $root.google.api.DotnetSettings.verify(message.dotnetSettings, long + 1); - if (error) - return "dotnetSettings." + error; - } - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) { - var error = $root.google.api.RubySettings.verify(message.rubySettings, long + 1); - if (error) - return "rubySettings." + error; - } - if (message.goSettings != null && message.hasOwnProperty("goSettings")) { - var error = $root.google.api.GoSettings.verify(message.goSettings, long + 1); - if (error) - return "goSettings." + error; - } - return null; - }; - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.ClientLibrarySettings} ClientLibrarySettings - */ - ClientLibrarySettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.ClientLibrarySettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.ClientLibrarySettings(); - if (object.version != null) - message.version = String(object.version); - switch (object.launchStage) { - default: - if (typeof object.launchStage === "number") { - message.launchStage = object.launchStage; - break; - } - break; - case "LAUNCH_STAGE_UNSPECIFIED": - case 0: - message.launchStage = 0; - break; - case "UNIMPLEMENTED": - case 6: - message.launchStage = 6; - break; - case "PRELAUNCH": - case 7: - message.launchStage = 7; - break; - case "EARLY_ACCESS": - case 1: - message.launchStage = 1; - break; - case "ALPHA": - case 2: - message.launchStage = 2; - break; - case "BETA": - case 3: - message.launchStage = 3; - break; - case "GA": - case 4: - message.launchStage = 4; - break; - case "DEPRECATED": - case 5: - message.launchStage = 5; - break; - } - if (object.restNumericEnums != null) - message.restNumericEnums = Boolean(object.restNumericEnums); - if (object.javaSettings != null) { - if (typeof object.javaSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.javaSettings: object expected"); - message.javaSettings = $root.google.api.JavaSettings.fromObject(object.javaSettings, long + 1); - } - if (object.cppSettings != null) { - if (typeof object.cppSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.cppSettings: object expected"); - message.cppSettings = $root.google.api.CppSettings.fromObject(object.cppSettings, long + 1); - } - if (object.phpSettings != null) { - if (typeof object.phpSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.phpSettings: object expected"); - message.phpSettings = $root.google.api.PhpSettings.fromObject(object.phpSettings, long + 1); - } - if (object.pythonSettings != null) { - if (typeof object.pythonSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.pythonSettings: object expected"); - message.pythonSettings = $root.google.api.PythonSettings.fromObject(object.pythonSettings, long + 1); - } - if (object.nodeSettings != null) { - if (typeof object.nodeSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.nodeSettings: object expected"); - message.nodeSettings = $root.google.api.NodeSettings.fromObject(object.nodeSettings, long + 1); - } - if (object.dotnetSettings != null) { - if (typeof object.dotnetSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.dotnetSettings: object expected"); - message.dotnetSettings = $root.google.api.DotnetSettings.fromObject(object.dotnetSettings, long + 1); - } - if (object.rubySettings != null) { - if (typeof object.rubySettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.rubySettings: object expected"); - message.rubySettings = $root.google.api.RubySettings.fromObject(object.rubySettings, long + 1); - } - if (object.goSettings != null) { - if (typeof object.goSettings !== "object") - throw TypeError(".google.api.ClientLibrarySettings.goSettings: object expected"); - message.goSettings = $root.google.api.GoSettings.fromObject(object.goSettings, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.ClientLibrarySettings - * @static - * @param {google.api.ClientLibrarySettings} message ClientLibrarySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ClientLibrarySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.version = ""; - object.launchStage = options.enums === String ? "LAUNCH_STAGE_UNSPECIFIED" : 0; - object.restNumericEnums = false; - object.javaSettings = null; - object.cppSettings = null; - object.phpSettings = null; - object.pythonSettings = null; - object.nodeSettings = null; - object.dotnetSettings = null; - object.rubySettings = null; - object.goSettings = null; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.launchStage != null && message.hasOwnProperty("launchStage")) - object.launchStage = options.enums === String ? $root.google.api.LaunchStage[message.launchStage] === undefined ? message.launchStage : $root.google.api.LaunchStage[message.launchStage] : message.launchStage; - if (message.restNumericEnums != null && message.hasOwnProperty("restNumericEnums")) - object.restNumericEnums = message.restNumericEnums; - if (message.javaSettings != null && message.hasOwnProperty("javaSettings")) - object.javaSettings = $root.google.api.JavaSettings.toObject(message.javaSettings, options); - if (message.cppSettings != null && message.hasOwnProperty("cppSettings")) - object.cppSettings = $root.google.api.CppSettings.toObject(message.cppSettings, options); - if (message.phpSettings != null && message.hasOwnProperty("phpSettings")) - object.phpSettings = $root.google.api.PhpSettings.toObject(message.phpSettings, options); - if (message.pythonSettings != null && message.hasOwnProperty("pythonSettings")) - object.pythonSettings = $root.google.api.PythonSettings.toObject(message.pythonSettings, options); - if (message.nodeSettings != null && message.hasOwnProperty("nodeSettings")) - object.nodeSettings = $root.google.api.NodeSettings.toObject(message.nodeSettings, options); - if (message.dotnetSettings != null && message.hasOwnProperty("dotnetSettings")) - object.dotnetSettings = $root.google.api.DotnetSettings.toObject(message.dotnetSettings, options); - if (message.rubySettings != null && message.hasOwnProperty("rubySettings")) - object.rubySettings = $root.google.api.RubySettings.toObject(message.rubySettings, options); - if (message.goSettings != null && message.hasOwnProperty("goSettings")) - object.goSettings = $root.google.api.GoSettings.toObject(message.goSettings, options); - return object; - }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @function toJSON - * @memberof google.api.ClientLibrarySettings - * @instance - * @returns {Object.} JSON object - */ - ClientLibrarySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ClientLibrarySettings - * @function getTypeUrl - * @memberof google.api.ClientLibrarySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ClientLibrarySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.ClientLibrarySettings"; - }; - - return ClientLibrarySettings; - })(); - - api.Publishing = (function() { - - /** - * Properties of a Publishing. - * @memberof google.api - * @interface IPublishing - * @property {Array.|null} [methodSettings] Publishing methodSettings - * @property {string|null} [newIssueUri] Publishing newIssueUri - * @property {string|null} [documentationUri] Publishing documentationUri - * @property {string|null} [apiShortName] Publishing apiShortName - * @property {string|null} [githubLabel] Publishing githubLabel - * @property {Array.|null} [codeownerGithubTeams] Publishing codeownerGithubTeams - * @property {string|null} [docTagPrefix] Publishing docTagPrefix - * @property {google.api.ClientLibraryOrganization|null} [organization] Publishing organization - * @property {Array.|null} [librarySettings] Publishing librarySettings - * @property {string|null} [protoReferenceDocumentationUri] Publishing protoReferenceDocumentationUri - * @property {string|null} [restReferenceDocumentationUri] Publishing restReferenceDocumentationUri - */ - - /** - * Constructs a new Publishing. - * @memberof google.api - * @classdesc Represents a Publishing. - * @implements IPublishing - * @constructor - * @param {google.api.IPublishing=} [properties] Properties to set - */ - function Publishing(properties) { - this.methodSettings = []; - this.codeownerGithubTeams = []; - this.librarySettings = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Publishing methodSettings. - * @member {Array.} methodSettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.methodSettings = $util.emptyArray; - - /** - * Publishing newIssueUri. - * @member {string} newIssueUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.newIssueUri = ""; - - /** - * Publishing documentationUri. - * @member {string} documentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.documentationUri = ""; - - /** - * Publishing apiShortName. - * @member {string} apiShortName - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.apiShortName = ""; - - /** - * Publishing githubLabel. - * @member {string} githubLabel - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.githubLabel = ""; - - /** - * Publishing codeownerGithubTeams. - * @member {Array.} codeownerGithubTeams - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.codeownerGithubTeams = $util.emptyArray; - - /** - * Publishing docTagPrefix. - * @member {string} docTagPrefix - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.docTagPrefix = ""; - - /** - * Publishing organization. - * @member {google.api.ClientLibraryOrganization} organization - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.organization = 0; - - /** - * Publishing librarySettings. - * @member {Array.} librarySettings - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.librarySettings = $util.emptyArray; - - /** - * Publishing protoReferenceDocumentationUri. - * @member {string} protoReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.protoReferenceDocumentationUri = ""; - - /** - * Publishing restReferenceDocumentationUri. - * @member {string} restReferenceDocumentationUri - * @memberof google.api.Publishing - * @instance - */ - Publishing.prototype.restReferenceDocumentationUri = ""; - - /** - * Creates a new Publishing instance using the specified properties. - * @function create - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing=} [properties] Properties to set - * @returns {google.api.Publishing} Publishing instance - */ - Publishing.create = function create(properties) { - return new Publishing(properties); - }; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encode - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methodSettings != null && message.methodSettings.length) - for (var i = 0; i < message.methodSettings.length; ++i) - $root.google.api.MethodSettings.encode(message.methodSettings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.newIssueUri != null && Object.hasOwnProperty.call(message, "newIssueUri")) - writer.uint32(/* id 101, wireType 2 =*/810).string(message.newIssueUri); - if (message.documentationUri != null && Object.hasOwnProperty.call(message, "documentationUri")) - writer.uint32(/* id 102, wireType 2 =*/818).string(message.documentationUri); - if (message.apiShortName != null && Object.hasOwnProperty.call(message, "apiShortName")) - writer.uint32(/* id 103, wireType 2 =*/826).string(message.apiShortName); - if (message.githubLabel != null && Object.hasOwnProperty.call(message, "githubLabel")) - writer.uint32(/* id 104, wireType 2 =*/834).string(message.githubLabel); - if (message.codeownerGithubTeams != null && message.codeownerGithubTeams.length) - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - writer.uint32(/* id 105, wireType 2 =*/842).string(message.codeownerGithubTeams[i]); - if (message.docTagPrefix != null && Object.hasOwnProperty.call(message, "docTagPrefix")) - writer.uint32(/* id 106, wireType 2 =*/850).string(message.docTagPrefix); - if (message.organization != null && Object.hasOwnProperty.call(message, "organization")) - writer.uint32(/* id 107, wireType 0 =*/856).int32(message.organization); - if (message.librarySettings != null && message.librarySettings.length) - for (var i = 0; i < message.librarySettings.length; ++i) - $root.google.api.ClientLibrarySettings.encode(message.librarySettings[i], writer.uint32(/* id 109, wireType 2 =*/874).fork()).ldelim(); - if (message.protoReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "protoReferenceDocumentationUri")) - writer.uint32(/* id 110, wireType 2 =*/882).string(message.protoReferenceDocumentationUri); - if (message.restReferenceDocumentationUri != null && Object.hasOwnProperty.call(message, "restReferenceDocumentationUri")) - writer.uint32(/* id 111, wireType 2 =*/890).string(message.restReferenceDocumentationUri); - return writer; - }; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.Publishing - * @static - * @param {google.api.IPublishing} message Publishing message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Publishing.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @function decode - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Publishing(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.methodSettings && message.methodSettings.length)) - message.methodSettings = []; - message.methodSettings.push($root.google.api.MethodSettings.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 101: { - message.newIssueUri = reader.string(); - break; - } - case 102: { - message.documentationUri = reader.string(); - break; - } - case 103: { - message.apiShortName = reader.string(); - break; - } - case 104: { - message.githubLabel = reader.string(); - break; - } - case 105: { - if (!(message.codeownerGithubTeams && message.codeownerGithubTeams.length)) - message.codeownerGithubTeams = []; - message.codeownerGithubTeams.push(reader.string()); - break; - } - case 106: { - message.docTagPrefix = reader.string(); - break; - } - case 107: { - message.organization = reader.int32(); - break; - } - case 109: { - if (!(message.librarySettings && message.librarySettings.length)) - message.librarySettings = []; - message.librarySettings.push($root.google.api.ClientLibrarySettings.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 110: { - message.protoReferenceDocumentationUri = reader.string(); - break; - } - case 111: { - message.restReferenceDocumentationUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.Publishing - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Publishing} Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Publishing.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Publishing message. - * @function verify - * @memberof google.api.Publishing - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Publishing.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.methodSettings != null && message.hasOwnProperty("methodSettings")) { - if (!Array.isArray(message.methodSettings)) - return "methodSettings: array expected"; - for (var i = 0; i < message.methodSettings.length; ++i) { - var error = $root.google.api.MethodSettings.verify(message.methodSettings[i], long + 1); - if (error) - return "methodSettings." + error; - } - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - if (!$util.isString(message.newIssueUri)) - return "newIssueUri: string expected"; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - if (!$util.isString(message.documentationUri)) - return "documentationUri: string expected"; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - if (!$util.isString(message.apiShortName)) - return "apiShortName: string expected"; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - if (!$util.isString(message.githubLabel)) - return "githubLabel: string expected"; - if (message.codeownerGithubTeams != null && message.hasOwnProperty("codeownerGithubTeams")) { - if (!Array.isArray(message.codeownerGithubTeams)) - return "codeownerGithubTeams: array expected"; - for (var i = 0; i < message.codeownerGithubTeams.length; ++i) - if (!$util.isString(message.codeownerGithubTeams[i])) - return "codeownerGithubTeams: string[] expected"; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - if (!$util.isString(message.docTagPrefix)) - return "docTagPrefix: string expected"; - if (message.organization != null && message.hasOwnProperty("organization")) - switch (message.organization) { - default: - return "organization: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.librarySettings != null && message.hasOwnProperty("librarySettings")) { - if (!Array.isArray(message.librarySettings)) - return "librarySettings: array expected"; - for (var i = 0; i < message.librarySettings.length; ++i) { - var error = $root.google.api.ClientLibrarySettings.verify(message.librarySettings[i], long + 1); - if (error) - return "librarySettings." + error; - } - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - if (!$util.isString(message.protoReferenceDocumentationUri)) - return "protoReferenceDocumentationUri: string expected"; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - if (!$util.isString(message.restReferenceDocumentationUri)) - return "restReferenceDocumentationUri: string expected"; - return null; - }; - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.Publishing - * @static - * @param {Object.} object Plain object - * @returns {google.api.Publishing} Publishing - */ - Publishing.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.Publishing) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.Publishing(); - if (object.methodSettings) { - if (!Array.isArray(object.methodSettings)) - throw TypeError(".google.api.Publishing.methodSettings: array expected"); - message.methodSettings = []; - for (var i = 0; i < object.methodSettings.length; ++i) { - if (typeof object.methodSettings[i] !== "object") - throw TypeError(".google.api.Publishing.methodSettings: object expected"); - message.methodSettings[i] = $root.google.api.MethodSettings.fromObject(object.methodSettings[i], long + 1); - } - } - if (object.newIssueUri != null) - message.newIssueUri = String(object.newIssueUri); - if (object.documentationUri != null) - message.documentationUri = String(object.documentationUri); - if (object.apiShortName != null) - message.apiShortName = String(object.apiShortName); - if (object.githubLabel != null) - message.githubLabel = String(object.githubLabel); - if (object.codeownerGithubTeams) { - if (!Array.isArray(object.codeownerGithubTeams)) - throw TypeError(".google.api.Publishing.codeownerGithubTeams: array expected"); - message.codeownerGithubTeams = []; - for (var i = 0; i < object.codeownerGithubTeams.length; ++i) - message.codeownerGithubTeams[i] = String(object.codeownerGithubTeams[i]); - } - if (object.docTagPrefix != null) - message.docTagPrefix = String(object.docTagPrefix); - switch (object.organization) { - default: - if (typeof object.organization === "number") { - message.organization = object.organization; - break; - } - break; - case "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": - case 0: - message.organization = 0; - break; - case "CLOUD": - case 1: - message.organization = 1; - break; - case "ADS": - case 2: - message.organization = 2; - break; - case "PHOTOS": - case 3: - message.organization = 3; - break; - case "STREET_VIEW": - case 4: - message.organization = 4; - break; - case "SHOPPING": - case 5: - message.organization = 5; - break; - case "GEO": - case 6: - message.organization = 6; - break; - case "GENERATIVE_AI": - case 7: - message.organization = 7; - break; - } - if (object.librarySettings) { - if (!Array.isArray(object.librarySettings)) - throw TypeError(".google.api.Publishing.librarySettings: array expected"); - message.librarySettings = []; - for (var i = 0; i < object.librarySettings.length; ++i) { - if (typeof object.librarySettings[i] !== "object") - throw TypeError(".google.api.Publishing.librarySettings: object expected"); - message.librarySettings[i] = $root.google.api.ClientLibrarySettings.fromObject(object.librarySettings[i], long + 1); - } - } - if (object.protoReferenceDocumentationUri != null) - message.protoReferenceDocumentationUri = String(object.protoReferenceDocumentationUri); - if (object.restReferenceDocumentationUri != null) - message.restReferenceDocumentationUri = String(object.restReferenceDocumentationUri); - return message; - }; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.Publishing - * @static - * @param {google.api.Publishing} message Publishing - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Publishing.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.methodSettings = []; - object.codeownerGithubTeams = []; - object.librarySettings = []; - } - if (options.defaults) { - object.newIssueUri = ""; - object.documentationUri = ""; - object.apiShortName = ""; - object.githubLabel = ""; - object.docTagPrefix = ""; - object.organization = options.enums === String ? "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED" : 0; - object.protoReferenceDocumentationUri = ""; - object.restReferenceDocumentationUri = ""; - } - if (message.methodSettings && message.methodSettings.length) { - object.methodSettings = []; - for (var j = 0; j < message.methodSettings.length; ++j) - object.methodSettings[j] = $root.google.api.MethodSettings.toObject(message.methodSettings[j], options); - } - if (message.newIssueUri != null && message.hasOwnProperty("newIssueUri")) - object.newIssueUri = message.newIssueUri; - if (message.documentationUri != null && message.hasOwnProperty("documentationUri")) - object.documentationUri = message.documentationUri; - if (message.apiShortName != null && message.hasOwnProperty("apiShortName")) - object.apiShortName = message.apiShortName; - if (message.githubLabel != null && message.hasOwnProperty("githubLabel")) - object.githubLabel = message.githubLabel; - if (message.codeownerGithubTeams && message.codeownerGithubTeams.length) { - object.codeownerGithubTeams = []; - for (var j = 0; j < message.codeownerGithubTeams.length; ++j) - object.codeownerGithubTeams[j] = message.codeownerGithubTeams[j]; - } - if (message.docTagPrefix != null && message.hasOwnProperty("docTagPrefix")) - object.docTagPrefix = message.docTagPrefix; - if (message.organization != null && message.hasOwnProperty("organization")) - object.organization = options.enums === String ? $root.google.api.ClientLibraryOrganization[message.organization] === undefined ? message.organization : $root.google.api.ClientLibraryOrganization[message.organization] : message.organization; - if (message.librarySettings && message.librarySettings.length) { - object.librarySettings = []; - for (var j = 0; j < message.librarySettings.length; ++j) - object.librarySettings[j] = $root.google.api.ClientLibrarySettings.toObject(message.librarySettings[j], options); - } - if (message.protoReferenceDocumentationUri != null && message.hasOwnProperty("protoReferenceDocumentationUri")) - object.protoReferenceDocumentationUri = message.protoReferenceDocumentationUri; - if (message.restReferenceDocumentationUri != null && message.hasOwnProperty("restReferenceDocumentationUri")) - object.restReferenceDocumentationUri = message.restReferenceDocumentationUri; - return object; - }; - - /** - * Converts this Publishing to JSON. - * @function toJSON - * @memberof google.api.Publishing - * @instance - * @returns {Object.} JSON object - */ - Publishing.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Publishing - * @function getTypeUrl - * @memberof google.api.Publishing - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Publishing.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.Publishing"; - }; - - return Publishing; - })(); - - api.JavaSettings = (function() { - - /** - * Properties of a JavaSettings. - * @memberof google.api - * @interface IJavaSettings - * @property {string|null} [libraryPackage] JavaSettings libraryPackage - * @property {Object.|null} [serviceClassNames] JavaSettings serviceClassNames - * @property {google.api.ICommonLanguageSettings|null} [common] JavaSettings common - */ - - /** - * Constructs a new JavaSettings. - * @memberof google.api - * @classdesc Represents a JavaSettings. - * @implements IJavaSettings - * @constructor - * @param {google.api.IJavaSettings=} [properties] Properties to set - */ - function JavaSettings(properties) { - this.serviceClassNames = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * JavaSettings libraryPackage. - * @member {string} libraryPackage - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.libraryPackage = ""; - - /** - * JavaSettings serviceClassNames. - * @member {Object.} serviceClassNames - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.serviceClassNames = $util.emptyObject; - - /** - * JavaSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.JavaSettings - * @instance - */ - JavaSettings.prototype.common = null; - - /** - * Creates a new JavaSettings instance using the specified properties. - * @function create - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings=} [properties] Properties to set - * @returns {google.api.JavaSettings} JavaSettings instance - */ - JavaSettings.create = function create(properties) { - return new JavaSettings(properties); - }; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encode - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.libraryPackage != null && Object.hasOwnProperty.call(message, "libraryPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.libraryPackage); - if (message.serviceClassNames != null && Object.hasOwnProperty.call(message, "serviceClassNames")) - for (var keys = Object.keys(message.serviceClassNames), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.serviceClassNames[keys[i]]).ldelim(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {google.api.IJavaSettings} message JavaSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - JavaSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.JavaSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.libraryPackage = reader.string(); - break; - } - case 2: { - if (message.serviceClassNames === $util.emptyObject) - message.serviceClassNames = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.serviceClassNames, key); - message.serviceClassNames[key] = value; - break; - } - case 3: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.JavaSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.JavaSettings} JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - JavaSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a JavaSettings message. - * @function verify - * @memberof google.api.JavaSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - JavaSettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - if (!$util.isString(message.libraryPackage)) - return "libraryPackage: string expected"; - if (message.serviceClassNames != null && message.hasOwnProperty("serviceClassNames")) { - if (!$util.isObject(message.serviceClassNames)) - return "serviceClassNames: object expected"; - var key = Object.keys(message.serviceClassNames); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.serviceClassNames[key[i]])) - return "serviceClassNames: string{k:string} expected"; - } - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.JavaSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.JavaSettings} JavaSettings - */ - JavaSettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.JavaSettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.JavaSettings(); - if (object.libraryPackage != null) - message.libraryPackage = String(object.libraryPackage); - if (object.serviceClassNames) { - if (typeof object.serviceClassNames !== "object") - throw TypeError(".google.api.JavaSettings.serviceClassNames: object expected"); - message.serviceClassNames = {}; - for (var keys = Object.keys(object.serviceClassNames), i = 0; i < keys.length; ++i) { - if (keys[i] === "__proto__") - $util.makeProp(message.serviceClassNames, keys[i]); - message.serviceClassNames[keys[i]] = String(object.serviceClassNames[keys[i]]); - } - } - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.JavaSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.JavaSettings - * @static - * @param {google.api.JavaSettings} message JavaSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - JavaSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.serviceClassNames = {}; - if (options.defaults) { - object.libraryPackage = ""; - object.common = null; - } - if (message.libraryPackage != null && message.hasOwnProperty("libraryPackage")) - object.libraryPackage = message.libraryPackage; - var keys2; - if (message.serviceClassNames && (keys2 = Object.keys(message.serviceClassNames)).length) { - object.serviceClassNames = {}; - for (var j = 0; j < keys2.length; ++j) { - if (keys2[j] === "__proto__") - $util.makeProp(object.serviceClassNames, keys2[j]); - object.serviceClassNames[keys2[j]] = message.serviceClassNames[keys2[j]]; - } - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this JavaSettings to JSON. - * @function toJSON - * @memberof google.api.JavaSettings - * @instance - * @returns {Object.} JSON object - */ - JavaSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for JavaSettings - * @function getTypeUrl - * @memberof google.api.JavaSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - JavaSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.JavaSettings"; - }; - - return JavaSettings; - })(); - - api.CppSettings = (function() { - - /** - * Properties of a CppSettings. - * @memberof google.api - * @interface ICppSettings - * @property {google.api.ICommonLanguageSettings|null} [common] CppSettings common - */ - - /** - * Constructs a new CppSettings. - * @memberof google.api - * @classdesc Represents a CppSettings. - * @implements ICppSettings - * @constructor - * @param {google.api.ICppSettings=} [properties] Properties to set - */ - function CppSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * CppSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.CppSettings - * @instance - */ - CppSettings.prototype.common = null; - - /** - * Creates a new CppSettings instance using the specified properties. - * @function create - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings=} [properties] Properties to set - * @returns {google.api.CppSettings} CppSettings instance - */ - CppSettings.create = function create(properties) { - return new CppSettings(properties); - }; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encode - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {google.api.ICppSettings} message CppSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CppSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CppSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.CppSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CppSettings} CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CppSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CppSettings message. - * @function verify - * @memberof google.api.CppSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CppSettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.CppSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.CppSettings} CppSettings - */ - CppSettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.CppSettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.CppSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.CppSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.CppSettings - * @static - * @param {google.api.CppSettings} message CppSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CppSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this CppSettings to JSON. - * @function toJSON - * @memberof google.api.CppSettings - * @instance - * @returns {Object.} JSON object - */ - CppSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CppSettings - * @function getTypeUrl - * @memberof google.api.CppSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CppSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.CppSettings"; - }; - - return CppSettings; - })(); - - api.PhpSettings = (function() { - - /** - * Properties of a PhpSettings. - * @memberof google.api - * @interface IPhpSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PhpSettings common - */ - - /** - * Constructs a new PhpSettings. - * @memberof google.api - * @classdesc Represents a PhpSettings. - * @implements IPhpSettings - * @constructor - * @param {google.api.IPhpSettings=} [properties] Properties to set - */ - function PhpSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PhpSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PhpSettings - * @instance - */ - PhpSettings.prototype.common = null; - - /** - * Creates a new PhpSettings instance using the specified properties. - * @function create - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings=} [properties] Properties to set - * @returns {google.api.PhpSettings} PhpSettings instance - */ - PhpSettings.create = function create(properties) { - return new PhpSettings(properties); - }; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {google.api.IPhpSettings} message PhpSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PhpSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PhpSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PhpSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PhpSettings} PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PhpSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PhpSettings message. - * @function verify - * @memberof google.api.PhpSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PhpSettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PhpSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PhpSettings} PhpSettings - */ - PhpSettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.PhpSettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.PhpSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PhpSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PhpSettings - * @static - * @param {google.api.PhpSettings} message PhpSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PhpSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this PhpSettings to JSON. - * @function toJSON - * @memberof google.api.PhpSettings - * @instance - * @returns {Object.} JSON object - */ - PhpSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PhpSettings - * @function getTypeUrl - * @memberof google.api.PhpSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PhpSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PhpSettings"; - }; - - return PhpSettings; - })(); - - api.PythonSettings = (function() { - - /** - * Properties of a PythonSettings. - * @memberof google.api - * @interface IPythonSettings - * @property {google.api.ICommonLanguageSettings|null} [common] PythonSettings common - * @property {google.api.PythonSettings.IExperimentalFeatures|null} [experimentalFeatures] PythonSettings experimentalFeatures - */ - - /** - * Constructs a new PythonSettings. - * @memberof google.api - * @classdesc Represents a PythonSettings. - * @implements IPythonSettings - * @constructor - * @param {google.api.IPythonSettings=} [properties] Properties to set - */ - function PythonSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * PythonSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.common = null; - - /** - * PythonSettings experimentalFeatures. - * @member {google.api.PythonSettings.IExperimentalFeatures|null|undefined} experimentalFeatures - * @memberof google.api.PythonSettings - * @instance - */ - PythonSettings.prototype.experimentalFeatures = null; - - /** - * Creates a new PythonSettings instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings=} [properties] Properties to set - * @returns {google.api.PythonSettings} PythonSettings instance - */ - PythonSettings.create = function create(properties) { - return new PythonSettings(properties); - }; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.experimentalFeatures != null && Object.hasOwnProperty.call(message, "experimentalFeatures")) - $root.google.api.PythonSettings.ExperimentalFeatures.encode(message.experimentalFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {google.api.IPythonSettings} message PythonSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PythonSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings} PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PythonSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PythonSettings message. - * @function verify - * @memberof google.api.PythonSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PythonSettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); - if (error) - return "common." + error; - } - if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) { - var error = $root.google.api.PythonSettings.ExperimentalFeatures.verify(message.experimentalFeatures, long + 1); - if (error) - return "experimentalFeatures." + error; - } - return null; - }; - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings} PythonSettings - */ - PythonSettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.PythonSettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.PythonSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.PythonSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); - } - if (object.experimentalFeatures != null) { - if (typeof object.experimentalFeatures !== "object") - throw TypeError(".google.api.PythonSettings.experimentalFeatures: object expected"); - message.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.fromObject(object.experimentalFeatures, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings - * @static - * @param {google.api.PythonSettings} message PythonSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PythonSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.common = null; - object.experimentalFeatures = null; - } - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - if (message.experimentalFeatures != null && message.hasOwnProperty("experimentalFeatures")) - object.experimentalFeatures = $root.google.api.PythonSettings.ExperimentalFeatures.toObject(message.experimentalFeatures, options); - return object; - }; - - /** - * Converts this PythonSettings to JSON. - * @function toJSON - * @memberof google.api.PythonSettings - * @instance - * @returns {Object.} JSON object - */ - PythonSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PythonSettings - * @function getTypeUrl - * @memberof google.api.PythonSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PythonSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings"; - }; - - PythonSettings.ExperimentalFeatures = (function() { - - /** - * Properties of an ExperimentalFeatures. - * @memberof google.api.PythonSettings - * @interface IExperimentalFeatures - * @property {boolean|null} [restAsyncIoEnabled] ExperimentalFeatures restAsyncIoEnabled - * @property {boolean|null} [protobufPythonicTypesEnabled] ExperimentalFeatures protobufPythonicTypesEnabled - * @property {boolean|null} [unversionedPackageDisabled] ExperimentalFeatures unversionedPackageDisabled - */ - - /** - * Constructs a new ExperimentalFeatures. - * @memberof google.api.PythonSettings - * @classdesc Represents an ExperimentalFeatures. - * @implements IExperimentalFeatures - * @constructor - * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set - */ - function ExperimentalFeatures(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExperimentalFeatures restAsyncIoEnabled. - * @member {boolean} restAsyncIoEnabled - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @instance - */ - ExperimentalFeatures.prototype.restAsyncIoEnabled = false; - - /** - * ExperimentalFeatures protobufPythonicTypesEnabled. - * @member {boolean} protobufPythonicTypesEnabled - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @instance - */ - ExperimentalFeatures.prototype.protobufPythonicTypesEnabled = false; - - /** - * ExperimentalFeatures unversionedPackageDisabled. - * @member {boolean} unversionedPackageDisabled - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @instance - */ - ExperimentalFeatures.prototype.unversionedPackageDisabled = false; - - /** - * Creates a new ExperimentalFeatures instance using the specified properties. - * @function create - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {google.api.PythonSettings.IExperimentalFeatures=} [properties] Properties to set - * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures instance - */ - ExperimentalFeatures.create = function create(properties) { - return new ExperimentalFeatures(properties); - }; - - /** - * Encodes the specified ExperimentalFeatures message. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. - * @function encode - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExperimentalFeatures.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.restAsyncIoEnabled != null && Object.hasOwnProperty.call(message, "restAsyncIoEnabled")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.restAsyncIoEnabled); - if (message.protobufPythonicTypesEnabled != null && Object.hasOwnProperty.call(message, "protobufPythonicTypesEnabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.protobufPythonicTypesEnabled); - if (message.unversionedPackageDisabled != null && Object.hasOwnProperty.call(message, "unversionedPackageDisabled")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.unversionedPackageDisabled); - return writer; - }; - - /** - * Encodes the specified ExperimentalFeatures message, length delimited. Does not implicitly {@link google.api.PythonSettings.ExperimentalFeatures.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {google.api.PythonSettings.IExperimentalFeatures} message ExperimentalFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExperimentalFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExperimentalFeatures message from the specified reader or buffer. - * @function decode - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExperimentalFeatures.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.PythonSettings.ExperimentalFeatures(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.restAsyncIoEnabled = reader.bool(); - break; - } - case 2: { - message.protobufPythonicTypesEnabled = reader.bool(); - break; - } - case 3: { - message.unversionedPackageDisabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an ExperimentalFeatures message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExperimentalFeatures.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExperimentalFeatures message. - * @function verify - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExperimentalFeatures.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) - if (typeof message.restAsyncIoEnabled !== "boolean") - return "restAsyncIoEnabled: boolean expected"; - if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) - if (typeof message.protobufPythonicTypesEnabled !== "boolean") - return "protobufPythonicTypesEnabled: boolean expected"; - if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) - if (typeof message.unversionedPackageDisabled !== "boolean") - return "unversionedPackageDisabled: boolean expected"; - return null; - }; - - /** - * Creates an ExperimentalFeatures message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {Object.} object Plain object - * @returns {google.api.PythonSettings.ExperimentalFeatures} ExperimentalFeatures - */ - ExperimentalFeatures.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.PythonSettings.ExperimentalFeatures) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.PythonSettings.ExperimentalFeatures(); - if (object.restAsyncIoEnabled != null) - message.restAsyncIoEnabled = Boolean(object.restAsyncIoEnabled); - if (object.protobufPythonicTypesEnabled != null) - message.protobufPythonicTypesEnabled = Boolean(object.protobufPythonicTypesEnabled); - if (object.unversionedPackageDisabled != null) - message.unversionedPackageDisabled = Boolean(object.unversionedPackageDisabled); - return message; - }; - - /** - * Creates a plain object from an ExperimentalFeatures message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {google.api.PythonSettings.ExperimentalFeatures} message ExperimentalFeatures - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExperimentalFeatures.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.restAsyncIoEnabled = false; - object.protobufPythonicTypesEnabled = false; - object.unversionedPackageDisabled = false; - } - if (message.restAsyncIoEnabled != null && message.hasOwnProperty("restAsyncIoEnabled")) - object.restAsyncIoEnabled = message.restAsyncIoEnabled; - if (message.protobufPythonicTypesEnabled != null && message.hasOwnProperty("protobufPythonicTypesEnabled")) - object.protobufPythonicTypesEnabled = message.protobufPythonicTypesEnabled; - if (message.unversionedPackageDisabled != null && message.hasOwnProperty("unversionedPackageDisabled")) - object.unversionedPackageDisabled = message.unversionedPackageDisabled; - return object; - }; - - /** - * Converts this ExperimentalFeatures to JSON. - * @function toJSON - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @instance - * @returns {Object.} JSON object - */ - ExperimentalFeatures.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExperimentalFeatures - * @function getTypeUrl - * @memberof google.api.PythonSettings.ExperimentalFeatures - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExperimentalFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.PythonSettings.ExperimentalFeatures"; - }; - - return ExperimentalFeatures; - })(); - - return PythonSettings; - })(); - - api.NodeSettings = (function() { - - /** - * Properties of a NodeSettings. - * @memberof google.api - * @interface INodeSettings - * @property {google.api.ICommonLanguageSettings|null} [common] NodeSettings common - */ - - /** - * Constructs a new NodeSettings. - * @memberof google.api - * @classdesc Represents a NodeSettings. - * @implements INodeSettings - * @constructor - * @param {google.api.INodeSettings=} [properties] Properties to set - */ - function NodeSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * NodeSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.NodeSettings - * @instance - */ - NodeSettings.prototype.common = null; - - /** - * Creates a new NodeSettings instance using the specified properties. - * @function create - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings=} [properties] Properties to set - * @returns {google.api.NodeSettings} NodeSettings instance - */ - NodeSettings.create = function create(properties) { - return new NodeSettings(properties); - }; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encode - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {google.api.INodeSettings} message NodeSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.NodeSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.NodeSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.NodeSettings} NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeSettings message. - * @function verify - * @memberof google.api.NodeSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeSettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.NodeSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.NodeSettings} NodeSettings - */ - NodeSettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.NodeSettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.NodeSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.NodeSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.NodeSettings - * @static - * @param {google.api.NodeSettings} message NodeSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this NodeSettings to JSON. - * @function toJSON - * @memberof google.api.NodeSettings - * @instance - * @returns {Object.} JSON object - */ - NodeSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeSettings - * @function getTypeUrl - * @memberof google.api.NodeSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.NodeSettings"; - }; - - return NodeSettings; - })(); - - api.DotnetSettings = (function() { - - /** - * Properties of a DotnetSettings. - * @memberof google.api - * @interface IDotnetSettings - * @property {google.api.ICommonLanguageSettings|null} [common] DotnetSettings common - * @property {Object.|null} [renamedServices] DotnetSettings renamedServices - * @property {Object.|null} [renamedResources] DotnetSettings renamedResources - * @property {Array.|null} [ignoredResources] DotnetSettings ignoredResources - * @property {Array.|null} [forcedNamespaceAliases] DotnetSettings forcedNamespaceAliases - * @property {Array.|null} [handwrittenSignatures] DotnetSettings handwrittenSignatures - */ - - /** - * Constructs a new DotnetSettings. - * @memberof google.api - * @classdesc Represents a DotnetSettings. - * @implements IDotnetSettings - * @constructor - * @param {google.api.IDotnetSettings=} [properties] Properties to set - */ - function DotnetSettings(properties) { - this.renamedServices = {}; - this.renamedResources = {}; - this.ignoredResources = []; - this.forcedNamespaceAliases = []; - this.handwrittenSignatures = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * DotnetSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.common = null; - - /** - * DotnetSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedServices = $util.emptyObject; - - /** - * DotnetSettings renamedResources. - * @member {Object.} renamedResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.renamedResources = $util.emptyObject; - - /** - * DotnetSettings ignoredResources. - * @member {Array.} ignoredResources - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.ignoredResources = $util.emptyArray; - - /** - * DotnetSettings forcedNamespaceAliases. - * @member {Array.} forcedNamespaceAliases - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.forcedNamespaceAliases = $util.emptyArray; - - /** - * DotnetSettings handwrittenSignatures. - * @member {Array.} handwrittenSignatures - * @memberof google.api.DotnetSettings - * @instance - */ - DotnetSettings.prototype.handwrittenSignatures = $util.emptyArray; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @function create - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings=} [properties] Properties to set - * @returns {google.api.DotnetSettings} DotnetSettings instance - */ - DotnetSettings.create = function create(properties) { - return new DotnetSettings(properties); - }; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encode - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - if (message.renamedResources != null && Object.hasOwnProperty.call(message, "renamedResources")) - for (var keys = Object.keys(message.renamedResources), i = 0; i < keys.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedResources[keys[i]]).ldelim(); - if (message.ignoredResources != null && message.ignoredResources.length) - for (var i = 0; i < message.ignoredResources.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ignoredResources[i]); - if (message.forcedNamespaceAliases != null && message.forcedNamespaceAliases.length) - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.forcedNamespaceAliases[i]); - if (message.handwrittenSignatures != null && message.handwrittenSignatures.length) - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.handwrittenSignatures[i]); - return writer; - }; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.IDotnetSettings} message DotnetSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DotnetSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.DotnetSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.renamedServices, key); - message.renamedServices[key] = value; - break; - } - case 3: { - if (message.renamedResources === $util.emptyObject) - message.renamedResources = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.renamedResources, key); - message.renamedResources[key] = value; - break; - } - case 4: { - if (!(message.ignoredResources && message.ignoredResources.length)) - message.ignoredResources = []; - message.ignoredResources.push(reader.string()); - break; - } - case 5: { - if (!(message.forcedNamespaceAliases && message.forcedNamespaceAliases.length)) - message.forcedNamespaceAliases = []; - message.forcedNamespaceAliases.push(reader.string()); - break; - } - case 6: { - if (!(message.handwrittenSignatures && message.handwrittenSignatures.length)) - message.handwrittenSignatures = []; - message.handwrittenSignatures.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.DotnetSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.DotnetSettings} DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DotnetSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DotnetSettings message. - * @function verify - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DotnetSettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - if (message.renamedResources != null && message.hasOwnProperty("renamedResources")) { - if (!$util.isObject(message.renamedResources)) - return "renamedResources: object expected"; - var key = Object.keys(message.renamedResources); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedResources[key[i]])) - return "renamedResources: string{k:string} expected"; - } - if (message.ignoredResources != null && message.hasOwnProperty("ignoredResources")) { - if (!Array.isArray(message.ignoredResources)) - return "ignoredResources: array expected"; - for (var i = 0; i < message.ignoredResources.length; ++i) - if (!$util.isString(message.ignoredResources[i])) - return "ignoredResources: string[] expected"; - } - if (message.forcedNamespaceAliases != null && message.hasOwnProperty("forcedNamespaceAliases")) { - if (!Array.isArray(message.forcedNamespaceAliases)) - return "forcedNamespaceAliases: array expected"; - for (var i = 0; i < message.forcedNamespaceAliases.length; ++i) - if (!$util.isString(message.forcedNamespaceAliases[i])) - return "forcedNamespaceAliases: string[] expected"; - } - if (message.handwrittenSignatures != null && message.hasOwnProperty("handwrittenSignatures")) { - if (!Array.isArray(message.handwrittenSignatures)) - return "handwrittenSignatures: array expected"; - for (var i = 0; i < message.handwrittenSignatures.length; ++i) - if (!$util.isString(message.handwrittenSignatures[i])) - return "handwrittenSignatures: string[] expected"; - } - return null; - }; - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.DotnetSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.DotnetSettings} DotnetSettings - */ - DotnetSettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.DotnetSettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.DotnetSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.DotnetSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.DotnetSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { - if (keys[i] === "__proto__") - $util.makeProp(message.renamedServices, keys[i]); - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - } - if (object.renamedResources) { - if (typeof object.renamedResources !== "object") - throw TypeError(".google.api.DotnetSettings.renamedResources: object expected"); - message.renamedResources = {}; - for (var keys = Object.keys(object.renamedResources), i = 0; i < keys.length; ++i) { - if (keys[i] === "__proto__") - $util.makeProp(message.renamedResources, keys[i]); - message.renamedResources[keys[i]] = String(object.renamedResources[keys[i]]); - } - } - if (object.ignoredResources) { - if (!Array.isArray(object.ignoredResources)) - throw TypeError(".google.api.DotnetSettings.ignoredResources: array expected"); - message.ignoredResources = []; - for (var i = 0; i < object.ignoredResources.length; ++i) - message.ignoredResources[i] = String(object.ignoredResources[i]); - } - if (object.forcedNamespaceAliases) { - if (!Array.isArray(object.forcedNamespaceAliases)) - throw TypeError(".google.api.DotnetSettings.forcedNamespaceAliases: array expected"); - message.forcedNamespaceAliases = []; - for (var i = 0; i < object.forcedNamespaceAliases.length; ++i) - message.forcedNamespaceAliases[i] = String(object.forcedNamespaceAliases[i]); - } - if (object.handwrittenSignatures) { - if (!Array.isArray(object.handwrittenSignatures)) - throw TypeError(".google.api.DotnetSettings.handwrittenSignatures: array expected"); - message.handwrittenSignatures = []; - for (var i = 0; i < object.handwrittenSignatures.length; ++i) - message.handwrittenSignatures[i] = String(object.handwrittenSignatures[i]); - } - return message; - }; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.DotnetSettings - * @static - * @param {google.api.DotnetSettings} message DotnetSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DotnetSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.ignoredResources = []; - object.forcedNamespaceAliases = []; - object.handwrittenSignatures = []; - } - if (options.objects || options.defaults) { - object.renamedServices = {}; - object.renamedResources = {}; - } - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) { - if (keys2[j] === "__proto__") - $util.makeProp(object.renamedServices, keys2[j]); - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - } - if (message.renamedResources && (keys2 = Object.keys(message.renamedResources)).length) { - object.renamedResources = {}; - for (var j = 0; j < keys2.length; ++j) { - if (keys2[j] === "__proto__") - $util.makeProp(object.renamedResources, keys2[j]); - object.renamedResources[keys2[j]] = message.renamedResources[keys2[j]]; - } - } - if (message.ignoredResources && message.ignoredResources.length) { - object.ignoredResources = []; - for (var j = 0; j < message.ignoredResources.length; ++j) - object.ignoredResources[j] = message.ignoredResources[j]; - } - if (message.forcedNamespaceAliases && message.forcedNamespaceAliases.length) { - object.forcedNamespaceAliases = []; - for (var j = 0; j < message.forcedNamespaceAliases.length; ++j) - object.forcedNamespaceAliases[j] = message.forcedNamespaceAliases[j]; - } - if (message.handwrittenSignatures && message.handwrittenSignatures.length) { - object.handwrittenSignatures = []; - for (var j = 0; j < message.handwrittenSignatures.length; ++j) - object.handwrittenSignatures[j] = message.handwrittenSignatures[j]; - } - return object; - }; - - /** - * Converts this DotnetSettings to JSON. - * @function toJSON - * @memberof google.api.DotnetSettings - * @instance - * @returns {Object.} JSON object - */ - DotnetSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DotnetSettings - * @function getTypeUrl - * @memberof google.api.DotnetSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DotnetSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.DotnetSettings"; - }; - - return DotnetSettings; - })(); - - api.RubySettings = (function() { - - /** - * Properties of a RubySettings. - * @memberof google.api - * @interface IRubySettings - * @property {google.api.ICommonLanguageSettings|null} [common] RubySettings common - */ - - /** - * Constructs a new RubySettings. - * @memberof google.api - * @classdesc Represents a RubySettings. - * @implements IRubySettings - * @constructor - * @param {google.api.IRubySettings=} [properties] Properties to set - */ - function RubySettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * RubySettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.RubySettings - * @instance - */ - RubySettings.prototype.common = null; - - /** - * Creates a new RubySettings instance using the specified properties. - * @function create - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings=} [properties] Properties to set - * @returns {google.api.RubySettings} RubySettings instance - */ - RubySettings.create = function create(properties) { - return new RubySettings(properties); - }; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encode - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {google.api.IRubySettings} message RubySettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RubySettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RubySettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RubySettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RubySettings} RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RubySettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RubySettings message. - * @function verify - * @memberof google.api.RubySettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RubySettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); - if (error) - return "common." + error; - } - return null; - }; - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RubySettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.RubySettings} RubySettings - */ - RubySettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.RubySettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.RubySettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.RubySettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RubySettings - * @static - * @param {google.api.RubySettings} message RubySettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RubySettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - return object; - }; - - /** - * Converts this RubySettings to JSON. - * @function toJSON - * @memberof google.api.RubySettings - * @instance - * @returns {Object.} JSON object - */ - RubySettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RubySettings - * @function getTypeUrl - * @memberof google.api.RubySettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RubySettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RubySettings"; - }; - - return RubySettings; - })(); - - api.GoSettings = (function() { - - /** - * Properties of a GoSettings. - * @memberof google.api - * @interface IGoSettings - * @property {google.api.ICommonLanguageSettings|null} [common] GoSettings common - * @property {Object.|null} [renamedServices] GoSettings renamedServices - */ - - /** - * Constructs a new GoSettings. - * @memberof google.api - * @classdesc Represents a GoSettings. - * @implements IGoSettings - * @constructor - * @param {google.api.IGoSettings=} [properties] Properties to set - */ - function GoSettings(properties) { - this.renamedServices = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * GoSettings common. - * @member {google.api.ICommonLanguageSettings|null|undefined} common - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.common = null; - - /** - * GoSettings renamedServices. - * @member {Object.} renamedServices - * @memberof google.api.GoSettings - * @instance - */ - GoSettings.prototype.renamedServices = $util.emptyObject; - - /** - * Creates a new GoSettings instance using the specified properties. - * @function create - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings=} [properties] Properties to set - * @returns {google.api.GoSettings} GoSettings instance - */ - GoSettings.create = function create(properties) { - return new GoSettings(properties); - }; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encode - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.common != null && Object.hasOwnProperty.call(message, "common")) - $root.google.api.CommonLanguageSettings.encode(message.common, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.renamedServices != null && Object.hasOwnProperty.call(message, "renamedServices")) - for (var keys = Object.keys(message.renamedServices), i = 0; i < keys.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.renamedServices[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {google.api.IGoSettings} message GoSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GoSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.GoSettings(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.common = $root.google.api.CommonLanguageSettings.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - if (message.renamedServices === $util.emptyObject) - message.renamedServices = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.renamedServices, key); - message.renamedServices[key] = value; - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.GoSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.GoSettings} GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GoSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GoSettings message. - * @function verify - * @memberof google.api.GoSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GoSettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.common != null && message.hasOwnProperty("common")) { - var error = $root.google.api.CommonLanguageSettings.verify(message.common, long + 1); - if (error) - return "common." + error; - } - if (message.renamedServices != null && message.hasOwnProperty("renamedServices")) { - if (!$util.isObject(message.renamedServices)) - return "renamedServices: object expected"; - var key = Object.keys(message.renamedServices); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.renamedServices[key[i]])) - return "renamedServices: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.GoSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.GoSettings} GoSettings - */ - GoSettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.GoSettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.GoSettings(); - if (object.common != null) { - if (typeof object.common !== "object") - throw TypeError(".google.api.GoSettings.common: object expected"); - message.common = $root.google.api.CommonLanguageSettings.fromObject(object.common, long + 1); - } - if (object.renamedServices) { - if (typeof object.renamedServices !== "object") - throw TypeError(".google.api.GoSettings.renamedServices: object expected"); - message.renamedServices = {}; - for (var keys = Object.keys(object.renamedServices), i = 0; i < keys.length; ++i) { - if (keys[i] === "__proto__") - $util.makeProp(message.renamedServices, keys[i]); - message.renamedServices[keys[i]] = String(object.renamedServices[keys[i]]); - } - } - return message; - }; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.GoSettings - * @static - * @param {google.api.GoSettings} message GoSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GoSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.renamedServices = {}; - if (options.defaults) - object.common = null; - if (message.common != null && message.hasOwnProperty("common")) - object.common = $root.google.api.CommonLanguageSettings.toObject(message.common, options); - var keys2; - if (message.renamedServices && (keys2 = Object.keys(message.renamedServices)).length) { - object.renamedServices = {}; - for (var j = 0; j < keys2.length; ++j) { - if (keys2[j] === "__proto__") - $util.makeProp(object.renamedServices, keys2[j]); - object.renamedServices[keys2[j]] = message.renamedServices[keys2[j]]; - } - } - return object; - }; - - /** - * Converts this GoSettings to JSON. - * @function toJSON - * @memberof google.api.GoSettings - * @instance - * @returns {Object.} JSON object - */ - GoSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GoSettings - * @function getTypeUrl - * @memberof google.api.GoSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GoSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.GoSettings"; - }; - - return GoSettings; - })(); - - api.MethodSettings = (function() { - - /** - * Properties of a MethodSettings. - * @memberof google.api - * @interface IMethodSettings - * @property {string|null} [selector] MethodSettings selector - * @property {google.api.MethodSettings.ILongRunning|null} [longRunning] MethodSettings longRunning - * @property {Array.|null} [autoPopulatedFields] MethodSettings autoPopulatedFields - */ - - /** - * Constructs a new MethodSettings. - * @memberof google.api - * @classdesc Represents a MethodSettings. - * @implements IMethodSettings - * @constructor - * @param {google.api.IMethodSettings=} [properties] Properties to set - */ - function MethodSettings(properties) { - this.autoPopulatedFields = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodSettings selector. - * @member {string} selector - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.selector = ""; - - /** - * MethodSettings longRunning. - * @member {google.api.MethodSettings.ILongRunning|null|undefined} longRunning - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.longRunning = null; - - /** - * MethodSettings autoPopulatedFields. - * @member {Array.} autoPopulatedFields - * @memberof google.api.MethodSettings - * @instance - */ - MethodSettings.prototype.autoPopulatedFields = $util.emptyArray; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings=} [properties] Properties to set - * @returns {google.api.MethodSettings} MethodSettings instance - */ - MethodSettings.create = function create(properties) { - return new MethodSettings(properties); - }; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.longRunning != null && Object.hasOwnProperty.call(message, "longRunning")) - $root.google.api.MethodSettings.LongRunning.encode(message.longRunning, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.autoPopulatedFields != null && message.autoPopulatedFields.length) - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoPopulatedFields[i]); - return writer; - }; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {google.api.IMethodSettings} message MethodSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.selector = reader.string(); - break; - } - case 2: { - message.longRunning = $root.google.api.MethodSettings.LongRunning.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - if (!(message.autoPopulatedFields && message.autoPopulatedFields.length)) - message.autoPopulatedFields = []; - message.autoPopulatedFields.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings} MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodSettings message. - * @function verify - * @memberof google.api.MethodSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodSettings.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.selector != null && message.hasOwnProperty("selector")) - if (!$util.isString(message.selector)) - return "selector: string expected"; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) { - var error = $root.google.api.MethodSettings.LongRunning.verify(message.longRunning, long + 1); - if (error) - return "longRunning." + error; - } - if (message.autoPopulatedFields != null && message.hasOwnProperty("autoPopulatedFields")) { - if (!Array.isArray(message.autoPopulatedFields)) - return "autoPopulatedFields: array expected"; - for (var i = 0; i < message.autoPopulatedFields.length; ++i) - if (!$util.isString(message.autoPopulatedFields[i])) - return "autoPopulatedFields: string[] expected"; - } - return null; - }; - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings} MethodSettings - */ - MethodSettings.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.MethodSettings) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.MethodSettings(); - if (object.selector != null) - message.selector = String(object.selector); - if (object.longRunning != null) { - if (typeof object.longRunning !== "object") - throw TypeError(".google.api.MethodSettings.longRunning: object expected"); - message.longRunning = $root.google.api.MethodSettings.LongRunning.fromObject(object.longRunning, long + 1); - } - if (object.autoPopulatedFields) { - if (!Array.isArray(object.autoPopulatedFields)) - throw TypeError(".google.api.MethodSettings.autoPopulatedFields: array expected"); - message.autoPopulatedFields = []; - for (var i = 0; i < object.autoPopulatedFields.length; ++i) - message.autoPopulatedFields[i] = String(object.autoPopulatedFields[i]); - } - return message; - }; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings - * @static - * @param {google.api.MethodSettings} message MethodSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoPopulatedFields = []; - if (options.defaults) { - object.selector = ""; - object.longRunning = null; - } - if (message.selector != null && message.hasOwnProperty("selector")) - object.selector = message.selector; - if (message.longRunning != null && message.hasOwnProperty("longRunning")) - object.longRunning = $root.google.api.MethodSettings.LongRunning.toObject(message.longRunning, options); - if (message.autoPopulatedFields && message.autoPopulatedFields.length) { - object.autoPopulatedFields = []; - for (var j = 0; j < message.autoPopulatedFields.length; ++j) - object.autoPopulatedFields[j] = message.autoPopulatedFields[j]; - } - return object; - }; - - /** - * Converts this MethodSettings to JSON. - * @function toJSON - * @memberof google.api.MethodSettings - * @instance - * @returns {Object.} JSON object - */ - MethodSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodSettings - * @function getTypeUrl - * @memberof google.api.MethodSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings"; - }; - - MethodSettings.LongRunning = (function() { - - /** - * Properties of a LongRunning. - * @memberof google.api.MethodSettings - * @interface ILongRunning - * @property {google.protobuf.IDuration|null} [initialPollDelay] LongRunning initialPollDelay - * @property {number|null} [pollDelayMultiplier] LongRunning pollDelayMultiplier - * @property {google.protobuf.IDuration|null} [maxPollDelay] LongRunning maxPollDelay - * @property {google.protobuf.IDuration|null} [totalPollTimeout] LongRunning totalPollTimeout - */ - - /** - * Constructs a new LongRunning. - * @memberof google.api.MethodSettings - * @classdesc Represents a LongRunning. - * @implements ILongRunning - * @constructor - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - */ - function LongRunning(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * LongRunning initialPollDelay. - * @member {google.protobuf.IDuration|null|undefined} initialPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.initialPollDelay = null; - - /** - * LongRunning pollDelayMultiplier. - * @member {number} pollDelayMultiplier - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.pollDelayMultiplier = 0; - - /** - * LongRunning maxPollDelay. - * @member {google.protobuf.IDuration|null|undefined} maxPollDelay - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.maxPollDelay = null; - - /** - * LongRunning totalPollTimeout. - * @member {google.protobuf.IDuration|null|undefined} totalPollTimeout - * @memberof google.api.MethodSettings.LongRunning - * @instance - */ - LongRunning.prototype.totalPollTimeout = null; - - /** - * Creates a new LongRunning instance using the specified properties. - * @function create - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning=} [properties] Properties to set - * @returns {google.api.MethodSettings.LongRunning} LongRunning instance - */ - LongRunning.create = function create(properties) { - return new LongRunning(properties); - }; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initialPollDelay != null && Object.hasOwnProperty.call(message, "initialPollDelay")) - $root.google.protobuf.Duration.encode(message.initialPollDelay, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.pollDelayMultiplier != null && Object.hasOwnProperty.call(message, "pollDelayMultiplier")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.pollDelayMultiplier); - if (message.maxPollDelay != null && Object.hasOwnProperty.call(message, "maxPollDelay")) - $root.google.protobuf.Duration.encode(message.maxPollDelay, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.totalPollTimeout != null && Object.hasOwnProperty.call(message, "totalPollTimeout")) - $root.google.protobuf.Duration.encode(message.totalPollTimeout, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.ILongRunning} message LongRunning message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LongRunning.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @function decode - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.MethodSettings.LongRunning(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initialPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 2: { - message.pollDelayMultiplier = reader.float(); - break; - } - case 3: { - message.maxPollDelay = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - message.totalPollTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.MethodSettings.LongRunning} LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LongRunning.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LongRunning message. - * @function verify - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LongRunning.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.initialPollDelay, long + 1); - if (error) - return "initialPollDelay." + error; - } - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - if (typeof message.pollDelayMultiplier !== "number") - return "pollDelayMultiplier: number expected"; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) { - var error = $root.google.protobuf.Duration.verify(message.maxPollDelay, long + 1); - if (error) - return "maxPollDelay." + error; - } - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.totalPollTimeout, long + 1); - if (error) - return "totalPollTimeout." + error; - } - return null; - }; - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {Object.} object Plain object - * @returns {google.api.MethodSettings.LongRunning} LongRunning - */ - LongRunning.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.MethodSettings.LongRunning) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.MethodSettings.LongRunning(); - if (object.initialPollDelay != null) { - if (typeof object.initialPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.initialPollDelay: object expected"); - message.initialPollDelay = $root.google.protobuf.Duration.fromObject(object.initialPollDelay, long + 1); - } - if (object.pollDelayMultiplier != null) - message.pollDelayMultiplier = Number(object.pollDelayMultiplier); - if (object.maxPollDelay != null) { - if (typeof object.maxPollDelay !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.maxPollDelay: object expected"); - message.maxPollDelay = $root.google.protobuf.Duration.fromObject(object.maxPollDelay, long + 1); - } - if (object.totalPollTimeout != null) { - if (typeof object.totalPollTimeout !== "object") - throw TypeError(".google.api.MethodSettings.LongRunning.totalPollTimeout: object expected"); - message.totalPollTimeout = $root.google.protobuf.Duration.fromObject(object.totalPollTimeout, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {google.api.MethodSettings.LongRunning} message LongRunning - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LongRunning.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.initialPollDelay = null; - object.pollDelayMultiplier = 0; - object.maxPollDelay = null; - object.totalPollTimeout = null; - } - if (message.initialPollDelay != null && message.hasOwnProperty("initialPollDelay")) - object.initialPollDelay = $root.google.protobuf.Duration.toObject(message.initialPollDelay, options); - if (message.pollDelayMultiplier != null && message.hasOwnProperty("pollDelayMultiplier")) - object.pollDelayMultiplier = options.json && !isFinite(message.pollDelayMultiplier) ? String(message.pollDelayMultiplier) : message.pollDelayMultiplier; - if (message.maxPollDelay != null && message.hasOwnProperty("maxPollDelay")) - object.maxPollDelay = $root.google.protobuf.Duration.toObject(message.maxPollDelay, options); - if (message.totalPollTimeout != null && message.hasOwnProperty("totalPollTimeout")) - object.totalPollTimeout = $root.google.protobuf.Duration.toObject(message.totalPollTimeout, options); - return object; - }; - - /** - * Converts this LongRunning to JSON. - * @function toJSON - * @memberof google.api.MethodSettings.LongRunning - * @instance - * @returns {Object.} JSON object - */ - LongRunning.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LongRunning - * @function getTypeUrl - * @memberof google.api.MethodSettings.LongRunning - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LongRunning.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.MethodSettings.LongRunning"; - }; - - return LongRunning; - })(); - - return MethodSettings; - })(); - - /** - * ClientLibraryOrganization enum. - * @name google.api.ClientLibraryOrganization - * @enum {number} - * @property {number} CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED=0 CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} ADS=2 ADS value - * @property {number} PHOTOS=3 PHOTOS value - * @property {number} STREET_VIEW=4 STREET_VIEW value - * @property {number} SHOPPING=5 SHOPPING value - * @property {number} GEO=6 GEO value - * @property {number} GENERATIVE_AI=7 GENERATIVE_AI value - */ - api.ClientLibraryOrganization = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "ADS"] = 2; - values[valuesById[3] = "PHOTOS"] = 3; - values[valuesById[4] = "STREET_VIEW"] = 4; - values[valuesById[5] = "SHOPPING"] = 5; - values[valuesById[6] = "GEO"] = 6; - values[valuesById[7] = "GENERATIVE_AI"] = 7; - return values; - })(); - - /** - * ClientLibraryDestination enum. - * @name google.api.ClientLibraryDestination - * @enum {number} - * @property {number} CLIENT_LIBRARY_DESTINATION_UNSPECIFIED=0 CLIENT_LIBRARY_DESTINATION_UNSPECIFIED value - * @property {number} GITHUB=10 GITHUB value - * @property {number} PACKAGE_MANAGER=20 PACKAGE_MANAGER value - */ - api.ClientLibraryDestination = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED"] = 0; - values[valuesById[10] = "GITHUB"] = 10; - values[valuesById[20] = "PACKAGE_MANAGER"] = 20; - return values; - })(); - - api.SelectiveGapicGeneration = (function() { - - /** - * Properties of a SelectiveGapicGeneration. - * @memberof google.api - * @interface ISelectiveGapicGeneration - * @property {Array.|null} [methods] SelectiveGapicGeneration methods - * @property {boolean|null} [generateOmittedAsInternal] SelectiveGapicGeneration generateOmittedAsInternal - */ - - /** - * Constructs a new SelectiveGapicGeneration. - * @memberof google.api - * @classdesc Represents a SelectiveGapicGeneration. - * @implements ISelectiveGapicGeneration - * @constructor - * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set - */ - function SelectiveGapicGeneration(properties) { - this.methods = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * SelectiveGapicGeneration methods. - * @member {Array.} methods - * @memberof google.api.SelectiveGapicGeneration - * @instance - */ - SelectiveGapicGeneration.prototype.methods = $util.emptyArray; - - /** - * SelectiveGapicGeneration generateOmittedAsInternal. - * @member {boolean} generateOmittedAsInternal - * @memberof google.api.SelectiveGapicGeneration - * @instance - */ - SelectiveGapicGeneration.prototype.generateOmittedAsInternal = false; - - /** - * Creates a new SelectiveGapicGeneration instance using the specified properties. - * @function create - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {google.api.ISelectiveGapicGeneration=} [properties] Properties to set - * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration instance - */ - SelectiveGapicGeneration.create = function create(properties) { - return new SelectiveGapicGeneration(properties); - }; - - /** - * Encodes the specified SelectiveGapicGeneration message. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. - * @function encode - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectiveGapicGeneration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.methods != null && message.methods.length) - for (var i = 0; i < message.methods.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.methods[i]); - if (message.generateOmittedAsInternal != null && Object.hasOwnProperty.call(message, "generateOmittedAsInternal")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.generateOmittedAsInternal); - return writer; - }; - - /** - * Encodes the specified SelectiveGapicGeneration message, length delimited. Does not implicitly {@link google.api.SelectiveGapicGeneration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {google.api.ISelectiveGapicGeneration} message SelectiveGapicGeneration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectiveGapicGeneration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SelectiveGapicGeneration message from the specified reader or buffer. - * @function decode - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectiveGapicGeneration.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.SelectiveGapicGeneration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.methods && message.methods.length)) - message.methods = []; - message.methods.push(reader.string()); - break; - } - case 2: { - message.generateOmittedAsInternal = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a SelectiveGapicGeneration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectiveGapicGeneration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SelectiveGapicGeneration message. - * @function verify - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SelectiveGapicGeneration.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.methods != null && message.hasOwnProperty("methods")) { - if (!Array.isArray(message.methods)) - return "methods: array expected"; - for (var i = 0; i < message.methods.length; ++i) - if (!$util.isString(message.methods[i])) - return "methods: string[] expected"; - } - if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) - if (typeof message.generateOmittedAsInternal !== "boolean") - return "generateOmittedAsInternal: boolean expected"; - return null; - }; - - /** - * Creates a SelectiveGapicGeneration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {Object.} object Plain object - * @returns {google.api.SelectiveGapicGeneration} SelectiveGapicGeneration - */ - SelectiveGapicGeneration.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.SelectiveGapicGeneration) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.SelectiveGapicGeneration(); - if (object.methods) { - if (!Array.isArray(object.methods)) - throw TypeError(".google.api.SelectiveGapicGeneration.methods: array expected"); - message.methods = []; - for (var i = 0; i < object.methods.length; ++i) - message.methods[i] = String(object.methods[i]); - } - if (object.generateOmittedAsInternal != null) - message.generateOmittedAsInternal = Boolean(object.generateOmittedAsInternal); - return message; - }; - - /** - * Creates a plain object from a SelectiveGapicGeneration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {google.api.SelectiveGapicGeneration} message SelectiveGapicGeneration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SelectiveGapicGeneration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.methods = []; - if (options.defaults) - object.generateOmittedAsInternal = false; - if (message.methods && message.methods.length) { - object.methods = []; - for (var j = 0; j < message.methods.length; ++j) - object.methods[j] = message.methods[j]; - } - if (message.generateOmittedAsInternal != null && message.hasOwnProperty("generateOmittedAsInternal")) - object.generateOmittedAsInternal = message.generateOmittedAsInternal; - return object; - }; - - /** - * Converts this SelectiveGapicGeneration to JSON. - * @function toJSON - * @memberof google.api.SelectiveGapicGeneration - * @instance - * @returns {Object.} JSON object - */ - SelectiveGapicGeneration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SelectiveGapicGeneration - * @function getTypeUrl - * @memberof google.api.SelectiveGapicGeneration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SelectiveGapicGeneration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.SelectiveGapicGeneration"; - }; - - return SelectiveGapicGeneration; - })(); - - /** - * LaunchStage enum. - * @name google.api.LaunchStage - * @enum {number} - * @property {number} LAUNCH_STAGE_UNSPECIFIED=0 LAUNCH_STAGE_UNSPECIFIED value - * @property {number} UNIMPLEMENTED=6 UNIMPLEMENTED value - * @property {number} PRELAUNCH=7 PRELAUNCH value - * @property {number} EARLY_ACCESS=1 EARLY_ACCESS value - * @property {number} ALPHA=2 ALPHA value - * @property {number} BETA=3 BETA value - * @property {number} GA=4 GA value - * @property {number} DEPRECATED=5 DEPRECATED value - */ - api.LaunchStage = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAUNCH_STAGE_UNSPECIFIED"] = 0; - values[valuesById[6] = "UNIMPLEMENTED"] = 6; - values[valuesById[7] = "PRELAUNCH"] = 7; - values[valuesById[1] = "EARLY_ACCESS"] = 1; - values[valuesById[2] = "ALPHA"] = 2; - values[valuesById[3] = "BETA"] = 3; - values[valuesById[4] = "GA"] = 4; - values[valuesById[5] = "DEPRECATED"] = 5; - return values; - })(); - - /** - * FieldBehavior enum. - * @name google.api.FieldBehavior - * @enum {number} - * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value - * @property {number} OPTIONAL=1 OPTIONAL value - * @property {number} REQUIRED=2 REQUIRED value - * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value - * @property {number} INPUT_ONLY=4 INPUT_ONLY value - * @property {number} IMMUTABLE=5 IMMUTABLE value - * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value - * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value - * @property {number} IDENTIFIER=8 IDENTIFIER value - */ - api.FieldBehavior = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "OPTIONAL"] = 1; - values[valuesById[2] = "REQUIRED"] = 2; - values[valuesById[3] = "OUTPUT_ONLY"] = 3; - values[valuesById[4] = "INPUT_ONLY"] = 4; - values[valuesById[5] = "IMMUTABLE"] = 5; - values[valuesById[6] = "UNORDERED_LIST"] = 6; - values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; - values[valuesById[8] = "IDENTIFIER"] = 8; - return values; - })(); - - api.RoutingRule = (function() { - - /** - * Properties of a RoutingRule. - * @memberof google.api - * @interface IRoutingRule - * @property {Array.|null} [routingParameters] RoutingRule routingParameters - */ - - /** - * Constructs a new RoutingRule. - * @memberof google.api - * @classdesc Represents a RoutingRule. - * @implements IRoutingRule - * @constructor - * @param {google.api.IRoutingRule=} [properties] Properties to set - */ - function RoutingRule(properties) { - this.routingParameters = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingRule routingParameters. - * @member {Array.} routingParameters - * @memberof google.api.RoutingRule - * @instance - */ - RoutingRule.prototype.routingParameters = $util.emptyArray; - - /** - * Creates a new RoutingRule instance using the specified properties. - * @function create - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule=} [properties] Properties to set - * @returns {google.api.RoutingRule} RoutingRule instance - */ - RoutingRule.create = function create(properties) { - return new RoutingRule(properties); - }; - - /** - * Encodes the specified RoutingRule message. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @function encode - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.routingParameters != null && message.routingParameters.length) - for (var i = 0; i < message.routingParameters.length; ++i) - $root.google.api.RoutingParameter.encode(message.routingParameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RoutingRule message, length delimited. Does not implicitly {@link google.api.RoutingRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RoutingRule - * @static - * @param {google.api.IRoutingRule} message RoutingRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingRule message from the specified reader or buffer. - * @function decode - * @memberof google.api.RoutingRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RoutingRule} RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingRule.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.routingParameters && message.routingParameters.length)) - message.routingParameters = []; - message.routingParameters.push($root.google.api.RoutingParameter.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RoutingRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RoutingRule} RoutingRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingRule message. - * @function verify - * @memberof google.api.RoutingRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingRule.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { - if (!Array.isArray(message.routingParameters)) - return "routingParameters: array expected"; - for (var i = 0; i < message.routingParameters.length; ++i) { - var error = $root.google.api.RoutingParameter.verify(message.routingParameters[i], long + 1); - if (error) - return "routingParameters." + error; - } - } - return null; - }; - - /** - * Creates a RoutingRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RoutingRule - * @static - * @param {Object.} object Plain object - * @returns {google.api.RoutingRule} RoutingRule - */ - RoutingRule.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.RoutingRule) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.RoutingRule(); - if (object.routingParameters) { - if (!Array.isArray(object.routingParameters)) - throw TypeError(".google.api.RoutingRule.routingParameters: array expected"); - message.routingParameters = []; - for (var i = 0; i < object.routingParameters.length; ++i) { - if (typeof object.routingParameters[i] !== "object") - throw TypeError(".google.api.RoutingRule.routingParameters: object expected"); - message.routingParameters[i] = $root.google.api.RoutingParameter.fromObject(object.routingParameters[i], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a RoutingRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RoutingRule - * @static - * @param {google.api.RoutingRule} message RoutingRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.routingParameters = []; - if (message.routingParameters && message.routingParameters.length) { - object.routingParameters = []; - for (var j = 0; j < message.routingParameters.length; ++j) - object.routingParameters[j] = $root.google.api.RoutingParameter.toObject(message.routingParameters[j], options); - } - return object; - }; - - /** - * Converts this RoutingRule to JSON. - * @function toJSON - * @memberof google.api.RoutingRule - * @instance - * @returns {Object.} JSON object - */ - RoutingRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingRule - * @function getTypeUrl - * @memberof google.api.RoutingRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RoutingRule"; - }; - - return RoutingRule; - })(); - - api.RoutingParameter = (function() { - - /** - * Properties of a RoutingParameter. - * @memberof google.api - * @interface IRoutingParameter - * @property {string|null} [field] RoutingParameter field - * @property {string|null} [pathTemplate] RoutingParameter pathTemplate - */ - - /** - * Constructs a new RoutingParameter. - * @memberof google.api - * @classdesc Represents a RoutingParameter. - * @implements IRoutingParameter - * @constructor - * @param {google.api.IRoutingParameter=} [properties] Properties to set - */ - function RoutingParameter(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * RoutingParameter field. - * @member {string} field - * @memberof google.api.RoutingParameter - * @instance - */ - RoutingParameter.prototype.field = ""; - - /** - * RoutingParameter pathTemplate. - * @member {string} pathTemplate - * @memberof google.api.RoutingParameter - * @instance - */ - RoutingParameter.prototype.pathTemplate = ""; - - /** - * Creates a new RoutingParameter instance using the specified properties. - * @function create - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter=} [properties] Properties to set - * @returns {google.api.RoutingParameter} RoutingParameter instance - */ - RoutingParameter.create = function create(properties) { - return new RoutingParameter(properties); - }; - - /** - * Encodes the specified RoutingParameter message. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @function encode - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingParameter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.field != null && Object.hasOwnProperty.call(message, "field")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.field); - if (message.pathTemplate != null && Object.hasOwnProperty.call(message, "pathTemplate")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pathTemplate); - return writer; - }; - - /** - * Encodes the specified RoutingParameter message, length delimited. Does not implicitly {@link google.api.RoutingParameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.IRoutingParameter} message RoutingParameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RoutingParameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer. - * @function decode - * @memberof google.api.RoutingParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.RoutingParameter} RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingParameter.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.RoutingParameter(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.field = reader.string(); - break; - } - case 2: { - message.pathTemplate = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a RoutingParameter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.RoutingParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.RoutingParameter} RoutingParameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RoutingParameter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RoutingParameter message. - * @function verify - * @memberof google.api.RoutingParameter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RoutingParameter.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.field != null && message.hasOwnProperty("field")) - if (!$util.isString(message.field)) - return "field: string expected"; - if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) - if (!$util.isString(message.pathTemplate)) - return "pathTemplate: string expected"; - return null; - }; - - /** - * Creates a RoutingParameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.RoutingParameter - * @static - * @param {Object.} object Plain object - * @returns {google.api.RoutingParameter} RoutingParameter - */ - RoutingParameter.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.api.RoutingParameter) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.api.RoutingParameter(); - if (object.field != null) - message.field = String(object.field); - if (object.pathTemplate != null) - message.pathTemplate = String(object.pathTemplate); - return message; - }; - - /** - * Creates a plain object from a RoutingParameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.RoutingParameter - * @static - * @param {google.api.RoutingParameter} message RoutingParameter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RoutingParameter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.field = ""; - object.pathTemplate = ""; - } - if (message.field != null && message.hasOwnProperty("field")) - object.field = message.field; - if (message.pathTemplate != null && message.hasOwnProperty("pathTemplate")) - object.pathTemplate = message.pathTemplate; - return object; - }; - - /** - * Converts this RoutingParameter to JSON. - * @function toJSON - * @memberof google.api.RoutingParameter - * @instance - * @returns {Object.} JSON object - */ - RoutingParameter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RoutingParameter - * @function getTypeUrl - * @memberof google.api.RoutingParameter - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RoutingParameter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.RoutingParameter"; - }; - - return RoutingParameter; - })(); - - return api; - })(); - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorSet - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; - }; - - return FileDescriptorSet; - })(); - - /** - * Edition enum. - * @name google.protobuf.Edition - * @enum {number} - * @property {number} EDITION_UNKNOWN=0 EDITION_UNKNOWN value - * @property {number} EDITION_LEGACY=900 EDITION_LEGACY value - * @property {number} EDITION_PROTO2=998 EDITION_PROTO2 value - * @property {number} EDITION_PROTO3=999 EDITION_PROTO3 value - * @property {number} EDITION_2023=1000 EDITION_2023 value - * @property {number} EDITION_2024=1001 EDITION_2024 value - * @property {number} EDITION_1_TEST_ONLY=1 EDITION_1_TEST_ONLY value - * @property {number} EDITION_2_TEST_ONLY=2 EDITION_2_TEST_ONLY value - * @property {number} EDITION_99997_TEST_ONLY=99997 EDITION_99997_TEST_ONLY value - * @property {number} EDITION_99998_TEST_ONLY=99998 EDITION_99998_TEST_ONLY value - * @property {number} EDITION_99999_TEST_ONLY=99999 EDITION_99999_TEST_ONLY value - * @property {number} EDITION_MAX=2147483647 EDITION_MAX value - */ - protobuf.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNKNOWN"] = 0; - values[valuesById[900] = "EDITION_LEGACY"] = 900; - values[valuesById[998] = "EDITION_PROTO2"] = 998; - values[valuesById[999] = "EDITION_PROTO3"] = 999; - values[valuesById[1000] = "EDITION_2023"] = 1000; - values[valuesById[1001] = "EDITION_2024"] = 1001; - values[valuesById[1] = "EDITION_1_TEST_ONLY"] = 1; - values[valuesById[2] = "EDITION_2_TEST_ONLY"] = 2; - values[valuesById[99997] = "EDITION_99997_TEST_ONLY"] = 99997; - values[valuesById[99998] = "EDITION_99998_TEST_ONLY"] = 99998; - values[valuesById[99999] = "EDITION_99999_TEST_ONLY"] = 99999; - values[valuesById[2147483647] = "EDITION_MAX"] = 2147483647; - return values; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [optionDependency] FileDescriptorProto optionDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - * @property {google.protobuf.Edition|null} [edition] FileDescriptorProto edition - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.optionDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto optionDependency. - * @member {Array.} optionDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.optionDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * FileDescriptorProto edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.edition = 0; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.edition); - if (message.optionDependency != null && message.optionDependency.length) - for (var i = 0; i < message.optionDependency.length; ++i) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.optionDependency[i]); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message["package"] = reader.string(); - break; - } - case 3: { - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - } - case 10: { - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - } - case 11: { - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - } - case 15: { - if (!(message.optionDependency && message.optionDependency.length)) - message.optionDependency = []; - message.optionDependency.push(reader.string()); - break; - } - case 4: { - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 5: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 6: { - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 7: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 8: { - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 9: { - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 12: { - message.syntax = reader.string(); - break; - } - case 14: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.optionDependency != null && message.hasOwnProperty("optionDependency")) { - if (!Array.isArray(message.optionDependency)) - return "optionDependency: array expected"; - for (var i = 0; i < message.optionDependency.length; ++i) - if (!$util.isString(message.optionDependency[i])) - return "optionDependency: string[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i], long + 1); - 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], long + 1); - 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], long + 1); - 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], long + 1); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options, long + 1); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo, long + 1); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.optionDependency) { - if (!Array.isArray(object.optionDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.optionDependency: array expected"); - message.optionDependency = []; - for (var i = 0; i < object.optionDependency.length; ++i) - message.optionDependency[i] = String(object.optionDependency[i]); - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i], long + 1); - } - } - 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], long + 1); - } - } - 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], long + 1); - } - } - 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], long + 1); - } - } - 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, long + 1); - } - 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, long + 1); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.edition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - object.optionDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - if (message.optionDependency && message.optionDependency.length) { - object.optionDependency = []; - for (var j = 0; j < message.optionDependency.length; ++j) - object.optionDependency[j] = message.optionDependency[j]; - } - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - * @property {google.protobuf.SymbolVisibility|null} [visibility] DescriptorProto visibility - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * DescriptorProto visibility. - * @member {google.protobuf.SymbolVisibility} visibility - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.visibility = 0; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.visibility); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 6: { - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 3: { - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 4: { - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 5: { - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 8: { - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 7: { - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 9: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 10: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - case 11: { - message.visibility = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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], long + 1); - 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], long + 1); - 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], long + 1); - 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], long + 1); - 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], long + 1); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options, long + 1); - 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], long + 1); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - if (message.visibility != null && message.hasOwnProperty("visibility")) - switch (message.visibility) { - default: - return "visibility: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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], long + 1); - } - } - 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], long + 1); - } - } - 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], long + 1); - } - } - 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], long + 1); - } - } - 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], long + 1); - } - } - 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, long + 1); - } - 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], long + 1); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - switch (object.visibility) { - default: - if (typeof object.visibility === "number") { - message.visibility = object.visibility; - break; - } - break; - case "VISIBILITY_UNSET": - case 0: - message.visibility = 0; - break; - case "VISIBILITY_LOCAL": - case 1: - message.visibility = 1; - break; - case "VISIBILITY_EXPORT": - case 2: - message.visibility = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - if (message.visibility != null && message.hasOwnProperty("visibility")) - object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto"; - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ReservedRange - * @function getTypeUrl - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - * @property {Array.|null} [declaration] ExtensionRangeOptions declaration - * @property {google.protobuf.IFeatureSet|null} [features] ExtensionRangeOptions features - * @property {google.protobuf.ExtensionRangeOptions.VerificationState|null} [verification] ExtensionRangeOptions verification - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - this.declaration = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ExtensionRangeOptions declaration. - * @member {Array.} declaration - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.declaration = $util.emptyArray; - - /** - * ExtensionRangeOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.features = null; - - /** - * ExtensionRangeOptions verification. - * @member {google.protobuf.ExtensionRangeOptions.VerificationState} verification - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.verification = 1; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.declaration != null && message.declaration.length) - for (var i = 0; i < message.declaration.length; ++i) - $root.google.protobuf.ExtensionRangeOptions.Declaration.encode(message.declaration[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.verification != null && Object.hasOwnProperty.call(message, "verification")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.verification); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 2: { - if (!(message.declaration && message.declaration.length)) - message.declaration = []; - message.declaration.push($root.google.protobuf.ExtensionRangeOptions.Declaration.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.verification = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - if (error) - return "uninterpretedOption." + error; - } - } - if (message.declaration != null && message.hasOwnProperty("declaration")) { - if (!Array.isArray(message.declaration)) - return "declaration: array expected"; - for (var i = 0; i < message.declaration.length; ++i) { - var error = $root.google.protobuf.ExtensionRangeOptions.Declaration.verify(message.declaration[i], long + 1); - if (error) - return "declaration." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); - if (error) - return "features." + error; - } - if (message.verification != null && message.hasOwnProperty("verification")) - switch (message.verification) { - default: - return "verification: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - if (object.declaration) { - if (!Array.isArray(object.declaration)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: array expected"); - message.declaration = []; - for (var i = 0; i < object.declaration.length; ++i) { - if (typeof object.declaration[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.declaration: object expected"); - message.declaration[i] = $root.google.protobuf.ExtensionRangeOptions.Declaration.fromObject(object.declaration[i], long + 1); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); - } - switch (object.verification) { - case "DECLARATION": - case 0: - message.verification = 0; - break; - default: - if (typeof object.verification === "number") { - message.verification = object.verification; - break; - } - break; - case "UNVERIFIED": - case 1: - message.verification = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.declaration = []; - object.uninterpretedOption = []; - } - if (options.defaults) { - object.verification = options.enums === String ? "UNVERIFIED" : 1; - object.features = null; - } - if (message.declaration && message.declaration.length) { - object.declaration = []; - for (var j = 0; j < message.declaration.length; ++j) - object.declaration[j] = $root.google.protobuf.ExtensionRangeOptions.Declaration.toObject(message.declaration[j], options); - } - if (message.verification != null && message.hasOwnProperty("verification")) - object.verification = options.enums === String ? $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] === undefined ? message.verification : $root.google.protobuf.ExtensionRangeOptions.VerificationState[message.verification] : message.verification; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; - }; - - ExtensionRangeOptions.Declaration = (function() { - - /** - * Properties of a Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @interface IDeclaration - * @property {number|null} [number] Declaration number - * @property {string|null} [fullName] Declaration fullName - * @property {string|null} [type] Declaration type - * @property {boolean|null} [reserved] Declaration reserved - * @property {boolean|null} [repeated] Declaration repeated - */ - - /** - * Constructs a new Declaration. - * @memberof google.protobuf.ExtensionRangeOptions - * @classdesc Represents a Declaration. - * @implements IDeclaration - * @constructor - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - */ - function Declaration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Declaration number. - * @member {number} number - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.number = 0; - - /** - * Declaration fullName. - * @member {string} fullName - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.fullName = ""; - - /** - * Declaration type. - * @member {string} type - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.type = ""; - - /** - * Declaration reserved. - * @member {boolean} reserved - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.reserved = false; - - /** - * Declaration repeated. - * @member {boolean} repeated - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - */ - Declaration.prototype.repeated = false; - - /** - * Creates a new Declaration instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration instance - */ - Declaration.create = function create(properties) { - return new Declaration(properties); - }; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.number); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.fullName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.reserved != null && Object.hasOwnProperty.call(message, "reserved")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reserved); - if (message.repeated != null && Object.hasOwnProperty.call(message, "repeated")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.repeated); - return writer; - }; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.IDeclaration} message Declaration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Declaration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.number = reader.int32(); - break; - } - case 2: { - message.fullName = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 5: { - message.reserved = reader.bool(); - break; - } - case 6: { - message.repeated = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Declaration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Declaration message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Declaration.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.reserved != null && message.hasOwnProperty("reserved")) - if (typeof message.reserved !== "boolean") - return "reserved: boolean expected"; - if (message.repeated != null && message.hasOwnProperty("repeated")) - if (typeof message.repeated !== "boolean") - return "repeated: boolean expected"; - return null; - }; - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions.Declaration} Declaration - */ - Declaration.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions.Declaration) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.ExtensionRangeOptions.Declaration(); - if (object.number != null) - message.number = object.number | 0; - if (object.fullName != null) - message.fullName = String(object.fullName); - if (object.type != null) - message.type = String(object.type); - if (object.reserved != null) - message.reserved = Boolean(object.reserved); - if (object.repeated != null) - message.repeated = Boolean(object.repeated); - return message; - }; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {google.protobuf.ExtensionRangeOptions.Declaration} message Declaration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Declaration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.number = 0; - object.fullName = ""; - object.type = ""; - object.reserved = false; - object.repeated = false; - } - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.reserved != null && message.hasOwnProperty("reserved")) - object.reserved = message.reserved; - if (message.repeated != null && message.hasOwnProperty("repeated")) - object.repeated = message.repeated; - return object; - }; - - /** - * Converts this Declaration to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @instance - * @returns {Object.} JSON object - */ - Declaration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Declaration - * @function getTypeUrl - * @memberof google.protobuf.ExtensionRangeOptions.Declaration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Declaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions.Declaration"; - }; - - return Declaration; - })(); - - /** - * VerificationState enum. - * @name google.protobuf.ExtensionRangeOptions.VerificationState - * @enum {number} - * @property {number} DECLARATION=0 DECLARATION value - * @property {number} UNVERIFIED=1 UNVERIFIED value - */ - ExtensionRangeOptions.VerificationState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DECLARATION"] = 0; - values[valuesById[1] = "UNVERIFIED"] = 1; - return values; - })(); - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.number = reader.int32(); - break; - } - case 4: { - message.label = reader.int32(); - break; - } - case 5: { - message.type = reader.int32(); - break; - } - case 6: { - message.typeName = reader.string(); - break; - } - case 2: { - message.extendee = reader.string(); - break; - } - case 7: { - message.defaultValue = reader.string(); - break; - } - case 9: { - message.oneofIndex = reader.int32(); - break; - } - case 10: { - message.jsonName = reader.string(); - break; - } - case 8: { - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 17: { - message.proto3Optional = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 3: - case 2: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options, long + 1); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - default: - if (typeof object.label === "number") { - message.label = object.label; - break; - } - break; - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options, long + 1); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - 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, long) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - * @property {google.protobuf.SymbolVisibility|null} [visibility] EnumDescriptorProto visibility - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * EnumDescriptorProto visibility. - * @member {google.protobuf.SymbolVisibility} visibility - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.visibility = 0; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - if (message.visibility != null && Object.hasOwnProperty.call(message, "visibility")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.visibility); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 4: { - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 5: { - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - } - case 6: { - message.visibility = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options, long + 1); - 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], long + 1); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - if (message.visibility != null && message.hasOwnProperty("visibility")) - switch (message.visibility) { - default: - return "visibility: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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, long + 1); - } - 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], long + 1); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - switch (object.visibility) { - default: - if (typeof object.visibility === "number") { - message.visibility = object.visibility; - break; - } - break; - case "VISIBILITY_UNSET": - case 0: - message.visibility = 0; - break; - case "VISIBILITY_LOCAL": - case 1: - message.visibility = 1; - break; - case "VISIBILITY_EXPORT": - case 2: - message.visibility = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - object.visibility = options.enums === String ? "VISIBILITY_UNSET" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - if (message.visibility != null && message.hasOwnProperty("visibility")) - object.visibility = options.enums === String ? $root.google.protobuf.SymbolVisibility[message.visibility] === undefined ? message.visibility : $root.google.protobuf.SymbolVisibility[message.visibility] : message.visibility; - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.start = reader.int32(); - break; - } - case 2: { - message.end = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumReservedRange - * @function getTypeUrl - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.number = reader.int32(); - break; - } - case 3: { - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 3: { - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options, long + 1); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - 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, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.inputType = reader.string(); - break; - } - case 3: { - message.outputType = reader.string(); - break; - } - case 4: { - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.clientStreaming = reader.bool(); - break; - } - case 6: { - message.serverStreaming = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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, long + 1); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodDescriptorProto - * @function getTypeUrl - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {google.protobuf.IFeatureSet|null} [features] FileOptions features - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.features = null; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 50, wireType 2 =*/402).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.javaPackage = reader.string(); - break; - } - case 8: { - message.javaOuterClassname = reader.string(); - break; - } - case 10: { - message.javaMultipleFiles = reader.bool(); - break; - } - case 20: { - message.javaGenerateEqualsAndHash = reader.bool(); - break; - } - case 27: { - message.javaStringCheckUtf8 = reader.bool(); - break; - } - case 9: { - message.optimizeFor = reader.int32(); - break; - } - case 11: { - message.goPackage = reader.string(); - break; - } - case 16: { - message.ccGenericServices = reader.bool(); - break; - } - case 17: { - message.javaGenericServices = reader.bool(); - break; - } - case 18: { - message.pyGenericServices = reader.bool(); - break; - } - case 23: { - message.deprecated = reader.bool(); - break; - } - case 31: { - message.ccEnableArenas = reader.bool(); - break; - } - case 36: { - message.objcClassPrefix = reader.string(); - break; - } - case 37: { - message.csharpNamespace = reader.string(); - break; - } - case 39: { - message.swiftPrefix = reader.string(); - break; - } - case 40: { - message.phpClassPrefix = reader.string(); - break; - } - case 41: { - message.phpNamespace = reader.string(); - break; - } - case 44: { - message.phpMetadataNamespace = reader.string(); - break; - } - case 45: { - message.rubyPackage = reader.string(); - break; - } - case 50: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); - if (error) - return "uninterpretedOption." + 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, long) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - default: - if (typeof object.optimizeFor === "number") { - message.optimizeFor = object.optimizeFor; - break; - } - break; - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FileOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); - } - 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], long + 1); - } - } - 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.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object.features = null; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FileOptions - * @function getTypeUrl - * @memberof google.protobuf.FileOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FileOptions"; - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] MessageOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] MessageOptions features - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * MessageOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.features = null; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.messageSetWireFormat = reader.bool(); - break; - } - case 2: { - message.noStandardDescriptorAccessor = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 7: { - message.mapEntry = reader.bool(); - break; - } - case 11: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 12: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); - if (error) - return "uninterpretedOption." + 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, long) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MessageOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); - } - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MessageOptions - * @function getTypeUrl - * @memberof google.protobuf.MessageOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MessageOptions"; - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {boolean|null} [debugRedact] FieldOptions debugRedact - * @property {google.protobuf.FieldOptions.OptionRetention|null} [retention] FieldOptions retention - * @property {Array.|null} [targets] FieldOptions targets - * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults - * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features - * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] FieldOptions featureSupport - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions featureSupport. - * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.featureSupport = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) - $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ctype = reader.int32(); - break; - } - case 2: { - message.packed = reader.bool(); - break; - } - case 6: { - message.jstype = reader.int32(); - break; - } - case 5: { - message.lazy = reader.bool(); - break; - } - case 15: { - message.unverifiedLazy = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 10: { - message.weak = reader.bool(); - break; - } - case 16: { - message.debugRedact = reader.bool(); - break; - } - case 17: { - message.retention = reader.int32(); - break; - } - case 19: { - if (!(message.targets && message.targets.length)) - message.targets = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.targets.push(reader.int32()); - } else - message.targets.push(reader.int32()); - break; - } - case 20: { - if (!(message.editionDefaults && message.editionDefaults.length)) - message.editionDefaults = []; - message.editionDefaults.push($root.google.protobuf.FieldOptions.EditionDefault.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 21: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 22: { - message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); - 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, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i], long + 1); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); - if (error) - return "features." + error; - } - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { - var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); - if (error) - return "featureSupport." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - 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, long) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i], long + 1); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); - } - if (object.featureSupport != null) { - if (typeof object.featureSupport !== "object") - throw TypeError(".google.protobuf.FieldOptions.featureSupport: object expected"); - message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); - } - 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], long + 1); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object.featureSupport = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) - object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.EditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EditionDefault message. - * @function verify - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EditionDefault.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - */ - EditionDefault.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FieldOptions.EditionDefault) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FieldOptions.EditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.edition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.EditionDefault} message EditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.value = ""; - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this EditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - * @returns {Object.} JSON object - */ - EditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.EditionDefault"; - }; - - return EditionDefault; - })(); - - FieldOptions.FeatureSupport = (function() { - - /** - * Properties of a FeatureSupport. - * @memberof google.protobuf.FieldOptions - * @interface IFeatureSupport - * @property {google.protobuf.Edition|null} [editionIntroduced] FeatureSupport editionIntroduced - * @property {google.protobuf.Edition|null} [editionDeprecated] FeatureSupport editionDeprecated - * @property {string|null} [deprecationWarning] FeatureSupport deprecationWarning - * @property {google.protobuf.Edition|null} [editionRemoved] FeatureSupport editionRemoved - */ - - /** - * Constructs a new FeatureSupport. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents a FeatureSupport. - * @implements IFeatureSupport - * @constructor - * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set - */ - function FeatureSupport(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSupport editionIntroduced. - * @member {google.protobuf.Edition} editionIntroduced - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - */ - FeatureSupport.prototype.editionIntroduced = 0; - - /** - * FeatureSupport editionDeprecated. - * @member {google.protobuf.Edition} editionDeprecated - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - */ - FeatureSupport.prototype.editionDeprecated = 0; - - /** - * FeatureSupport deprecationWarning. - * @member {string} deprecationWarning - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - */ - FeatureSupport.prototype.deprecationWarning = ""; - - /** - * FeatureSupport editionRemoved. - * @member {google.protobuf.Edition} editionRemoved - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - */ - FeatureSupport.prototype.editionRemoved = 0; - - /** - * Creates a new FeatureSupport instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {google.protobuf.FieldOptions.IFeatureSupport=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport instance - */ - FeatureSupport.create = function create(properties) { - return new FeatureSupport(properties); - }; - - /** - * Encodes the specified FeatureSupport message. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSupport.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.editionIntroduced != null && Object.hasOwnProperty.call(message, "editionIntroduced")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.editionIntroduced); - if (message.editionDeprecated != null && Object.hasOwnProperty.call(message, "editionDeprecated")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.editionDeprecated); - if (message.deprecationWarning != null && Object.hasOwnProperty.call(message, "deprecationWarning")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.deprecationWarning); - if (message.editionRemoved != null && Object.hasOwnProperty.call(message, "editionRemoved")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.editionRemoved); - return writer; - }; - - /** - * Encodes the specified FeatureSupport message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.FeatureSupport.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {google.protobuf.FieldOptions.IFeatureSupport} message FeatureSupport message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSupport.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSupport message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSupport.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions.FeatureSupport(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.editionIntroduced = reader.int32(); - break; - } - case 2: { - message.editionDeprecated = reader.int32(); - break; - } - case 3: { - message.deprecationWarning = reader.string(); - break; - } - case 4: { - message.editionRemoved = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSupport message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSupport.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSupport message. - * @function verify - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSupport.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) - switch (message.editionIntroduced) { - default: - return "editionIntroduced: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) - switch (message.editionDeprecated) { - default: - return "editionDeprecated: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) - if (!$util.isString(message.deprecationWarning)) - return "deprecationWarning: string expected"; - if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) - switch (message.editionRemoved) { - default: - return "editionRemoved: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSupport message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions.FeatureSupport} FeatureSupport - */ - FeatureSupport.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FieldOptions.FeatureSupport) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FieldOptions.FeatureSupport(); - switch (object.editionIntroduced) { - default: - if (typeof object.editionIntroduced === "number") { - message.editionIntroduced = object.editionIntroduced; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.editionIntroduced = 0; - break; - case "EDITION_LEGACY": - case 900: - message.editionIntroduced = 900; - break; - case "EDITION_PROTO2": - case 998: - message.editionIntroduced = 998; - break; - case "EDITION_PROTO3": - case 999: - message.editionIntroduced = 999; - break; - case "EDITION_2023": - case 1000: - message.editionIntroduced = 1000; - break; - case "EDITION_2024": - case 1001: - message.editionIntroduced = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.editionIntroduced = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.editionIntroduced = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.editionIntroduced = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.editionIntroduced = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.editionIntroduced = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.editionIntroduced = 2147483647; - break; - } - switch (object.editionDeprecated) { - default: - if (typeof object.editionDeprecated === "number") { - message.editionDeprecated = object.editionDeprecated; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.editionDeprecated = 0; - break; - case "EDITION_LEGACY": - case 900: - message.editionDeprecated = 900; - break; - case "EDITION_PROTO2": - case 998: - message.editionDeprecated = 998; - break; - case "EDITION_PROTO3": - case 999: - message.editionDeprecated = 999; - break; - case "EDITION_2023": - case 1000: - message.editionDeprecated = 1000; - break; - case "EDITION_2024": - case 1001: - message.editionDeprecated = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.editionDeprecated = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.editionDeprecated = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.editionDeprecated = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.editionDeprecated = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.editionDeprecated = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.editionDeprecated = 2147483647; - break; - } - if (object.deprecationWarning != null) - message.deprecationWarning = String(object.deprecationWarning); - switch (object.editionRemoved) { - default: - if (typeof object.editionRemoved === "number") { - message.editionRemoved = object.editionRemoved; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.editionRemoved = 0; - break; - case "EDITION_LEGACY": - case 900: - message.editionRemoved = 900; - break; - case "EDITION_PROTO2": - case 998: - message.editionRemoved = 998; - break; - case "EDITION_PROTO3": - case 999: - message.editionRemoved = 999; - break; - case "EDITION_2023": - case 1000: - message.editionRemoved = 1000; - break; - case "EDITION_2024": - case 1001: - message.editionRemoved = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.editionRemoved = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.editionRemoved = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.editionRemoved = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.editionRemoved = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.editionRemoved = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.editionRemoved = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSupport message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {google.protobuf.FieldOptions.FeatureSupport} message FeatureSupport - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSupport.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.editionIntroduced = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.editionDeprecated = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.deprecationWarning = ""; - object.editionRemoved = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.editionIntroduced != null && message.hasOwnProperty("editionIntroduced")) - object.editionIntroduced = options.enums === String ? $root.google.protobuf.Edition[message.editionIntroduced] === undefined ? message.editionIntroduced : $root.google.protobuf.Edition[message.editionIntroduced] : message.editionIntroduced; - if (message.editionDeprecated != null && message.hasOwnProperty("editionDeprecated")) - object.editionDeprecated = options.enums === String ? $root.google.protobuf.Edition[message.editionDeprecated] === undefined ? message.editionDeprecated : $root.google.protobuf.Edition[message.editionDeprecated] : message.editionDeprecated; - if (message.deprecationWarning != null && message.hasOwnProperty("deprecationWarning")) - object.deprecationWarning = message.deprecationWarning; - if (message.editionRemoved != null && message.hasOwnProperty("editionRemoved")) - object.editionRemoved = options.enums === String ? $root.google.protobuf.Edition[message.editionRemoved] === undefined ? message.editionRemoved : $root.google.protobuf.Edition[message.editionRemoved] : message.editionRemoved; - return object; - }; - - /** - * Converts this FeatureSupport to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @instance - * @returns {Object.} JSON object - */ - FeatureSupport.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSupport - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions.FeatureSupport - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSupport.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions.FeatureSupport"; - }; - - return FeatureSupport; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {google.protobuf.IFeatureSet|null} [features] OneofOptions features - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * OneofOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.features = null; - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); - 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, long) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.OneofOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.OneofOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); - } - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.features = null; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OneofOptions - * @function getTypeUrl - * @memberof google.protobuf.OneofOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.OneofOptions"; - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {boolean|null} [deprecatedLegacyJsonFieldConflicts] EnumOptions deprecatedLegacyJsonFieldConflicts - * @property {google.protobuf.IFeatureSet|null} [features] EnumOptions features - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions deprecatedLegacyJsonFieldConflicts. - * @member {boolean} deprecatedLegacyJsonFieldConflicts - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecatedLegacyJsonFieldConflicts = false; - - /** - * EnumOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.features = null; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.deprecatedLegacyJsonFieldConflicts != null && Object.hasOwnProperty.call(message, "deprecatedLegacyJsonFieldConflicts")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.deprecatedLegacyJsonFieldConflicts); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.allowAlias = reader.bool(); - break; - } - case 3: { - message.deprecated = reader.bool(); - break; - } - case 6: { - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - break; - } - case 7: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - if (typeof message.deprecatedLegacyJsonFieldConflicts !== "boolean") - return "deprecatedLegacyJsonFieldConflicts: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); - 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, long) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.deprecatedLegacyJsonFieldConflicts != null) - message.deprecatedLegacyJsonFieldConflicts = Boolean(object.deprecatedLegacyJsonFieldConflicts); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); - } - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object.deprecatedLegacyJsonFieldConflicts = false; - object.features = null; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.deprecatedLegacyJsonFieldConflicts != null && message.hasOwnProperty("deprecatedLegacyJsonFieldConflicts")) - object.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumOptions"; - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {google.protobuf.IFeatureSet|null} [features] EnumValueOptions features - * @property {boolean|null} [debugRedact] EnumValueOptions debugRedact - * @property {google.protobuf.FieldOptions.IFeatureSupport|null} [featureSupport] EnumValueOptions featureSupport - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.features = null; - - /** - * EnumValueOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.debugRedact = false; - - /** - * EnumValueOptions featureSupport. - * @member {google.protobuf.FieldOptions.IFeatureSupport|null|undefined} featureSupport - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.featureSupport = null; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.debugRedact); - if (message.featureSupport != null && Object.hasOwnProperty.call(message, "featureSupport")) - $root.google.protobuf.FieldOptions.FeatureSupport.encode(message.featureSupport, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.deprecated = reader.bool(); - break; - } - case 2: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.debugRedact = reader.bool(); - break; - } - case 4: { - message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); - if (error) - return "features." + error; - } - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) { - var error = $root.google.protobuf.FieldOptions.FeatureSupport.verify(message.featureSupport, long + 1); - if (error) - return "featureSupport." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); - 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, long) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); - } - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - if (object.featureSupport != null) { - if (typeof object.featureSupport !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.featureSupport: object expected"); - message.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.fromObject(object.featureSupport, long + 1); - } - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object.debugRedact = false; - object.featureSupport = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.featureSupport != null && message.hasOwnProperty("featureSupport")) - object.featureSupport = $root.google.protobuf.FieldOptions.FeatureSupport.toObject(message.featureSupport, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for EnumValueOptions - * @function getTypeUrl - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {google.protobuf.IFeatureSet|null} [features] ServiceOptions features - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost - * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes - * @property {string|null} [".google.api.apiVersion"] ServiceOptions .google.api.apiVersion - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.features = null; - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * ServiceOptions .google.api.defaultHost. - * @member {string} .google.api.defaultHost - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.defaultHost"] = ""; - - /** - * ServiceOptions .google.api.oauthScopes. - * @member {string} .google.api.oauthScopes - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.oauthScopes"] = ""; - - /** - * ServiceOptions .google.api.apiVersion. - * @member {string} .google.api.apiVersion - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype[".google.api.apiVersion"] = ""; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) - writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); - if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) - writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); - if (message[".google.api.apiVersion"] != null && Object.hasOwnProperty.call(message, ".google.api.apiVersion")) - writer.uint32(/* id 525000001, wireType 2 =*/4200000010).string(message[".google.api.apiVersion"]); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 34: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 33: { - message.deprecated = reader.bool(); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 1049: { - message[".google.api.defaultHost"] = reader.string(); - break; - } - case 1050: { - message[".google.api.oauthScopes"] = reader.string(); - break; - } - case 525000001: { - message[".google.api.apiVersion"] = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); - if (error) - return "features." + error; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - if (!$util.isString(message[".google.api.defaultHost"])) - return ".google.api.defaultHost: string expected"; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - if (!$util.isString(message[".google.api.oauthScopes"])) - return ".google.api.oauthScopes: string expected"; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - if (!$util.isString(message[".google.api.apiVersion"])) - return ".google.api.apiVersion: string expected"; - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.ServiceOptions(); - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.ServiceOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); - } - 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], long + 1); - } - } - if (object[".google.api.defaultHost"] != null) - message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); - if (object[".google.api.oauthScopes"] != null) - message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); - if (object[".google.api.apiVersion"] != null) - message[".google.api.apiVersion"] = String(object[".google.api.apiVersion"]); - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.features = null; - object[".google.api.defaultHost"] = ""; - object[".google.api.oauthScopes"] = ""; - object[".google.api.apiVersion"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) - object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; - if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) - object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; - if (message[".google.api.apiVersion"] != null && message.hasOwnProperty(".google.api.apiVersion")) - object[".google.api.apiVersion"] = message[".google.api.apiVersion"]; - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceOptions - * @function getTypeUrl - * @memberof google.protobuf.ServiceOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ServiceOptions"; - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {google.protobuf.IFeatureSet|null} [features] MethodOptions features - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http - * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature - * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo - * @property {google.api.IRoutingRule|null} [".google.api.routing"] MethodOptions .google.api.routing - */ - - /** - * 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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.features = null; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MethodOptions .google.api.http. - * @member {google.api.IHttpRule|null|undefined} .google.api.http - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.http"] = null; - - /** - * MethodOptions .google.api.methodSignature. - * @member {Array.} .google.api.methodSignature - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; - - /** - * MethodOptions .google.longrunning.operationInfo. - * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.longrunning.operationInfo"] = null; - - /** - * MethodOptions .google.api.routing. - * @member {google.api.IRoutingRule|null|undefined} .google.api.routing - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype[".google.api.routing"] = null; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) - $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); - if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) - for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) - writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); - if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) - $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); - if (message[".google.api.routing"] != null && Object.hasOwnProperty.call(message, ".google.api.routing")) - $root.google.api.RoutingRule.encode(message[".google.api.routing"], writer.uint32(/* id 72295729, wireType 2 =*/578365834).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 33: { - message.deprecated = reader.bool(); - break; - } - case 34: { - message.idempotencyLevel = reader.int32(); - break; - } - case 35: { - message.features = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 999: { - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 72295728: { - message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32(), undefined, long + 1); - 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(), undefined, long + 1); - break; - } - case 72295729: { - message[".google.api.routing"] = $root.google.api.RoutingRule.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features, long + 1); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i], long + 1); - 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"], long + 1); - 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"], long + 1); - if (error) - return ".google.longrunning.operationInfo." + error; - } - if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) { - var error = $root.google.api.RoutingRule.verify(message[".google.api.routing"], long + 1); - if (error) - return ".google.api.routing." + 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, long) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - default: - if (typeof object.idempotencyLevel === "number") { - message.idempotencyLevel = object.idempotencyLevel; - break; - } - break; - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.MethodOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features, long + 1); - } - 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], long + 1); - } - } - 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"], long + 1); - } - 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"], long + 1); - } - if (object[".google.api.routing"] != null) { - if (typeof object[".google.api.routing"] !== "object") - throw TypeError(".google.protobuf.MethodOptions..google.api.routing: object expected"); - message[".google.api.routing"] = $root.google.api.RoutingRule.fromObject(object[".google.api.routing"], long + 1); - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.uninterpretedOption = []; - object[".google.api.methodSignature"] = []; - } - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - object.features = null; - object[".google.longrunning.operationInfo"] = null; - object[".google.api.http"] = null; - object[".google.api.routing"] = null; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) - object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); - if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { - object[".google.api.methodSignature"] = []; - for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) - object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; - } - if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) - object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); - if (message[".google.api.routing"] != null && message.hasOwnProperty(".google.api.routing")) - object[".google.api.routing"] = $root.google.api.RoutingRule.toObject(message[".google.api.routing"], options); - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for MethodOptions - * @function getTypeUrl - * @memberof google.protobuf.MethodOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.MethodOptions"; - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32(), undefined, long + 1)); - 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, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length >= 0) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UninterpretedOption - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.namePart = reader.string(); - break; - } - case 2: { - message.isExtension = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NamePart - * @function getTypeUrl - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.FeatureSet = (function() { - - /** - * Properties of a FeatureSet. - * @memberof google.protobuf - * @interface IFeatureSet - * @property {google.protobuf.FeatureSet.FieldPresence|null} [fieldPresence] FeatureSet fieldPresence - * @property {google.protobuf.FeatureSet.EnumType|null} [enumType] FeatureSet enumType - * @property {google.protobuf.FeatureSet.RepeatedFieldEncoding|null} [repeatedFieldEncoding] FeatureSet repeatedFieldEncoding - * @property {google.protobuf.FeatureSet.Utf8Validation|null} [utf8Validation] FeatureSet utf8Validation - * @property {google.protobuf.FeatureSet.MessageEncoding|null} [messageEncoding] FeatureSet messageEncoding - * @property {google.protobuf.FeatureSet.JsonFormat|null} [jsonFormat] FeatureSet jsonFormat - * @property {google.protobuf.FeatureSet.EnforceNamingStyle|null} [enforceNamingStyle] FeatureSet enforceNamingStyle - * @property {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility|null} [defaultSymbolVisibility] FeatureSet defaultSymbolVisibility - */ - - /** - * Constructs a new FeatureSet. - * @memberof google.protobuf - * @classdesc Represents a FeatureSet. - * @implements IFeatureSet - * @constructor - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - */ - function FeatureSet(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSet fieldPresence. - * @member {google.protobuf.FeatureSet.FieldPresence} fieldPresence - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.fieldPresence = 0; - - /** - * FeatureSet enumType. - * @member {google.protobuf.FeatureSet.EnumType} enumType - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enumType = 0; - - /** - * FeatureSet repeatedFieldEncoding. - * @member {google.protobuf.FeatureSet.RepeatedFieldEncoding} repeatedFieldEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.repeatedFieldEncoding = 0; - - /** - * FeatureSet utf8Validation. - * @member {google.protobuf.FeatureSet.Utf8Validation} utf8Validation - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.utf8Validation = 0; - - /** - * FeatureSet messageEncoding. - * @member {google.protobuf.FeatureSet.MessageEncoding} messageEncoding - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.messageEncoding = 0; - - /** - * FeatureSet jsonFormat. - * @member {google.protobuf.FeatureSet.JsonFormat} jsonFormat - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.jsonFormat = 0; - - /** - * FeatureSet enforceNamingStyle. - * @member {google.protobuf.FeatureSet.EnforceNamingStyle} enforceNamingStyle - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.enforceNamingStyle = 0; - - /** - * FeatureSet defaultSymbolVisibility. - * @member {google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility} defaultSymbolVisibility - * @memberof google.protobuf.FeatureSet - * @instance - */ - FeatureSet.prototype.defaultSymbolVisibility = 0; - - /** - * Creates a new FeatureSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet} FeatureSet instance - */ - FeatureSet.create = function create(properties) { - return new FeatureSet(properties); - }; - - /** - * Encodes the specified FeatureSet message. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fieldPresence != null && Object.hasOwnProperty.call(message, "fieldPresence")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fieldPresence); - if (message.enumType != null && Object.hasOwnProperty.call(message, "enumType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enumType); - if (message.repeatedFieldEncoding != null && Object.hasOwnProperty.call(message, "repeatedFieldEncoding")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.repeatedFieldEncoding); - if (message.utf8Validation != null && Object.hasOwnProperty.call(message, "utf8Validation")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.utf8Validation); - if (message.messageEncoding != null && Object.hasOwnProperty.call(message, "messageEncoding")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.messageEncoding); - if (message.jsonFormat != null && Object.hasOwnProperty.call(message, "jsonFormat")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jsonFormat); - if (message.enforceNamingStyle != null && Object.hasOwnProperty.call(message, "enforceNamingStyle")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enforceNamingStyle); - if (message.defaultSymbolVisibility != null && Object.hasOwnProperty.call(message, "defaultSymbolVisibility")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.defaultSymbolVisibility); - return writer; - }; - - /** - * Encodes the specified FeatureSet message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.IFeatureSet} message FeatureSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.fieldPresence = reader.int32(); - break; - } - case 2: { - message.enumType = reader.int32(); - break; - } - case 3: { - message.repeatedFieldEncoding = reader.int32(); - break; - } - case 4: { - message.utf8Validation = reader.int32(); - break; - } - case 5: { - message.messageEncoding = reader.int32(); - break; - } - case 6: { - message.jsonFormat = reader.int32(); - break; - } - case 7: { - message.enforceNamingStyle = reader.int32(); - break; - } - case 8: { - message.defaultSymbolVisibility = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet} FeatureSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSet message. - * @function verify - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSet.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - switch (message.fieldPresence) { - default: - return "fieldPresence: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.enumType != null && message.hasOwnProperty("enumType")) - switch (message.enumType) { - default: - return "enumType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - switch (message.repeatedFieldEncoding) { - default: - return "repeatedFieldEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - switch (message.utf8Validation) { - default: - return "utf8Validation: enum value expected"; - case 0: - case 2: - case 3: - break; - } - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - switch (message.messageEncoding) { - default: - return "messageEncoding: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - switch (message.jsonFormat) { - default: - return "jsonFormat: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) - switch (message.enforceNamingStyle) { - default: - return "enforceNamingStyle: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) - switch (message.defaultSymbolVisibility) { - default: - return "defaultSymbolVisibility: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FeatureSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet} FeatureSet - */ - FeatureSet.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FeatureSet) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FeatureSet(); - switch (object.fieldPresence) { - default: - if (typeof object.fieldPresence === "number") { - message.fieldPresence = object.fieldPresence; - break; - } - break; - case "FIELD_PRESENCE_UNKNOWN": - case 0: - message.fieldPresence = 0; - break; - case "EXPLICIT": - case 1: - message.fieldPresence = 1; - break; - case "IMPLICIT": - case 2: - message.fieldPresence = 2; - break; - case "LEGACY_REQUIRED": - case 3: - message.fieldPresence = 3; - break; - } - switch (object.enumType) { - default: - if (typeof object.enumType === "number") { - message.enumType = object.enumType; - break; - } - break; - case "ENUM_TYPE_UNKNOWN": - case 0: - message.enumType = 0; - break; - case "OPEN": - case 1: - message.enumType = 1; - break; - case "CLOSED": - case 2: - message.enumType = 2; - break; - } - switch (object.repeatedFieldEncoding) { - default: - if (typeof object.repeatedFieldEncoding === "number") { - message.repeatedFieldEncoding = object.repeatedFieldEncoding; - break; - } - break; - case "REPEATED_FIELD_ENCODING_UNKNOWN": - case 0: - message.repeatedFieldEncoding = 0; - break; - case "PACKED": - case 1: - message.repeatedFieldEncoding = 1; - break; - case "EXPANDED": - case 2: - message.repeatedFieldEncoding = 2; - break; - } - switch (object.utf8Validation) { - default: - if (typeof object.utf8Validation === "number") { - message.utf8Validation = object.utf8Validation; - break; - } - break; - case "UTF8_VALIDATION_UNKNOWN": - case 0: - message.utf8Validation = 0; - break; - case "VERIFY": - case 2: - message.utf8Validation = 2; - break; - case "NONE": - case 3: - message.utf8Validation = 3; - break; - } - switch (object.messageEncoding) { - default: - if (typeof object.messageEncoding === "number") { - message.messageEncoding = object.messageEncoding; - break; - } - break; - case "MESSAGE_ENCODING_UNKNOWN": - case 0: - message.messageEncoding = 0; - break; - case "LENGTH_PREFIXED": - case 1: - message.messageEncoding = 1; - break; - case "DELIMITED": - case 2: - message.messageEncoding = 2; - break; - } - switch (object.jsonFormat) { - default: - if (typeof object.jsonFormat === "number") { - message.jsonFormat = object.jsonFormat; - break; - } - break; - case "JSON_FORMAT_UNKNOWN": - case 0: - message.jsonFormat = 0; - break; - case "ALLOW": - case 1: - message.jsonFormat = 1; - break; - case "LEGACY_BEST_EFFORT": - case 2: - message.jsonFormat = 2; - break; - } - switch (object.enforceNamingStyle) { - default: - if (typeof object.enforceNamingStyle === "number") { - message.enforceNamingStyle = object.enforceNamingStyle; - break; - } - break; - case "ENFORCE_NAMING_STYLE_UNKNOWN": - case 0: - message.enforceNamingStyle = 0; - break; - case "STYLE2024": - case 1: - message.enforceNamingStyle = 1; - break; - case "STYLE_LEGACY": - case 2: - message.enforceNamingStyle = 2; - break; - } - switch (object.defaultSymbolVisibility) { - default: - if (typeof object.defaultSymbolVisibility === "number") { - message.defaultSymbolVisibility = object.defaultSymbolVisibility; - break; - } - break; - case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": - case 0: - message.defaultSymbolVisibility = 0; - break; - case "EXPORT_ALL": - case 1: - message.defaultSymbolVisibility = 1; - break; - case "EXPORT_TOP_LEVEL": - case 2: - message.defaultSymbolVisibility = 2; - break; - case "LOCAL_ALL": - case 3: - message.defaultSymbolVisibility = 3; - break; - case "STRICT": - case 4: - message.defaultSymbolVisibility = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet - * @static - * @param {google.protobuf.FeatureSet} message FeatureSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fieldPresence = options.enums === String ? "FIELD_PRESENCE_UNKNOWN" : 0; - object.enumType = options.enums === String ? "ENUM_TYPE_UNKNOWN" : 0; - object.repeatedFieldEncoding = options.enums === String ? "REPEATED_FIELD_ENCODING_UNKNOWN" : 0; - object.utf8Validation = options.enums === String ? "UTF8_VALIDATION_UNKNOWN" : 0; - object.messageEncoding = options.enums === String ? "MESSAGE_ENCODING_UNKNOWN" : 0; - object.jsonFormat = options.enums === String ? "JSON_FORMAT_UNKNOWN" : 0; - object.enforceNamingStyle = options.enums === String ? "ENFORCE_NAMING_STYLE_UNKNOWN" : 0; - object.defaultSymbolVisibility = options.enums === String ? "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN" : 0; - } - if (message.fieldPresence != null && message.hasOwnProperty("fieldPresence")) - object.fieldPresence = options.enums === String ? $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] === undefined ? message.fieldPresence : $root.google.protobuf.FeatureSet.FieldPresence[message.fieldPresence] : message.fieldPresence; - if (message.enumType != null && message.hasOwnProperty("enumType")) - object.enumType = options.enums === String ? $root.google.protobuf.FeatureSet.EnumType[message.enumType] === undefined ? message.enumType : $root.google.protobuf.FeatureSet.EnumType[message.enumType] : message.enumType; - if (message.repeatedFieldEncoding != null && message.hasOwnProperty("repeatedFieldEncoding")) - object.repeatedFieldEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] === undefined ? message.repeatedFieldEncoding : $root.google.protobuf.FeatureSet.RepeatedFieldEncoding[message.repeatedFieldEncoding] : message.repeatedFieldEncoding; - if (message.utf8Validation != null && message.hasOwnProperty("utf8Validation")) - object.utf8Validation = options.enums === String ? $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] === undefined ? message.utf8Validation : $root.google.protobuf.FeatureSet.Utf8Validation[message.utf8Validation] : message.utf8Validation; - if (message.messageEncoding != null && message.hasOwnProperty("messageEncoding")) - object.messageEncoding = options.enums === String ? $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] === undefined ? message.messageEncoding : $root.google.protobuf.FeatureSet.MessageEncoding[message.messageEncoding] : message.messageEncoding; - if (message.jsonFormat != null && message.hasOwnProperty("jsonFormat")) - object.jsonFormat = options.enums === String ? $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] === undefined ? message.jsonFormat : $root.google.protobuf.FeatureSet.JsonFormat[message.jsonFormat] : message.jsonFormat; - if (message.enforceNamingStyle != null && message.hasOwnProperty("enforceNamingStyle")) - object.enforceNamingStyle = options.enums === String ? $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] === undefined ? message.enforceNamingStyle : $root.google.protobuf.FeatureSet.EnforceNamingStyle[message.enforceNamingStyle] : message.enforceNamingStyle; - if (message.defaultSymbolVisibility != null && message.hasOwnProperty("defaultSymbolVisibility")) - object.defaultSymbolVisibility = options.enums === String ? $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] === undefined ? message.defaultSymbolVisibility : $root.google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility[message.defaultSymbolVisibility] : message.defaultSymbolVisibility; - return object; - }; - - /** - * Converts this FeatureSet to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet - * @instance - * @returns {Object.} JSON object - */ - FeatureSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSet - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet"; - }; - - /** - * FieldPresence enum. - * @name google.protobuf.FeatureSet.FieldPresence - * @enum {number} - * @property {number} FIELD_PRESENCE_UNKNOWN=0 FIELD_PRESENCE_UNKNOWN value - * @property {number} EXPLICIT=1 EXPLICIT value - * @property {number} IMPLICIT=2 IMPLICIT value - * @property {number} LEGACY_REQUIRED=3 LEGACY_REQUIRED value - */ - FeatureSet.FieldPresence = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FIELD_PRESENCE_UNKNOWN"] = 0; - values[valuesById[1] = "EXPLICIT"] = 1; - values[valuesById[2] = "IMPLICIT"] = 2; - values[valuesById[3] = "LEGACY_REQUIRED"] = 3; - return values; - })(); - - /** - * EnumType enum. - * @name google.protobuf.FeatureSet.EnumType - * @enum {number} - * @property {number} ENUM_TYPE_UNKNOWN=0 ENUM_TYPE_UNKNOWN value - * @property {number} OPEN=1 OPEN value - * @property {number} CLOSED=2 CLOSED value - */ - FeatureSet.EnumType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENUM_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "OPEN"] = 1; - values[valuesById[2] = "CLOSED"] = 2; - return values; - })(); - - /** - * RepeatedFieldEncoding enum. - * @name google.protobuf.FeatureSet.RepeatedFieldEncoding - * @enum {number} - * @property {number} REPEATED_FIELD_ENCODING_UNKNOWN=0 REPEATED_FIELD_ENCODING_UNKNOWN value - * @property {number} PACKED=1 PACKED value - * @property {number} EXPANDED=2 EXPANDED value - */ - FeatureSet.RepeatedFieldEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "REPEATED_FIELD_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "PACKED"] = 1; - values[valuesById[2] = "EXPANDED"] = 2; - return values; - })(); - - /** - * Utf8Validation enum. - * @name google.protobuf.FeatureSet.Utf8Validation - * @enum {number} - * @property {number} UTF8_VALIDATION_UNKNOWN=0 UTF8_VALIDATION_UNKNOWN value - * @property {number} VERIFY=2 VERIFY value - * @property {number} NONE=3 NONE value - */ - FeatureSet.Utf8Validation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UTF8_VALIDATION_UNKNOWN"] = 0; - values[valuesById[2] = "VERIFY"] = 2; - values[valuesById[3] = "NONE"] = 3; - return values; - })(); - - /** - * MessageEncoding enum. - * @name google.protobuf.FeatureSet.MessageEncoding - * @enum {number} - * @property {number} MESSAGE_ENCODING_UNKNOWN=0 MESSAGE_ENCODING_UNKNOWN value - * @property {number} LENGTH_PREFIXED=1 LENGTH_PREFIXED value - * @property {number} DELIMITED=2 DELIMITED value - */ - FeatureSet.MessageEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_ENCODING_UNKNOWN"] = 0; - values[valuesById[1] = "LENGTH_PREFIXED"] = 1; - values[valuesById[2] = "DELIMITED"] = 2; - return values; - })(); - - /** - * JsonFormat enum. - * @name google.protobuf.FeatureSet.JsonFormat - * @enum {number} - * @property {number} JSON_FORMAT_UNKNOWN=0 JSON_FORMAT_UNKNOWN value - * @property {number} ALLOW=1 ALLOW value - * @property {number} LEGACY_BEST_EFFORT=2 LEGACY_BEST_EFFORT value - */ - FeatureSet.JsonFormat = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JSON_FORMAT_UNKNOWN"] = 0; - values[valuesById[1] = "ALLOW"] = 1; - values[valuesById[2] = "LEGACY_BEST_EFFORT"] = 2; - return values; - })(); - - /** - * EnforceNamingStyle enum. - * @name google.protobuf.FeatureSet.EnforceNamingStyle - * @enum {number} - * @property {number} ENFORCE_NAMING_STYLE_UNKNOWN=0 ENFORCE_NAMING_STYLE_UNKNOWN value - * @property {number} STYLE2024=1 STYLE2024 value - * @property {number} STYLE_LEGACY=2 STYLE_LEGACY value - */ - FeatureSet.EnforceNamingStyle = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENFORCE_NAMING_STYLE_UNKNOWN"] = 0; - values[valuesById[1] = "STYLE2024"] = 1; - values[valuesById[2] = "STYLE_LEGACY"] = 2; - return values; - })(); - - FeatureSet.VisibilityFeature = (function() { - - /** - * Properties of a VisibilityFeature. - * @memberof google.protobuf.FeatureSet - * @interface IVisibilityFeature - */ - - /** - * Constructs a new VisibilityFeature. - * @memberof google.protobuf.FeatureSet - * @classdesc Represents a VisibilityFeature. - * @implements IVisibilityFeature - * @constructor - * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set - */ - function VisibilityFeature(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new VisibilityFeature instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {google.protobuf.FeatureSet.IVisibilityFeature=} [properties] Properties to set - * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature instance - */ - VisibilityFeature.create = function create(properties) { - return new VisibilityFeature(properties); - }; - - /** - * Encodes the specified VisibilityFeature message. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VisibilityFeature.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified VisibilityFeature message, length delimited. Does not implicitly {@link google.protobuf.FeatureSet.VisibilityFeature.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {google.protobuf.FeatureSet.IVisibilityFeature} message VisibilityFeature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VisibilityFeature.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a VisibilityFeature message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VisibilityFeature.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSet.VisibilityFeature(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a VisibilityFeature message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VisibilityFeature.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a VisibilityFeature message. - * @function verify - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VisibilityFeature.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - return null; - }; - - /** - * Creates a VisibilityFeature message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSet.VisibilityFeature} VisibilityFeature - */ - VisibilityFeature.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FeatureSet.VisibilityFeature) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - return new $root.google.protobuf.FeatureSet.VisibilityFeature(); - }; - - /** - * Creates a plain object from a VisibilityFeature message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {google.protobuf.FeatureSet.VisibilityFeature} message VisibilityFeature - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VisibilityFeature.toObject = function toObject() { - return {}; - }; - - /** - * Converts this VisibilityFeature to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @instance - * @returns {Object.} JSON object - */ - VisibilityFeature.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for VisibilityFeature - * @function getTypeUrl - * @memberof google.protobuf.FeatureSet.VisibilityFeature - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VisibilityFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSet.VisibilityFeature"; - }; - - /** - * DefaultSymbolVisibility enum. - * @name google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility - * @enum {number} - * @property {number} DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0 DEFAULT_SYMBOL_VISIBILITY_UNKNOWN value - * @property {number} EXPORT_ALL=1 EXPORT_ALL value - * @property {number} EXPORT_TOP_LEVEL=2 EXPORT_TOP_LEVEL value - * @property {number} LOCAL_ALL=3 LOCAL_ALL value - * @property {number} STRICT=4 STRICT value - */ - VisibilityFeature.DefaultSymbolVisibility = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"] = 0; - values[valuesById[1] = "EXPORT_ALL"] = 1; - values[valuesById[2] = "EXPORT_TOP_LEVEL"] = 2; - values[valuesById[3] = "LOCAL_ALL"] = 3; - values[valuesById[4] = "STRICT"] = 4; - return values; - })(); - - return VisibilityFeature; - })(); - - return FeatureSet; - })(); - - protobuf.FeatureSetDefaults = (function() { - - /** - * Properties of a FeatureSetDefaults. - * @memberof google.protobuf - * @interface IFeatureSetDefaults - * @property {Array.|null} [defaults] FeatureSetDefaults defaults - * @property {google.protobuf.Edition|null} [minimumEdition] FeatureSetDefaults minimumEdition - * @property {google.protobuf.Edition|null} [maximumEdition] FeatureSetDefaults maximumEdition - */ - - /** - * Constructs a new FeatureSetDefaults. - * @memberof google.protobuf - * @classdesc Represents a FeatureSetDefaults. - * @implements IFeatureSetDefaults - * @constructor - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - */ - function FeatureSetDefaults(properties) { - this.defaults = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetDefaults defaults. - * @member {Array.} defaults - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.defaults = $util.emptyArray; - - /** - * FeatureSetDefaults minimumEdition. - * @member {google.protobuf.Edition} minimumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.minimumEdition = 0; - - /** - * FeatureSetDefaults maximumEdition. - * @member {google.protobuf.Edition} maximumEdition - * @memberof google.protobuf.FeatureSetDefaults - * @instance - */ - FeatureSetDefaults.prototype.maximumEdition = 0; - - /** - * Creates a new FeatureSetDefaults instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults instance - */ - FeatureSetDefaults.create = function create(properties) { - return new FeatureSetDefaults(properties); - }; - - /** - * Encodes the specified FeatureSetDefaults message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.defaults != null && message.defaults.length) - for (var i = 0; i < message.defaults.length; ++i) - $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.encode(message.defaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minimumEdition != null && Object.hasOwnProperty.call(message, "minimumEdition")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.minimumEdition); - if (message.maximumEdition != null && Object.hasOwnProperty.call(message, "maximumEdition")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maximumEdition); - return writer; - }; - - /** - * Encodes the specified FeatureSetDefaults message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.IFeatureSetDefaults} message FeatureSetDefaults message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetDefaults.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.defaults && message.defaults.length)) - message.defaults = []; - message.defaults.push($root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 4: { - message.minimumEdition = reader.int32(); - break; - } - case 5: { - message.maximumEdition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetDefaults message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetDefaults.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetDefaults message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetDefaults.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.defaults != null && message.hasOwnProperty("defaults")) { - if (!Array.isArray(message.defaults)) - return "defaults: array expected"; - for (var i = 0; i < message.defaults.length; ++i) { - var error = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify(message.defaults[i], long + 1); - if (error) - return "defaults." + error; - } - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - switch (message.minimumEdition) { - default: - return "minimumEdition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - switch (message.maximumEdition) { - default: - return "maximumEdition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - return null; - }; - - /** - * Creates a FeatureSetDefaults message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults} FeatureSetDefaults - */ - FeatureSetDefaults.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FeatureSetDefaults(); - if (object.defaults) { - if (!Array.isArray(object.defaults)) - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: array expected"); - message.defaults = []; - for (var i = 0; i < object.defaults.length; ++i) { - if (typeof object.defaults[i] !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.defaults: object expected"); - message.defaults[i] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fromObject(object.defaults[i], long + 1); - } - } - switch (object.minimumEdition) { - default: - if (typeof object.minimumEdition === "number") { - message.minimumEdition = object.minimumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.minimumEdition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.minimumEdition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.minimumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.minimumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.minimumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.minimumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.minimumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.minimumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.minimumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.minimumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.minimumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.minimumEdition = 2147483647; - break; - } - switch (object.maximumEdition) { - default: - if (typeof object.maximumEdition === "number") { - message.maximumEdition = object.maximumEdition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.maximumEdition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.maximumEdition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.maximumEdition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.maximumEdition = 999; - break; - case "EDITION_2023": - case 1000: - message.maximumEdition = 1000; - break; - case "EDITION_2024": - case 1001: - message.maximumEdition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.maximumEdition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.maximumEdition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.maximumEdition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.maximumEdition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.maximumEdition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.maximumEdition = 2147483647; - break; - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetDefaults message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {google.protobuf.FeatureSetDefaults} message FeatureSetDefaults - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetDefaults.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.defaults = []; - if (options.defaults) { - object.minimumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.maximumEdition = options.enums === String ? "EDITION_UNKNOWN" : 0; - } - if (message.defaults && message.defaults.length) { - object.defaults = []; - for (var j = 0; j < message.defaults.length; ++j) - object.defaults[j] = $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.toObject(message.defaults[j], options); - } - if (message.minimumEdition != null && message.hasOwnProperty("minimumEdition")) - object.minimumEdition = options.enums === String ? $root.google.protobuf.Edition[message.minimumEdition] === undefined ? message.minimumEdition : $root.google.protobuf.Edition[message.minimumEdition] : message.minimumEdition; - if (message.maximumEdition != null && message.hasOwnProperty("maximumEdition")) - object.maximumEdition = options.enums === String ? $root.google.protobuf.Edition[message.maximumEdition] === undefined ? message.maximumEdition : $root.google.protobuf.Edition[message.maximumEdition] : message.maximumEdition; - return object; - }; - - /** - * Converts this FeatureSetDefaults to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults - * @instance - * @returns {Object.} JSON object - */ - FeatureSetDefaults.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetDefaults - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetDefaults.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults"; - }; - - FeatureSetDefaults.FeatureSetEditionDefault = (function() { - - /** - * Properties of a FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @interface IFeatureSetEditionDefault - * @property {google.protobuf.Edition|null} [edition] FeatureSetEditionDefault edition - * @property {google.protobuf.IFeatureSet|null} [overridableFeatures] FeatureSetEditionDefault overridableFeatures - * @property {google.protobuf.IFeatureSet|null} [fixedFeatures] FeatureSetEditionDefault fixedFeatures - */ - - /** - * Constructs a new FeatureSetEditionDefault. - * @memberof google.protobuf.FeatureSetDefaults - * @classdesc Represents a FeatureSetEditionDefault. - * @implements IFeatureSetEditionDefault - * @constructor - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - */ - function FeatureSetEditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSetEditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.edition = 0; - - /** - * FeatureSetEditionDefault overridableFeatures. - * @member {google.protobuf.IFeatureSet|null|undefined} overridableFeatures - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.overridableFeatures = null; - - /** - * FeatureSetEditionDefault fixedFeatures. - * @member {google.protobuf.IFeatureSet|null|undefined} fixedFeatures - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - */ - FeatureSetEditionDefault.prototype.fixedFeatures = null; - - /** - * Creates a new FeatureSetEditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault instance - */ - FeatureSetEditionDefault.create = function create(properties) { - return new FeatureSetEditionDefault(properties); - }; - - /** - * Encodes the specified FeatureSetEditionDefault message. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - if (message.overridableFeatures != null && Object.hasOwnProperty.call(message, "overridableFeatures")) - $root.google.protobuf.FeatureSet.encode(message.overridableFeatures, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.fixedFeatures != null && Object.hasOwnProperty.call(message, "fixedFeatures")) - $root.google.protobuf.FeatureSet.encode(message.fixedFeatures, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FeatureSetEditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.IFeatureSetEditionDefault} message FeatureSetEditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSetEditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 3: { - message.edition = reader.int32(); - break; - } - case 4: { - message.overridableFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.fixedFeatures = $root.google.protobuf.FeatureSet.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSetEditionDefault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSetEditionDefault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSetEditionDefault message. - * @function verify - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSetEditionDefault.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.edition != null && message.hasOwnProperty("edition")) - switch (message.edition) { - default: - return "edition: enum value expected"; - case 0: - case 900: - case 998: - case 999: - case 1000: - case 1001: - case 1: - case 2: - case 99997: - case 99998: - case 99999: - case 2147483647: - break; - } - if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) { - var error = $root.google.protobuf.FeatureSet.verify(message.overridableFeatures, long + 1); - if (error) - return "overridableFeatures." + error; - } - if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) { - var error = $root.google.protobuf.FeatureSet.verify(message.fixedFeatures, long + 1); - if (error) - return "fixedFeatures." + error; - } - return null; - }; - - /** - * Creates a FeatureSetEditionDefault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} FeatureSetEditionDefault - */ - FeatureSetEditionDefault.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNKNOWN": - case 0: - message.edition = 0; - break; - case "EDITION_LEGACY": - case 900: - message.edition = 900; - break; - case "EDITION_PROTO2": - case 998: - message.edition = 998; - break; - case "EDITION_PROTO3": - case 999: - message.edition = 999; - break; - case "EDITION_2023": - case 1000: - message.edition = 1000; - break; - case "EDITION_2024": - case 1001: - message.edition = 1001; - break; - case "EDITION_1_TEST_ONLY": - case 1: - message.edition = 1; - break; - case "EDITION_2_TEST_ONLY": - case 2: - message.edition = 2; - break; - case "EDITION_99997_TEST_ONLY": - case 99997: - message.edition = 99997; - break; - case "EDITION_99998_TEST_ONLY": - case 99998: - message.edition = 99998; - break; - case "EDITION_99999_TEST_ONLY": - case 99999: - message.edition = 99999; - break; - case "EDITION_MAX": - case 2147483647: - message.edition = 2147483647; - break; - } - if (object.overridableFeatures != null) { - if (typeof object.overridableFeatures !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.overridableFeatures: object expected"); - message.overridableFeatures = $root.google.protobuf.FeatureSet.fromObject(object.overridableFeatures, long + 1); - } - if (object.fixedFeatures != null) { - if (typeof object.fixedFeatures !== "object") - throw TypeError(".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.fixedFeatures: object expected"); - message.fixedFeatures = $root.google.protobuf.FeatureSet.fromObject(object.fixedFeatures, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a FeatureSetEditionDefault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault} message FeatureSetEditionDefault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSetEditionDefault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.edition = options.enums === String ? "EDITION_UNKNOWN" : 0; - object.overridableFeatures = null; - object.fixedFeatures = null; - } - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.protobuf.Edition[message.edition] === undefined ? message.edition : $root.google.protobuf.Edition[message.edition] : message.edition; - if (message.overridableFeatures != null && message.hasOwnProperty("overridableFeatures")) - object.overridableFeatures = $root.google.protobuf.FeatureSet.toObject(message.overridableFeatures, options); - if (message.fixedFeatures != null && message.hasOwnProperty("fixedFeatures")) - object.fixedFeatures = $root.google.protobuf.FeatureSet.toObject(message.fixedFeatures, options); - return object; - }; - - /** - * Converts this FeatureSetEditionDefault to JSON. - * @function toJSON - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @instance - * @returns {Object.} JSON object - */ - FeatureSetEditionDefault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSetEditionDefault - * @function getTypeUrl - * @memberof google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSetEditionDefault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"; - }; - - return FeatureSetEditionDefault; - })(); - - return FeatureSetDefaults; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SourceCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - } - case 3: { - message.leadingComments = reader.string(); - break; - } - case 4: { - message.trailingComments = reader.string(); - break; - } - case 6: { - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Location - * @function getTypeUrl - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GeneratedCodeInfo - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Annotation semantic. - * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.semantic = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - } - case 2: { - message.sourceFile = reader.string(); - break; - } - case 3: { - message.begin = reader.int32(); - break; - } - case 4: { - message.end = reader.int32(); - break; - } - case 5: { - message.semantic = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.semantic != null && message.hasOwnProperty("semantic")) - switch (message.semantic) { - default: - return "semantic: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - switch (object.semantic) { - default: - if (typeof object.semantic === "number") { - message.semantic = object.semantic; - break; - } - break; - case "NONE": - case 0: - message.semantic = 0; - break; - case "SET": - case 1: - message.semantic = 1; - break; - case "ALIAS": - case 2: - message.semantic = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - object.semantic = options.enums === String ? "NONE" : 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.semantic != null && message.hasOwnProperty("semantic")) - object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Annotation - * @function getTypeUrl - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; - }; - - /** - * Semantic enum. - * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic - * @enum {number} - * @property {number} NONE=0 NONE value - * @property {number} SET=1 SET value - * @property {number} ALIAS=2 ALIAS value - */ - Annotation.Semantic = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NONE"] = 0; - values[valuesById[1] = "SET"] = 1; - values[valuesById[2] = "ALIAS"] = 2; - return values; - })(); - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - /** - * SymbolVisibility enum. - * @name google.protobuf.SymbolVisibility - * @enum {number} - * @property {number} VISIBILITY_UNSET=0 VISIBILITY_UNSET value - * @property {number} VISIBILITY_LOCAL=1 VISIBILITY_LOCAL value - * @property {number} VISIBILITY_EXPORT=2 VISIBILITY_EXPORT value - */ - protobuf.SymbolVisibility = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VISIBILITY_UNSET"] = 0; - values[valuesById[1] = "VISIBILITY_LOCAL"] = 1; - values[valuesById[2] = "VISIBILITY_EXPORT"] = 2; - return values; - })(); - - protobuf.Duration = (function() { - - /** - * Properties of a Duration. - * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos - */ - - /** - * Constructs a new Duration. - * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration - * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set - */ - function Duration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Duration seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Duration nanos. - * @member {number} nanos - * @memberof google.protobuf.Duration - * @instance - */ - Duration.prototype.nanos = 0; - - /** - * Creates a new Duration instance using the specified properties. - * @function create - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance - */ - Duration.create = function create(properties) { - return new Duration(properties); - }; - - /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Duration message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Duration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Duration.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.protobuf.Duration) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.Duration(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Duration - * @static - * @param {google.protobuf.Duration} message Duration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Duration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Duration to JSON. - * @function toJSON - * @memberof google.protobuf.Duration - * @instance - * @returns {Object.} JSON object - */ - Duration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Duration - * @function getTypeUrl - * @memberof google.protobuf.Duration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Duration"; - }; - - return Duration; - })(); - - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type_url = reader.string(); - break; - } - case 2: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.protobuf.Any) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Any - * @function getTypeUrl - * @memberof google.protobuf.Any - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Any"; - }; - - return Any; - })(); - - protobuf.Empty = (function() { - - /** - * Properties of an Empty. - * @memberof google.protobuf - * @interface IEmpty - */ - - /** - * Constructs a new Empty. - * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty - * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set - */ - function Empty(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Creates a new Empty instance using the specified properties. - * @function create - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance - */ - Empty.create = function create(properties) { - return new Empty(properties); - }; - - /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Empty message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an Empty message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Empty - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Empty.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Empty message. - * @function verify - * @memberof google.protobuf.Empty - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Empty.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.protobuf.Empty) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - return new $root.google.protobuf.Empty(); - }; - - /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Empty - * @static - * @param {google.protobuf.Empty} message Empty - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Empty.toObject = function toObject() { - return {}; - }; - - /** - * Converts this Empty to JSON. - * @function toJSON - * @memberof google.protobuf.Empty - * @instance - * @returns {Object.} JSON object - */ - Empty.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Empty - * @function getTypeUrl - * @memberof google.protobuf.Empty - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Empty"; - }; - - return Empty; - })(); - - protobuf.Timestamp = (function() { - - /** - * Properties of a Timestamp. - * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos - */ - - /** - * Constructs a new Timestamp. - * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp - * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - */ - function Timestamp(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. - * @function create - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance - */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); - }; - - /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); - return writer; - }; - - /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Timestamp - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Timestamp message. - * @function verify - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Timestamp.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - return null; - }; - - /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Timestamp - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp - */ - Timestamp.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.Timestamp) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; - }; - - /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Timestamp - * @static - * @param {google.protobuf.Timestamp} message Timestamp - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; - }; - - /** - * Converts this Timestamp to JSON. - * @function toJSON - * @memberof google.protobuf.Timestamp - * @instance - * @returns {Object.} JSON object - */ - Timestamp.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Timestamp - * @function getTypeUrl - * @memberof google.protobuf.Timestamp - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Timestamp"; - }; - - return Timestamp; - })(); - - protobuf.Struct = (function() { - - /** - * Properties of a Struct. - * @memberof google.protobuf - * @interface IStruct - * @property {Object.|null} [fields] Struct fields - */ - - /** - * Constructs a new Struct. - * @memberof google.protobuf - * @classdesc Represents a Struct. - * @implements IStruct - * @constructor - * @param {google.protobuf.IStruct=} [properties] Properties to set - */ - function Struct(properties) { - this.fields = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Struct fields. - * @member {Object.} fields - * @memberof google.protobuf.Struct - * @instance - */ - Struct.prototype.fields = $util.emptyObject; - - /** - * Creates a new Struct instance using the specified properties. - * @function create - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct=} [properties] Properties to set - * @returns {google.protobuf.Struct} Struct instance - */ - Struct.create = function create(properties) { - return new Struct(properties); - }; - - /** - * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) - for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - return writer; - }; - - /** - * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {google.protobuf.IStruct} message Struct message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Struct.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Struct message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.fields === $util.emptyObject) - message.fields = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1); - break; - default: - reader.skipType(tag2 & 7, long); - break; - } - } - if (key === "__proto__") - $util.makeProp(message.fields, key); - message.fields[key] = value; - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Struct message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Struct - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Struct} Struct - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Struct.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Struct message. - * @function verify - * @memberof google.protobuf.Struct - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Struct.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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]], long + 1); - if (error) - return "fields." + error; - } - } - return null; - }; - - /** - * Creates a Struct message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Struct - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Struct} Struct - */ - Struct.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.Struct) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 (keys[i] === "__proto__") - $util.makeProp(message.fields, keys[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]], long + 1); - } - } - 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) { - if (keys2[j] === "__proto__") - $util.makeProp(object.fields, keys2[j]); - object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); - } - } - return object; - }; - - /** - * Converts this Struct to JSON. - * @function toJSON - * @memberof google.protobuf.Struct - * @instance - * @returns {Object.} JSON object - */ - Struct.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Struct - * @function getTypeUrl - * @memberof google.protobuf.Struct - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Struct.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Struct"; - }; - - return Struct; - })(); - - protobuf.Value = (function() { - - /** - * Properties of a Value. - * @memberof google.protobuf - * @interface IValue - * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue - * @property {number|null} [numberValue] Value numberValue - * @property {string|null} [stringValue] Value stringValue - * @property {boolean|null} [boolValue] Value boolValue - * @property {google.protobuf.IStruct|null} [structValue] Value structValue - * @property {google.protobuf.IListValue|null} [listValue] Value listValue - */ - - /** - * Constructs a new Value. - * @memberof google.protobuf - * @classdesc Represents a Value. - * @implements IValue - * @constructor - * @param {google.protobuf.IValue=} [properties] Properties to set - */ - function Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Value nullValue. - * @member {google.protobuf.NullValue|null|undefined} nullValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.nullValue = null; - - /** - * Value numberValue. - * @member {number|null|undefined} numberValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.numberValue = null; - - /** - * Value stringValue. - * @member {string|null|undefined} stringValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.stringValue = null; - - /** - * Value boolValue. - * @member {boolean|null|undefined} boolValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.boolValue = null; - - /** - * Value structValue. - * @member {google.protobuf.IStruct|null|undefined} structValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.structValue = null; - - /** - * Value listValue. - * @member {google.protobuf.IListValue|null|undefined} listValue - * @memberof google.protobuf.Value - * @instance - */ - Value.prototype.listValue = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Value kind. - * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind - * @memberof google.protobuf.Value - * @instance - */ - Object.defineProperty(Value.prototype, "kind", { - get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue=} [properties] Properties to set - * @returns {google.protobuf.Value} Value instance - */ - Value.create = function create(properties) { - return new Value(properties); - }; - - /** - * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); - if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); - if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); - if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) - $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) - $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.IValue} message Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.nullValue = reader.int32(); - break; - } - case 2: { - message.numberValue = reader.double(); - break; - } - case 3: { - message.stringValue = reader.string(); - break; - } - case 4: { - message.boolValue = reader.bool(); - break; - } - case 5: { - message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 6: { - message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Value} Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Value message. - * @function verify - * @memberof google.protobuf.Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Value.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long + 1); - 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, long + 1); - if (error) - return "listValue." + error; - } - } - return null; - }; - - /** - * Creates a Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Value} Value - */ - Value.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.Value) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.Value(); - switch (object.nullValue) { - default: - if (typeof object.nullValue === "number") { - message.nullValue = object.nullValue; - break; - } - break; - case "NULL_VALUE": - case 0: - message.nullValue = 0; - break; - } - if (object.numberValue != null) - message.numberValue = Number(object.numberValue); - if (object.stringValue != null) - message.stringValue = String(object.stringValue); - if (object.boolValue != null) - message.boolValue = Boolean(object.boolValue); - if (object.structValue != null) { - if (typeof object.structValue !== "object") - throw TypeError(".google.protobuf.Value.structValue: object expected"); - message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue, long + 1); - } - 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, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Value - * @static - * @param {google.protobuf.Value} message Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.nullValue != null && message.hasOwnProperty("nullValue")) { - object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] === undefined ? message.nullValue : $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; - if (options.oneofs) - object.kind = "nullValue"; - } - if (message.numberValue != null && message.hasOwnProperty("numberValue")) { - object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; - if (options.oneofs) - object.kind = "numberValue"; - } - if (message.stringValue != null && message.hasOwnProperty("stringValue")) { - object.stringValue = message.stringValue; - if (options.oneofs) - object.kind = "stringValue"; - } - if (message.boolValue != null && message.hasOwnProperty("boolValue")) { - object.boolValue = message.boolValue; - if (options.oneofs) - object.kind = "boolValue"; - } - if (message.structValue != null && message.hasOwnProperty("structValue")) { - object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); - if (options.oneofs) - object.kind = "structValue"; - } - if (message.listValue != null && message.hasOwnProperty("listValue")) { - object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); - if (options.oneofs) - object.kind = "listValue"; - } - return object; - }; - - /** - * Converts this Value to JSON. - * @function toJSON - * @memberof google.protobuf.Value - * @instance - * @returns {Object.} JSON object - */ - Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Value - * @function getTypeUrl - * @memberof google.protobuf.Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Value"; - }; - - return Value; - })(); - - /** - * NullValue enum. - * @name google.protobuf.NullValue - * @enum {number} - * @property {number} NULL_VALUE=0 NULL_VALUE value - */ - protobuf.NullValue = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NULL_VALUE"] = 0; - return values; - })(); - - protobuf.ListValue = (function() { - - /** - * Properties of a ListValue. - * @memberof google.protobuf - * @interface IListValue - * @property {Array.|null} [values] ListValue values - */ - - /** - * Constructs a new ListValue. - * @memberof google.protobuf - * @classdesc Represents a ListValue. - * @implements IListValue - * @constructor - * @param {google.protobuf.IListValue=} [properties] Properties to set - */ - function ListValue(properties) { - this.values = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListValue values. - * @member {Array.} values - * @memberof google.protobuf.ListValue - * @instance - */ - ListValue.prototype.values = $util.emptyArray; - - /** - * Creates a new ListValue instance using the specified properties. - * @function create - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue=} [properties] Properties to set - * @returns {google.protobuf.ListValue} ListValue instance - */ - ListValue.create = function create(properties) { - return new ListValue(properties); - }; - - /** - * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.IListValue} message ListValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a ListValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ListValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ListValue} ListValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListValue message. - * @function verify - * @memberof google.protobuf.ListValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListValue.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long) { - if (object instanceof $root.google.protobuf.ListValue) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a ListValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ListValue - * @static - * @param {google.protobuf.ListValue} message ListValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); - } - return object; - }; - - /** - * Converts this ListValue to JSON. - * @function toJSON - * @memberof google.protobuf.ListValue - * @instance - * @returns {Object.} JSON object - */ - ListValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListValue - * @function getTypeUrl - * @memberof google.protobuf.ListValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.ListValue"; - }; - - return ListValue; - })(); - - protobuf.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 && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * DoubleValue value. - * @member {number} value - * @memberof google.protobuf.DoubleValue - * @instance - */ - DoubleValue.prototype.value = 0; - - /** - * Creates a new DoubleValue instance using the specified properties. - * @function create - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue=} [properties] Properties to set - * @returns {google.protobuf.DoubleValue} DoubleValue instance - */ - DoubleValue.create = function create(properties) { - return new DoubleValue(properties); - }; - - /** - * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); - return writer; - }; - - /** - * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DoubleValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DoubleValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DoubleValue} DoubleValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DoubleValue.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.double(); - break; - } - default: - reader.skipType(tag & 7, long); - 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, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.protobuf.DoubleValue) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.DoubleValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DoubleValue - * @static - * @param {google.protobuf.DoubleValue} message DoubleValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DoubleValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this DoubleValue to JSON. - * @function toJSON - * @memberof google.protobuf.DoubleValue - * @instance - * @returns {Object.} JSON object - */ - DoubleValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DoubleValue - * @function getTypeUrl - * @memberof google.protobuf.DoubleValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.DoubleValue"; - }; - - return DoubleValue; - })(); - - protobuf.FloatValue = (function() { - - /** - * Properties of a FloatValue. - * @memberof google.protobuf - * @interface IFloatValue - * @property {number|null} [value] FloatValue value - */ - - /** - * Constructs a new FloatValue. - * @memberof google.protobuf - * @classdesc Represents a FloatValue. - * @implements IFloatValue - * @constructor - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - */ - function FloatValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * FloatValue value. - * @member {number} value - * @memberof google.protobuf.FloatValue - * @instance - */ - FloatValue.prototype.value = 0; - - /** - * Creates a new FloatValue instance using the specified properties. - * @function create - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue=} [properties] Properties to set - * @returns {google.protobuf.FloatValue} FloatValue instance - */ - FloatValue.create = function create(properties) { - return new FloatValue(properties); - }; - - /** - * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); - return writer; - }; - - /** - * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FloatValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.float(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a FloatValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FloatValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FloatValue} FloatValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FloatValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FloatValue message. - * @function verify - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FloatValue.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "number") - return "value: number expected"; - return null; - }; - - /** - * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FloatValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FloatValue} FloatValue - */ - FloatValue.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.FloatValue) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.FloatValue(); - if (object.value != null) - message.value = Number(object.value); - return message; - }; - - /** - * Creates a plain object from a FloatValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FloatValue - * @static - * @param {google.protobuf.FloatValue} message FloatValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FloatValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; - return object; - }; - - /** - * Converts this FloatValue to JSON. - * @function toJSON - * @memberof google.protobuf.FloatValue - * @instance - * @returns {Object.} JSON object - */ - FloatValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FloatValue - * @function getTypeUrl - * @memberof google.protobuf.FloatValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FloatValue"; - }; - - return FloatValue; - })(); - - protobuf.Int64Value = (function() { - - /** - * Properties of an Int64Value. - * @memberof google.protobuf - * @interface IInt64Value - * @property {number|Long|null} [value] Int64Value value - */ - - /** - * Constructs a new Int64Value. - * @memberof google.protobuf - * @classdesc Represents an Int64Value. - * @implements IInt64Value - * @constructor - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - */ - function Int64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int64Value value. - * @member {number|Long} value - * @memberof google.protobuf.Int64Value - * @instance - */ - Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Int64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value=} [properties] Properties to set - * @returns {google.protobuf.Int64Value} Int64Value instance - */ - Int64Value.create = function create(properties) { - return new Int64Value(properties); - }; - - /** - * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); - return writer; - }; - - /** - * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int64(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an Int64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int64Value} Int64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int64Value message. - * @function verify - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int64Value.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Int64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Int64Value} Int64Value - */ - Int64Value.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.Int64Value) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.Int64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = false; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from an Int64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int64Value - * @static - * @param {google.protobuf.Int64Value} message Int64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; - return object; - }; - - /** - * Converts this Int64Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int64Value - * @instance - * @returns {Object.} JSON object - */ - Int64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int64Value - * @function getTypeUrl - * @memberof google.protobuf.Int64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int64Value"; - }; - - return Int64Value; - })(); - - protobuf.UInt64Value = (function() { - - /** - * Properties of a UInt64Value. - * @memberof google.protobuf - * @interface IUInt64Value - * @property {number|Long|null} [value] UInt64Value value - */ - - /** - * Constructs a new UInt64Value. - * @memberof google.protobuf - * @classdesc Represents a UInt64Value. - * @implements IUInt64Value - * @constructor - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - */ - function UInt64Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt64Value value. - * @member {number|Long} value - * @memberof google.protobuf.UInt64Value - * @instance - */ - UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new UInt64Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value=} [properties] Properties to set - * @returns {google.protobuf.UInt64Value} UInt64Value instance - */ - UInt64Value.create = function create(properties) { - return new UInt64Value(properties); - }; - - /** - * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); - return writer; - }; - - /** - * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint64(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a UInt64Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt64Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt64Value} UInt64Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt64Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt64Value message. - * @function verify - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt64Value.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) - return "value: integer|Long expected"; - return null; - }; - - /** - * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt64Value} UInt64Value - */ - UInt64Value.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.UInt64Value) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.UInt64Value(); - if (object.value != null) - if ($util.Long) - (message.value = $util.Long.fromValue(object.value)).unsigned = true; - else if (typeof object.value === "string") - message.value = parseInt(object.value, 10); - else if (typeof object.value === "number") - message.value = object.value; - else if (typeof object.value === "object") - message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt64Value - * @static - * @param {google.protobuf.UInt64Value} message UInt64Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt64Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.value = options.longs === String ? "0" : 0; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value === "number") - object.value = options.longs === String ? String(message.value) : message.value; - else - object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; - return object; - }; - - /** - * Converts this UInt64Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt64Value - * @instance - * @returns {Object.} JSON object - */ - UInt64Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt64Value - * @function getTypeUrl - * @memberof google.protobuf.UInt64Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt64Value"; - }; - - return UInt64Value; - })(); - - protobuf.Int32Value = (function() { - - /** - * Properties of an Int32Value. - * @memberof google.protobuf - * @interface IInt32Value - * @property {number|null} [value] Int32Value value - */ - - /** - * Constructs a new Int32Value. - * @memberof google.protobuf - * @classdesc Represents an Int32Value. - * @implements IInt32Value - * @constructor - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - */ - function Int32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Int32Value value. - * @member {number} value - * @memberof google.protobuf.Int32Value - * @instance - */ - Int32Value.prototype.value = 0; - - /** - * Creates a new Int32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value=} [properties] Properties to set - * @returns {google.protobuf.Int32Value} Int32Value instance - */ - Int32Value.create = function create(properties) { - return new Int32Value(properties); - }; - - /** - * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); - return writer; - }; - - /** - * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Int32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.int32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an Int32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Int32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Int32Value} Int32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Int32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Int32Value message. - * @function verify - * @memberof google.protobuf.Int32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Int32Value.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.protobuf.Int32Value) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.Int32Value(); - if (object.value != null) - message.value = object.value | 0; - return message; - }; - - /** - * Creates a plain object from an Int32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Int32Value - * @static - * @param {google.protobuf.Int32Value} message Int32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Int32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this Int32Value to JSON. - * @function toJSON - * @memberof google.protobuf.Int32Value - * @instance - * @returns {Object.} JSON object - */ - Int32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Int32Value - * @function getTypeUrl - * @memberof google.protobuf.Int32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.Int32Value"; - }; - - return Int32Value; - })(); - - protobuf.UInt32Value = (function() { - - /** - * Properties of a UInt32Value. - * @memberof google.protobuf - * @interface IUInt32Value - * @property {number|null} [value] UInt32Value value - */ - - /** - * Constructs a new UInt32Value. - * @memberof google.protobuf - * @classdesc Represents a UInt32Value. - * @implements IUInt32Value - * @constructor - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - */ - function UInt32Value(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * UInt32Value value. - * @member {number} value - * @memberof google.protobuf.UInt32Value - * @instance - */ - UInt32Value.prototype.value = 0; - - /** - * Creates a new UInt32Value instance using the specified properties. - * @function create - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value=} [properties] Properties to set - * @returns {google.protobuf.UInt32Value} UInt32Value instance - */ - UInt32Value.create = function create(properties) { - return new UInt32Value(properties); - }; - - /** - * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); - return writer; - }; - - /** - * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.uint32(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a UInt32Value message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UInt32Value - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UInt32Value} UInt32Value - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UInt32Value.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a UInt32Value message. - * @function verify - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UInt32Value.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isInteger(message.value)) - return "value: integer expected"; - return null; - }; - - /** - * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UInt32Value} UInt32Value - */ - UInt32Value.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.UInt32Value) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.UInt32Value(); - if (object.value != null) - message.value = object.value >>> 0; - return message; - }; - - /** - * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UInt32Value - * @static - * @param {google.protobuf.UInt32Value} message UInt32Value - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UInt32Value.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = 0; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this UInt32Value to JSON. - * @function toJSON - * @memberof google.protobuf.UInt32Value - * @instance - * @returns {Object.} JSON object - */ - UInt32Value.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UInt32Value - * @function getTypeUrl - * @memberof google.protobuf.UInt32Value - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.UInt32Value"; - }; - - return UInt32Value; - })(); - - protobuf.BoolValue = (function() { - - /** - * Properties of a BoolValue. - * @memberof google.protobuf - * @interface IBoolValue - * @property {boolean|null} [value] BoolValue value - */ - - /** - * Constructs a new BoolValue. - * @memberof google.protobuf - * @classdesc Represents a BoolValue. - * @implements IBoolValue - * @constructor - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - */ - function BoolValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * BoolValue value. - * @member {boolean} value - * @memberof google.protobuf.BoolValue - * @instance - */ - BoolValue.prototype.value = false; - - /** - * Creates a new BoolValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue=} [properties] Properties to set - * @returns {google.protobuf.BoolValue} BoolValue instance - */ - BoolValue.create = function create(properties) { - return new BoolValue(properties); - }; - - /** - * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); - return writer; - }; - - /** - * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BoolValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bool(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a BoolValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BoolValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BoolValue} BoolValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BoolValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BoolValue message. - * @function verify - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BoolValue.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.value != null && message.hasOwnProperty("value")) - if (typeof message.value !== "boolean") - return "value: boolean expected"; - return null; - }; - - /** - * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BoolValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BoolValue} BoolValue - */ - BoolValue.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.BoolValue) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.BoolValue(); - if (object.value != null) - message.value = Boolean(object.value); - return message; - }; - - /** - * Creates a plain object from a BoolValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BoolValue - * @static - * @param {google.protobuf.BoolValue} message BoolValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BoolValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = false; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this BoolValue to JSON. - * @function toJSON - * @memberof google.protobuf.BoolValue - * @instance - * @returns {Object.} JSON object - */ - BoolValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BoolValue - * @function getTypeUrl - * @memberof google.protobuf.BoolValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BoolValue"; - }; - - return BoolValue; - })(); - - protobuf.StringValue = (function() { - - /** - * Properties of a StringValue. - * @memberof google.protobuf - * @interface IStringValue - * @property {string|null} [value] StringValue value - */ - - /** - * Constructs a new StringValue. - * @memberof google.protobuf - * @classdesc Represents a StringValue. - * @implements IStringValue - * @constructor - * @param {google.protobuf.IStringValue=} [properties] Properties to set - */ - function StringValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * StringValue value. - * @member {string} value - * @memberof google.protobuf.StringValue - * @instance - */ - StringValue.prototype.value = ""; - - /** - * Creates a new StringValue instance using the specified properties. - * @function create - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue=} [properties] Properties to set - * @returns {google.protobuf.StringValue} StringValue instance - */ - StringValue.create = function create(properties) { - return new StringValue(properties); - }; - - /** - * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StringValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StringValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a StringValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.StringValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.StringValue} StringValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StringValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StringValue message. - * @function verify - * @memberof google.protobuf.StringValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StringValue.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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, long) { - if (object instanceof $root.google.protobuf.StringValue) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.StringValue(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a StringValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.StringValue - * @static - * @param {google.protobuf.StringValue} message StringValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StringValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this StringValue to JSON. - * @function toJSON - * @memberof google.protobuf.StringValue - * @instance - * @returns {Object.} JSON object - */ - StringValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StringValue - * @function getTypeUrl - * @memberof google.protobuf.StringValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.StringValue"; - }; - - return StringValue; - })(); - - protobuf.BytesValue = (function() { - - /** - * Properties of a BytesValue. - * @memberof google.protobuf - * @interface IBytesValue - * @property {Uint8Array|null} [value] BytesValue value - */ - - /** - * Constructs a new BytesValue. - * @memberof google.protobuf - * @classdesc Represents a BytesValue. - * @implements IBytesValue - * @constructor - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - */ - function BytesValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * BytesValue value. - * @member {Uint8Array} value - * @memberof google.protobuf.BytesValue - * @instance - */ - BytesValue.prototype.value = $util.newBuffer([]); - - /** - * Creates a new BytesValue instance using the specified properties. - * @function create - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue=} [properties] Properties to set - * @returns {google.protobuf.BytesValue} BytesValue instance - */ - BytesValue.create = function create(properties) { - return new BytesValue(properties); - }; - - /** - * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encode - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BytesValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.value = reader.bytes(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a BytesValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.BytesValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.BytesValue} BytesValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BytesValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BytesValue message. - * @function verify - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BytesValue.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.BytesValue - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.BytesValue} BytesValue - */ - BytesValue.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.protobuf.BytesValue) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.protobuf.BytesValue(); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length >= 0) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from a BytesValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.BytesValue - * @static - * @param {google.protobuf.BytesValue} message BytesValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BytesValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this BytesValue to JSON. - * @function toJSON - * @memberof google.protobuf.BytesValue - * @instance - * @returns {Object.} JSON object - */ - BytesValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BytesValue - * @function getTypeUrl - * @memberof google.protobuf.BytesValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.BytesValue"; - }; - - return BytesValue; - })(); - - return protobuf; - })(); - - google.longrunning = (function() { - - /** - * Namespace longrunning. - * @memberof google - * @namespace - */ - var longrunning = {}; - - longrunning.Operations = (function() { - - /** - * Constructs a new Operations service. - * @memberof google.longrunning - * @classdesc Represents an Operations - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Operations(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Operations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Operations; - - /** - * Creates new Operations service using the specified rpc implementation. - * @function create - * @memberof google.longrunning.Operations - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Operations} RPC service. Useful where requests and/or responses are streamed. - */ - Operations.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.longrunning.Operations|listOperations}. - * @memberof google.longrunning.Operations - * @typedef ListOperationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.ListOperationsResponse} [response] ListOperationsResponse - */ - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @param {google.longrunning.Operations.ListOperationsCallback} callback Node-style callback called with the error, if any, and ListOperationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.listOperations = function listOperations(request, callback) { - return this.rpcCall(listOperations, $root.google.longrunning.ListOperationsRequest, $root.google.longrunning.ListOperationsResponse, request, callback); - }, "name", { value: "ListOperations" }); - - /** - * Calls ListOperations. - * @function listOperations - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IListOperationsRequest} request ListOperationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|getOperation}. - * @memberof google.longrunning.Operations - * @typedef GetOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @param {google.longrunning.Operations.GetOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.getOperation = function getOperation(request, callback) { - return this.rpcCall(getOperation, $root.google.longrunning.GetOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "GetOperation" }); - - /** - * Calls GetOperation. - * @function getOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IGetOperationRequest} request GetOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|deleteOperation}. - * @memberof google.longrunning.Operations - * @typedef DeleteOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @param {google.longrunning.Operations.DeleteOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.deleteOperation = function deleteOperation(request, callback) { - return this.rpcCall(deleteOperation, $root.google.longrunning.DeleteOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteOperation" }); - - /** - * Calls DeleteOperation. - * @function deleteOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IDeleteOperationRequest} request DeleteOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|cancelOperation}. - * @memberof google.longrunning.Operations - * @typedef CancelOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @param {google.longrunning.Operations.CancelOperationCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.cancelOperation = function cancelOperation(request, callback) { - return this.rpcCall(cancelOperation, $root.google.longrunning.CancelOperationRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "CancelOperation" }); - - /** - * Calls CancelOperation. - * @function cancelOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.ICancelOperationRequest} request CancelOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.longrunning.Operations|waitOperation}. - * @memberof google.longrunning.Operations - * @typedef WaitOperationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @param {google.longrunning.Operations.WaitOperationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Operations.prototype.waitOperation = function waitOperation(request, callback) { - return this.rpcCall(waitOperation, $root.google.longrunning.WaitOperationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "WaitOperation" }); - - /** - * Calls WaitOperation. - * @function waitOperation - * @memberof google.longrunning.Operations - * @instance - * @param {google.longrunning.IWaitOperationRequest} request WaitOperationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Operations; - })(); - - longrunning.Operation = (function() { - - /** - * Properties of an Operation. - * @memberof google.longrunning - * @interface IOperation - * @property {string|null} [name] Operation name - * @property {google.protobuf.IAny|null} [metadata] Operation metadata - * @property {boolean|null} [done] Operation done - * @property {google.rpc.IStatus|null} [error] Operation error - * @property {google.protobuf.IAny|null} [response] Operation response - */ - - /** - * Constructs a new Operation. - * @memberof google.longrunning - * @classdesc Represents an Operation. - * @implements IOperation - * @constructor - * @param {google.longrunning.IOperation=} [properties] Properties to set - */ - function Operation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Operation name. - * @member {string} name - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.name = ""; - - /** - * Operation metadata. - * @member {google.protobuf.IAny|null|undefined} metadata - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.metadata = null; - - /** - * Operation done. - * @member {boolean} done - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.done = false; - - /** - * Operation error. - * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.error = null; - - /** - * Operation response. - * @member {google.protobuf.IAny|null|undefined} response - * @memberof google.longrunning.Operation - * @instance - */ - Operation.prototype.response = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Operation result. - * @member {"error"|"response"|undefined} result - * @memberof google.longrunning.Operation - * @instance - */ - Object.defineProperty(Operation.prototype, "result", { - get: $util.oneOfGetter($oneOfFields = ["error", "response"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Operation instance using the specified properties. - * @function create - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation=} [properties] Properties to set - * @returns {google.longrunning.Operation} Operation instance - */ - Operation.create = function create(properties) { - return new Operation(properties); - }; - - /** - * Encodes the specified Operation message. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encode - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.done != null && Object.hasOwnProperty.call(message, "done")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.response != null && Object.hasOwnProperty.call(message, "response")) - $root.google.protobuf.Any.encode(message.response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Operation message, length delimited. Does not implicitly {@link google.longrunning.Operation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.IOperation} message Operation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Operation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Operation message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.Operation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.metadata = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 3: { - message.done = reader.bool(); - break; - } - case 4: { - message.error = $root.google.rpc.Status.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - case 5: { - message.response = $root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an Operation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.Operation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.Operation} Operation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Operation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Operation message. - * @function verify - * @memberof google.longrunning.Operation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Operation.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.protobuf.Any.verify(message.metadata, long + 1); - if (error) - return "metadata." + error; - } - if (message.done != null && message.hasOwnProperty("done")) - if (typeof message.done !== "boolean") - return "done: boolean expected"; - if (message.error != null && message.hasOwnProperty("error")) { - properties.result = 1; - { - var error = $root.google.rpc.Status.verify(message.error, long + 1); - if (error) - return "error." + error; - } - } - if (message.response != null && message.hasOwnProperty("response")) { - if (properties.result === 1) - return "result: multiple values"; - properties.result = 1; - { - var error = $root.google.protobuf.Any.verify(message.response, long + 1); - if (error) - return "response." + error; - } - } - return null; - }; - - /** - * Creates an Operation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.Operation - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.Operation} Operation - */ - Operation.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.longrunning.Operation) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.longrunning.Operation(); - if (object.name != null) - message.name = String(object.name); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.longrunning.Operation.metadata: object expected"); - message.metadata = $root.google.protobuf.Any.fromObject(object.metadata, long + 1); - } - if (object.done != null) - message.done = Boolean(object.done); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".google.longrunning.Operation.error: object expected"); - message.error = $root.google.rpc.Status.fromObject(object.error, long + 1); - } - if (object.response != null) { - if (typeof object.response !== "object") - throw TypeError(".google.longrunning.Operation.response: object expected"); - message.response = $root.google.protobuf.Any.fromObject(object.response, long + 1); - } - return message; - }; - - /** - * Creates a plain object from an Operation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.Operation - * @static - * @param {google.longrunning.Operation} message Operation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Operation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.metadata = null; - object.done = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.protobuf.Any.toObject(message.metadata, options); - if (message.done != null && message.hasOwnProperty("done")) - object.done = message.done; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.google.rpc.Status.toObject(message.error, options); - if (options.oneofs) - object.result = "error"; - } - if (message.response != null && message.hasOwnProperty("response")) { - object.response = $root.google.protobuf.Any.toObject(message.response, options); - if (options.oneofs) - object.result = "response"; - } - return object; - }; - - /** - * Converts this Operation to JSON. - * @function toJSON - * @memberof google.longrunning.Operation - * @instance - * @returns {Object.} JSON object - */ - Operation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Operation - * @function getTypeUrl - * @memberof google.longrunning.Operation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Operation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.Operation"; - }; - - return Operation; - })(); - - longrunning.GetOperationRequest = (function() { - - /** - * Properties of a GetOperationRequest. - * @memberof google.longrunning - * @interface IGetOperationRequest - * @property {string|null} [name] GetOperationRequest name - */ - - /** - * Constructs a new GetOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a GetOperationRequest. - * @implements IGetOperationRequest - * @constructor - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - */ - function GetOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetOperationRequest name. - * @member {string} name - * @memberof google.longrunning.GetOperationRequest - * @instance - */ - GetOperationRequest.prototype.name = ""; - - /** - * Creates a new GetOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest instance - */ - GetOperationRequest.create = function create(properties) { - return new GetOperationRequest(properties); - }; - - /** - * Encodes the specified GetOperationRequest message. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified GetOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.GetOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.IGetOperationRequest} message GetOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.GetOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a GetOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetOperationRequest message. - * @function verify - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetOperationRequest.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a GetOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.GetOperationRequest} GetOperationRequest - */ - GetOperationRequest.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.longrunning.GetOperationRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.longrunning.GetOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {google.longrunning.GetOperationRequest} message GetOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this GetOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.GetOperationRequest - * @instance - * @returns {Object.} JSON object - */ - GetOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.GetOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.GetOperationRequest"; - }; - - return GetOperationRequest; - })(); - - longrunning.ListOperationsRequest = (function() { - - /** - * Properties of a ListOperationsRequest. - * @memberof google.longrunning - * @interface IListOperationsRequest - * @property {string|null} [name] ListOperationsRequest name - * @property {string|null} [filter] ListOperationsRequest filter - * @property {number|null} [pageSize] ListOperationsRequest pageSize - * @property {string|null} [pageToken] ListOperationsRequest pageToken - */ - - /** - * Constructs a new ListOperationsRequest. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsRequest. - * @implements IListOperationsRequest - * @constructor - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - */ - function ListOperationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsRequest name. - * @member {string} name - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.name = ""; - - /** - * ListOperationsRequest filter. - * @member {string} filter - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.filter = ""; - - /** - * ListOperationsRequest pageSize. - * @member {number} pageSize - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageSize = 0; - - /** - * ListOperationsRequest pageToken. - * @member {string} pageToken - * @memberof google.longrunning.ListOperationsRequest - * @instance - */ - ListOperationsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListOperationsRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest instance - */ - ListOperationsRequest.create = function create(properties) { - return new ListOperationsRequest(properties); - }; - - /** - * Encodes the specified ListOperationsRequest message. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); - return writer; - }; - - /** - * Encodes the specified ListOperationsRequest message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.IListOperationsRequest} message ListOperationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 4: { - message.name = reader.string(); - break; - } - case 1: { - message.filter = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsRequest message. - * @function verify - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsRequest.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsRequest} ListOperationsRequest - */ - ListOperationsRequest.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.longrunning.ListOperationsRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.longrunning.ListOperationsRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {google.longrunning.ListOperationsRequest} message ListOperationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.name = ""; - } - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this ListOperationsRequest to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListOperationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsRequest - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsRequest"; - }; - - return ListOperationsRequest; - })(); - - longrunning.ListOperationsResponse = (function() { - - /** - * Properties of a ListOperationsResponse. - * @memberof google.longrunning - * @interface IListOperationsResponse - * @property {Array.|null} [operations] ListOperationsResponse operations - * @property {string|null} [nextPageToken] ListOperationsResponse nextPageToken - */ - - /** - * Constructs a new ListOperationsResponse. - * @memberof google.longrunning - * @classdesc Represents a ListOperationsResponse. - * @implements IListOperationsResponse - * @constructor - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - */ - function ListOperationsResponse(properties) { - this.operations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListOperationsResponse operations. - * @member {Array.} operations - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.operations = $util.emptyArray; - - /** - * ListOperationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.longrunning.ListOperationsResponse - * @instance - */ - ListOperationsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListOperationsResponse instance using the specified properties. - * @function create - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse=} [properties] Properties to set - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse instance - */ - ListOperationsResponse.create = function create(properties) { - return new ListOperationsResponse(properties); - }; - - /** - * Encodes the specified ListOperationsResponse message. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operations != null && message.operations.length) - for (var i = 0; i < message.operations.length; ++i) - $root.google.longrunning.Operation.encode(message.operations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListOperationsResponse message, length delimited. Does not implicitly {@link google.longrunning.ListOperationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.IListOperationsResponse} message ListOperationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListOperationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.ListOperationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.operations && message.operations.length)) - message.operations = []; - message.operations.push($root.google.longrunning.Operation.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a ListOperationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListOperationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListOperationsResponse message. - * @function verify - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListOperationsResponse.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.operations != null && message.hasOwnProperty("operations")) { - if (!Array.isArray(message.operations)) - return "operations: array expected"; - for (var i = 0; i < message.operations.length; ++i) { - var error = $root.google.longrunning.Operation.verify(message.operations[i], long + 1); - if (error) - return "operations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListOperationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.ListOperationsResponse} ListOperationsResponse - */ - ListOperationsResponse.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.longrunning.ListOperationsResponse) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.longrunning.ListOperationsResponse(); - if (object.operations) { - if (!Array.isArray(object.operations)) - throw TypeError(".google.longrunning.ListOperationsResponse.operations: array expected"); - message.operations = []; - for (var i = 0; i < object.operations.length; ++i) { - if (typeof object.operations[i] !== "object") - throw TypeError(".google.longrunning.ListOperationsResponse.operations: object expected"); - message.operations[i] = $root.google.longrunning.Operation.fromObject(object.operations[i], long + 1); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListOperationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {google.longrunning.ListOperationsResponse} message ListOperationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListOperationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.operations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.operations && message.operations.length) { - object.operations = []; - for (var j = 0; j < message.operations.length; ++j) - object.operations[j] = $root.google.longrunning.Operation.toObject(message.operations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListOperationsResponse to JSON. - * @function toJSON - * @memberof google.longrunning.ListOperationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListOperationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListOperationsResponse - * @function getTypeUrl - * @memberof google.longrunning.ListOperationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListOperationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.ListOperationsResponse"; - }; - - return ListOperationsResponse; - })(); - - longrunning.CancelOperationRequest = (function() { - - /** - * Properties of a CancelOperationRequest. - * @memberof google.longrunning - * @interface ICancelOperationRequest - * @property {string|null} [name] CancelOperationRequest name - */ - - /** - * Constructs a new CancelOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a CancelOperationRequest. - * @implements ICancelOperationRequest - * @constructor - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - */ - function CancelOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * CancelOperationRequest name. - * @member {string} name - * @memberof google.longrunning.CancelOperationRequest - * @instance - */ - CancelOperationRequest.prototype.name = ""; - - /** - * Creates a new CancelOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest instance - */ - CancelOperationRequest.create = function create(properties) { - return new CancelOperationRequest(properties); - }; - - /** - * Encodes the specified CancelOperationRequest message. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified CancelOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.CancelOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.ICancelOperationRequest} message CancelOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CancelOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.CancelOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a CancelOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CancelOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CancelOperationRequest message. - * @function verify - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CancelOperationRequest.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a CancelOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.CancelOperationRequest} CancelOperationRequest - */ - CancelOperationRequest.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.longrunning.CancelOperationRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.longrunning.CancelOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a CancelOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {google.longrunning.CancelOperationRequest} message CancelOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CancelOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this CancelOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.CancelOperationRequest - * @instance - * @returns {Object.} JSON object - */ - CancelOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CancelOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.CancelOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CancelOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.CancelOperationRequest"; - }; - - return CancelOperationRequest; - })(); - - longrunning.DeleteOperationRequest = (function() { - - /** - * Properties of a DeleteOperationRequest. - * @memberof google.longrunning - * @interface IDeleteOperationRequest - * @property {string|null} [name] DeleteOperationRequest name - */ - - /** - * Constructs a new DeleteOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a DeleteOperationRequest. - * @implements IDeleteOperationRequest - * @constructor - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - */ - function DeleteOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteOperationRequest name. - * @member {string} name - * @memberof google.longrunning.DeleteOperationRequest - * @instance - */ - DeleteOperationRequest.prototype.name = ""; - - /** - * Creates a new DeleteOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest instance - */ - DeleteOperationRequest.create = function create(properties) { - return new DeleteOperationRequest(properties); - }; - - /** - * Encodes the specified DeleteOperationRequest message. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; - - /** - * Encodes the specified DeleteOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.DeleteOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.IDeleteOperationRequest} message DeleteOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.DeleteOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteOperationRequest message. - * @function verify - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteOperationRequest.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates a DeleteOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.DeleteOperationRequest} DeleteOperationRequest - */ - DeleteOperationRequest.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.longrunning.DeleteOperationRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.longrunning.DeleteOperationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a DeleteOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {google.longrunning.DeleteOperationRequest} message DeleteOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.DeleteOperationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.DeleteOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.DeleteOperationRequest"; - }; - - return DeleteOperationRequest; - })(); - - longrunning.WaitOperationRequest = (function() { - - /** - * Properties of a WaitOperationRequest. - * @memberof google.longrunning - * @interface IWaitOperationRequest - * @property {string|null} [name] WaitOperationRequest name - * @property {google.protobuf.IDuration|null} [timeout] WaitOperationRequest timeout - */ - - /** - * Constructs a new WaitOperationRequest. - * @memberof google.longrunning - * @classdesc Represents a WaitOperationRequest. - * @implements IWaitOperationRequest - * @constructor - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - */ - function WaitOperationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * WaitOperationRequest name. - * @member {string} name - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.name = ""; - - /** - * WaitOperationRequest timeout. - * @member {google.protobuf.IDuration|null|undefined} timeout - * @memberof google.longrunning.WaitOperationRequest - * @instance - */ - WaitOperationRequest.prototype.timeout = null; - - /** - * Creates a new WaitOperationRequest instance using the specified properties. - * @function create - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest=} [properties] Properties to set - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest instance - */ - WaitOperationRequest.create = function create(properties) { - return new WaitOperationRequest(properties); - }; - - /** - * Encodes the specified WaitOperationRequest message. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && Object.hasOwnProperty.call(message, "timeout")) - $root.google.protobuf.Duration.encode(message.timeout, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified WaitOperationRequest message, length delimited. Does not implicitly {@link google.longrunning.WaitOperationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.IWaitOperationRequest} message WaitOperationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WaitOperationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.WaitOperationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.timeout = $root.google.protobuf.Duration.decode(reader, reader.uint32(), undefined, long + 1); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a WaitOperationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WaitOperationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WaitOperationRequest message. - * @function verify - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WaitOperationRequest.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.timeout != null && message.hasOwnProperty("timeout")) { - var error = $root.google.protobuf.Duration.verify(message.timeout, long + 1); - if (error) - return "timeout." + error; - } - return null; - }; - - /** - * Creates a WaitOperationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.WaitOperationRequest} WaitOperationRequest - */ - WaitOperationRequest.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.longrunning.WaitOperationRequest) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.longrunning.WaitOperationRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.timeout != null) { - if (typeof object.timeout !== "object") - throw TypeError(".google.longrunning.WaitOperationRequest.timeout: object expected"); - message.timeout = $root.google.protobuf.Duration.fromObject(object.timeout, long + 1); - } - return message; - }; - - /** - * Creates a plain object from a WaitOperationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {google.longrunning.WaitOperationRequest} message WaitOperationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WaitOperationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.timeout = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.timeout != null && message.hasOwnProperty("timeout")) - object.timeout = $root.google.protobuf.Duration.toObject(message.timeout, options); - return object; - }; - - /** - * Converts this WaitOperationRequest to JSON. - * @function toJSON - * @memberof google.longrunning.WaitOperationRequest - * @instance - * @returns {Object.} JSON object - */ - WaitOperationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WaitOperationRequest - * @function getTypeUrl - * @memberof google.longrunning.WaitOperationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WaitOperationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.WaitOperationRequest"; - }; - - return WaitOperationRequest; - })(); - - longrunning.OperationInfo = (function() { - - /** - * Properties of an OperationInfo. - * @memberof google.longrunning - * @interface IOperationInfo - * @property {string|null} [responseType] OperationInfo responseType - * @property {string|null} [metadataType] OperationInfo metadataType - */ - - /** - * Constructs a new OperationInfo. - * @memberof google.longrunning - * @classdesc Represents an OperationInfo. - * @implements IOperationInfo - * @constructor - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - */ - function OperationInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationInfo responseType. - * @member {string} responseType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.responseType = ""; - - /** - * OperationInfo metadataType. - * @member {string} metadataType - * @memberof google.longrunning.OperationInfo - * @instance - */ - OperationInfo.prototype.metadataType = ""; - - /** - * Creates a new OperationInfo instance using the specified properties. - * @function create - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo=} [properties] Properties to set - * @returns {google.longrunning.OperationInfo} OperationInfo instance - */ - OperationInfo.create = function create(properties) { - return new OperationInfo(properties); - }; - - /** - * Encodes the specified OperationInfo message. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encode - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); - return writer; - }; - - /** - * Encodes the specified OperationInfo message, length delimited. Does not implicitly {@link google.longrunning.OperationInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.IOperationInfo} message OperationInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer. - * @function decode - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.longrunning.OperationInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.responseType = reader.string(); - break; - } - case 2: { - message.metadataType = reader.string(); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes an OperationInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.longrunning.OperationInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.longrunning.OperationInfo} OperationInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationInfo message. - * @function verify - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationInfo.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - if (message.responseType != null && message.hasOwnProperty("responseType")) - if (!$util.isString(message.responseType)) - return "responseType: string expected"; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - if (!$util.isString(message.metadataType)) - return "metadataType: string expected"; - return null; - }; - - /** - * Creates an OperationInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {Object.} object Plain object - * @returns {google.longrunning.OperationInfo} OperationInfo - */ - OperationInfo.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.longrunning.OperationInfo) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var message = new $root.google.longrunning.OperationInfo(); - if (object.responseType != null) - message.responseType = String(object.responseType); - if (object.metadataType != null) - message.metadataType = String(object.metadataType); - return message; - }; - - /** - * Creates a plain object from an OperationInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.longrunning.OperationInfo - * @static - * @param {google.longrunning.OperationInfo} message OperationInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseType = ""; - object.metadataType = ""; - } - if (message.responseType != null && message.hasOwnProperty("responseType")) - object.responseType = message.responseType; - if (message.metadataType != null && message.hasOwnProperty("metadataType")) - object.metadataType = message.metadataType; - return object; - }; - - /** - * Converts this OperationInfo to JSON. - * @function toJSON - * @memberof google.longrunning.OperationInfo - * @instance - * @returns {Object.} JSON object - */ - OperationInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationInfo - * @function getTypeUrl - * @memberof google.longrunning.OperationInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.longrunning.OperationInfo"; - }; - - return OperationInfo; - })(); - - return longrunning; - })(); - - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null && keys[i] !== "__proto__") - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32(), undefined, long + 1)); - break; - } - default: - reader.skipType(tag & 7, long); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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], long + 1); - 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, long) { - if (object instanceof $root.google.rpc.Status) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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], long + 1); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - - google.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 && keys[i] !== "__proto__") - 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, error, long) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - if (long === undefined) - long = 0; - if (long > $Reader.recursionLimit) - throw Error("maximum nesting depth exceeded"); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.latitude = reader.double(); - break; - } - case 2: { - message.longitude = reader.double(); - break; - } - default: - reader.skipType(tag & 7, long); - 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.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.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a LatLng message. - * @function verify - * @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 - */ - LatLng.verify = function verify(message, long) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - return "maximum nesting depth exceeded"; - 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 LatLng message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.type.LatLng - * @static - * @param {Object.} object Plain object - * @returns {google.type.LatLng} LatLng - */ - LatLng.fromObject = function fromObject(object, long) { - if (object instanceof $root.google.type.LatLng) - return object; - if (long === undefined) - long = 0; - if (long > $util.recursionLimit) - throw Error("maximum nesting depth exceeded"); - 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 LatLng message. Also converts values to other types if specified. - * @function toObject - * @memberof google.type.LatLng - * @static - * @param {google.type.LatLng} message LatLng - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LatLng.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; - return object; - }; - - /** - * Converts this LatLng to JSON. - * @function toJSON - * @memberof google.type.LatLng - * @instance - * @returns {Object.} JSON object - */ - LatLng.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for LatLng - * @function getTypeUrl - * @memberof google.type.LatLng - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.type.LatLng"; - }; - - return LatLng; - })(); - - return type; - })(); - - return google; - })(); - - return $root; -}); diff --git a/handwritten/datastore/protos/protos.json b/handwritten/datastore/protos/protos.json deleted file mode 100644 index 78a7a54b6595..000000000000 --- a/handwritten/datastore/protos/protos.json +++ /dev/null @@ -1,4555 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "datastore": { - "nested": { - "admin": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Datastore.Admin.V1", - "go_package": "cloud.google.com/go/datastore/admin/apiv1/adminpb;adminpb", - "java_multiple_files": true, - "java_outer_classname": "MigrationProto", - "java_package": "com.google.datastore.admin.v1", - "php_namespace": "Google\\Cloud\\Datastore\\Admin\\V1", - "ruby_package": "Google::Cloud::Datastore::Admin::V1" - }, - "nested": { - "DatastoreAdmin": { - "options": { - "(google.api.default_host)": "datastore.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastore" - }, - "methods": { - "ExportEntities": { - "requestType": "ExportEntitiesRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:export", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id,labels,entity_filter,output_url_prefix", - "(google.longrunning.operation_info).response_type": "ExportEntitiesResponse", - "(google.longrunning.operation_info).metadata_type": "ExportEntitiesMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:export", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id,labels,entity_filter,output_url_prefix" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ExportEntitiesResponse", - "metadata_type": "ExportEntitiesMetadata" - } - } - ] - }, - "ImportEntities": { - "requestType": "ImportEntitiesRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:import", - "(google.api.http).body": "*", - "(google.api.method_signature)": "project_id,labels,input_url,entity_filter", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "ImportEntitiesMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:import", - "body": "*" - } - }, - { - "(google.api.method_signature)": "project_id,labels,input_url,entity_filter" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "ImportEntitiesMetadata" - } - } - ] - }, - "CreateIndex": { - "requestType": "CreateIndexRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}/indexes", - "(google.api.http).body": "index", - "(google.longrunning.operation_info).response_type": "Index", - "(google.longrunning.operation_info).metadata_type": "IndexOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}/indexes", - "body": "index" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Index", - "metadata_type": "IndexOperationMetadata" - } - } - ] - }, - "DeleteIndex": { - "requestType": "DeleteIndexRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/projects/{project_id}/indexes/{index_id}", - "(google.longrunning.operation_info).response_type": "Index", - "(google.longrunning.operation_info).metadata_type": "IndexOperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/projects/{project_id}/indexes/{index_id}" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Index", - "metadata_type": "IndexOperationMetadata" - } - } - ] - }, - "GetIndex": { - "requestType": "GetIndexRequest", - "responseType": "Index", - "options": { - "(google.api.http).get": "/v1/projects/{project_id}/indexes/{index_id}" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/projects/{project_id}/indexes/{index_id}" - } - } - ] - }, - "ListIndexes": { - "requestType": "ListIndexesRequest", - "responseType": "ListIndexesResponse", - "options": { - "(google.api.http).get": "/v1/projects/{project_id}/indexes" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/projects/{project_id}/indexes" - } - } - ] - } - } - }, - "CommonMetadata": { - "fields": { - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2 - }, - "operationType": { - "type": "OperationType", - "id": 3 - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4 - }, - "state": { - "type": "State", - "id": 5 - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "INITIALIZING": 1, - "PROCESSING": 2, - "CANCELLING": 3, - "FINALIZING": 4, - "SUCCESSFUL": 5, - "FAILED": 6, - "CANCELLED": 7 - } - } - } - }, - "Progress": { - "fields": { - "workCompleted": { - "type": "int64", - "id": 1 - }, - "workEstimated": { - "type": "int64", - "id": 2 - } - } - }, - "ExportEntitiesRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "entityFilter": { - "type": "EntityFilter", - "id": 3 - }, - "outputUrlPrefix": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ImportEntitiesRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "inputUrl": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "entityFilter": { - "type": "EntityFilter", - "id": 4 - } - } - }, - "ExportEntitiesResponse": { - "fields": { - "outputUrl": { - "type": "string", - "id": 1 - } - } - }, - "ExportEntitiesMetadata": { - "fields": { - "common": { - "type": "CommonMetadata", - "id": 1 - }, - "progressEntities": { - "type": "Progress", - "id": 2 - }, - "progressBytes": { - "type": "Progress", - "id": 3 - }, - "entityFilter": { - "type": "EntityFilter", - "id": 4 - }, - "outputUrlPrefix": { - "type": "string", - "id": 5 - } - } - }, - "ImportEntitiesMetadata": { - "fields": { - "common": { - "type": "CommonMetadata", - "id": 1 - }, - "progressEntities": { - "type": "Progress", - "id": 2 - }, - "progressBytes": { - "type": "Progress", - "id": 3 - }, - "entityFilter": { - "type": "EntityFilter", - "id": 4 - }, - "inputUrl": { - "type": "string", - "id": 5 - } - } - }, - "EntityFilter": { - "fields": { - "kinds": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "namespaceIds": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "CreateIndexRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "index": { - "type": "Index", - "id": 3 - } - } - }, - "DeleteIndexRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "indexId": { - "type": "string", - "id": 3 - } - } - }, - "GetIndexRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "indexId": { - "type": "string", - "id": 3 - } - } - }, - "ListIndexesRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 1 - }, - "filter": { - "type": "string", - "id": 3 - }, - "pageSize": { - "type": "int32", - "id": 4 - }, - "pageToken": { - "type": "string", - "id": 5 - } - } - }, - "ListIndexesResponse": { - "fields": { - "indexes": { - "rule": "repeated", - "type": "Index", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "IndexOperationMetadata": { - "fields": { - "common": { - "type": "CommonMetadata", - "id": 1 - }, - "progressEntities": { - "type": "Progress", - "id": 2 - }, - "indexId": { - "type": "string", - "id": 3 - } - } - }, - "DatastoreFirestoreMigrationMetadata": { - "fields": { - "migrationState": { - "type": "MigrationState", - "id": 1 - }, - "migrationStep": { - "type": "MigrationStep", - "id": 2 - } - } - }, - "OperationType": { - "values": { - "OPERATION_TYPE_UNSPECIFIED": 0, - "EXPORT_ENTITIES": 1, - "IMPORT_ENTITIES": 2, - "CREATE_INDEX": 3, - "DELETE_INDEX": 4 - } - }, - "Index": { - "fields": { - "projectId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "indexId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kind": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "ancestor": { - "type": "AncestorMode", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "properties": { - "rule": "repeated", - "type": "IndexedProperty", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "state": { - "type": "State", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "AncestorMode": { - "values": { - "ANCESTOR_MODE_UNSPECIFIED": 0, - "NONE": 1, - "ALL_ANCESTORS": 2 - } - }, - "Direction": { - "values": { - "DIRECTION_UNSPECIFIED": 0, - "ASCENDING": 1, - "DESCENDING": 2 - } - }, - "IndexedProperty": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "direction": { - "type": "Direction", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2, - "DELETING": 3, - "ERROR": 4 - } - } - } - }, - "MigrationStateEvent": { - "fields": { - "state": { - "type": "MigrationState", - "id": 1 - } - } - }, - "MigrationProgressEvent": { - "oneofs": { - "stepDetails": { - "oneof": [ - "prepareStepDetails", - "redirectWritesStepDetails" - ] - } - }, - "fields": { - "step": { - "type": "MigrationStep", - "id": 1 - }, - "prepareStepDetails": { - "type": "PrepareStepDetails", - "id": 2 - }, - "redirectWritesStepDetails": { - "type": "RedirectWritesStepDetails", - "id": 3 - } - }, - "nested": { - "ConcurrencyMode": { - "values": { - "CONCURRENCY_MODE_UNSPECIFIED": 0, - "PESSIMISTIC": 1, - "OPTIMISTIC": 2, - "OPTIMISTIC_WITH_ENTITY_GROUPS": 3 - } - }, - "PrepareStepDetails": { - "fields": { - "concurrencyMode": { - "type": "ConcurrencyMode", - "id": 1 - } - } - }, - "RedirectWritesStepDetails": { - "fields": { - "concurrencyMode": { - "type": "ConcurrencyMode", - "id": 1 - } - } - } - } - }, - "MigrationState": { - "values": { - "MIGRATION_STATE_UNSPECIFIED": 0, - "RUNNING": 1, - "PAUSED": 2, - "COMPLETE": 3 - } - }, - "MigrationStep": { - "values": { - "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 - } - } - } - } - } - }, - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.Datastore.V1", - "go_package": "cloud.google.com/go/datastore/apiv1/datastorepb;datastorepb", - "java_multiple_files": true, - "java_outer_classname": "QueryProfileProto", - "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 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 6 - }, - "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 - }, - "findNearest": { - "type": "FindNearest", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "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", - "sum", - "avg" - ] - } - }, - "fields": { - "count": { - "type": "Count", - "id": 1 - }, - "sum": { - "type": "Sum", - "id": 2 - }, - "avg": { - "type": "Avg", - "id": 3 - }, - "alias": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Count": { - "fields": { - "upTo": { - "type": "google.protobuf.Int64Value", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Sum": { - "fields": { - "property": { - "type": "PropertyReference", - "id": 1 - } - } - }, - "Avg": { - "fields": { - "property": { - "type": "PropertyReference", - "id": 1 - } - } - } - } - } - } - }, - "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 - } - } - } - }, - "FindNearest": { - "fields": { - "vectorProperty": { - "type": "PropertyReference", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "queryVector": { - "type": "Value", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "distanceMeasure": { - "type": "DistanceMeasure", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "limit": { - "type": "google.protobuf.Int32Value", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "distanceResultProperty": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "distanceThreshold": { - "type": "google.protobuf.DoubleValue", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "DistanceMeasure": { - "values": { - "DISTANCE_MEASURE_UNSPECIFIED": 0, - "EUCLIDEAN": 1, - "COSINE": 2, - "DOT_PRODUCT": 3 - } - } - } - }, - "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", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/datastore" - }, - "methods": { - "Lookup": { - "requestType": "LookupRequest", - "responseType": "LookupResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:lookup", - "(google.api.http).body": "*", - "(google.api.routing).routing_parameters.field": "database_id", - "(google.api.method_signature)": "project_id,read_options,keys" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:lookup", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "project_id" - }, - { - "field": "database_id" - } - ] - } - }, - { - "(google.api.method_signature)": "project_id,read_options,keys" - } - ] - }, - "RunQuery": { - "requestType": "RunQueryRequest", - "responseType": "RunQueryResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:runQuery", - "(google.api.http).body": "*", - "(google.api.routing).routing_parameters.field": "database_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:runQuery", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "project_id" - }, - { - "field": "database_id" - } - ] - } - } - ] - }, - "RunAggregationQuery": { - "requestType": "RunAggregationQueryRequest", - "responseType": "RunAggregationQueryResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:runAggregationQuery", - "(google.api.http).body": "*", - "(google.api.routing).routing_parameters.field": "database_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:runAggregationQuery", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "project_id" - }, - { - "field": "database_id" - } - ] - } - } - ] - }, - "BeginTransaction": { - "requestType": "BeginTransactionRequest", - "responseType": "BeginTransactionResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:beginTransaction", - "(google.api.http).body": "*", - "(google.api.routing).routing_parameters.field": "database_id", - "(google.api.method_signature)": "project_id" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:beginTransaction", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "project_id" - }, - { - "field": "database_id" - } - ] - } - }, - { - "(google.api.method_signature)": "project_id" - } - ] - }, - "Commit": { - "requestType": "CommitRequest", - "responseType": "CommitResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:commit", - "(google.api.http).body": "*", - "(google.api.routing).routing_parameters.field": "database_id", - "(google.api.method_signature)": "project_id,mode,mutations" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:commit", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "project_id" - }, - { - "field": "database_id" - } - ] - } - }, - { - "(google.api.method_signature)": "project_id,mode,transaction,mutations" - }, - { - "(google.api.method_signature)": "project_id,mode,mutations" - } - ] - }, - "Rollback": { - "requestType": "RollbackRequest", - "responseType": "RollbackResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:rollback", - "(google.api.http).body": "*", - "(google.api.routing).routing_parameters.field": "database_id", - "(google.api.method_signature)": "project_id,transaction" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:rollback", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "project_id" - }, - { - "field": "database_id" - } - ] - } - }, - { - "(google.api.method_signature)": "project_id,transaction" - } - ] - }, - "AllocateIds": { - "requestType": "AllocateIdsRequest", - "responseType": "AllocateIdsResponse", - "options": { - "(google.api.http).post": "/v1/projects/{project_id}:allocateIds", - "(google.api.http).body": "*", - "(google.api.routing).routing_parameters.field": "database_id", - "(google.api.method_signature)": "project_id,keys" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:allocateIds", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "project_id" - }, - { - "field": "database_id" - } - ] - } - }, - { - "(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.routing).routing_parameters.field": "database_id", - "(google.api.method_signature)": "project_id,keys" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/projects/{project_id}:reserveIds", - "body": "*" - } - }, - { - "(google.api.routing)": { - "routing_parameters": [ - { - "field": "project_id" - }, - { - "field": "database_id" - } - ] - } - }, - { - "(google.api.method_signature)": "project_id,keys" - } - ] - } - } - }, - "LookupRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "databaseId": { - "type": "string", - "id": 9 - }, - "readOptions": { - "type": "ReadOptions", - "id": 1 - }, - "keys": { - "rule": "repeated", - "type": "Key", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "propertyMask": { - "type": "PropertyMask", - "id": 5 - } - } - }, - "LookupResponse": { - "fields": { - "found": { - "rule": "repeated", - "type": "EntityResult", - "id": 1 - }, - "missing": { - "rule": "repeated", - "type": "EntityResult", - "id": 2 - }, - "deferred": { - "rule": "repeated", - "type": "Key", - "id": 3 - }, - "transaction": { - "type": "bytes", - "id": 5 - }, - "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" - } - }, - "databaseId": { - "type": "string", - "id": 9 - }, - "partitionId": { - "type": "PartitionId", - "id": 2 - }, - "readOptions": { - "type": "ReadOptions", - "id": 1 - }, - "query": { - "type": "Query", - "id": 3 - }, - "gqlQuery": { - "type": "GqlQuery", - "id": 7 - }, - "propertyMask": { - "type": "PropertyMask", - "id": 10 - }, - "explainOptions": { - "type": "ExplainOptions", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RunQueryResponse": { - "fields": { - "batch": { - "type": "QueryResultBatch", - "id": 1 - }, - "query": { - "type": "Query", - "id": 2 - }, - "transaction": { - "type": "bytes", - "id": 5 - }, - "explainMetrics": { - "type": "ExplainMetrics", - "id": 9 - } - } - }, - "RunAggregationQueryRequest": { - "oneofs": { - "queryType": { - "oneof": [ - "aggregationQuery", - "gqlQuery" - ] - } - }, - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "databaseId": { - "type": "string", - "id": 9 - }, - "partitionId": { - "type": "PartitionId", - "id": 2 - }, - "readOptions": { - "type": "ReadOptions", - "id": 1 - }, - "aggregationQuery": { - "type": "AggregationQuery", - "id": 3 - }, - "gqlQuery": { - "type": "GqlQuery", - "id": 7 - }, - "explainOptions": { - "type": "ExplainOptions", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RunAggregationQueryResponse": { - "fields": { - "batch": { - "type": "AggregationResultBatch", - "id": 1 - }, - "query": { - "type": "AggregationQuery", - "id": 2 - }, - "transaction": { - "type": "bytes", - "id": 5 - }, - "explainMetrics": { - "type": "ExplainMetrics", - "id": 9 - } - } - }, - "BeginTransactionRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "databaseId": { - "type": "string", - "id": 9 - }, - "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" - } - }, - "databaseId": { - "type": "string", - "id": 9 - }, - "transaction": { - "type": "bytes", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RollbackResponse": { - "fields": {} - }, - "CommitRequest": { - "oneofs": { - "transactionSelector": { - "oneof": [ - "transaction", - "singleUseTransaction" - ] - } - }, - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "databaseId": { - "type": "string", - "id": 9 - }, - "mode": { - "type": "Mode", - "id": 5 - }, - "transaction": { - "type": "bytes", - "id": 1 - }, - "singleUseTransaction": { - "type": "TransactionOptions", - "id": 10 - }, - "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" - } - }, - "databaseId": { - "type": "string", - "id": 9 - }, - "keys": { - "rule": "repeated", - "type": "Key", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "AllocateIdsResponse": { - "fields": { - "keys": { - "rule": "repeated", - "type": "Key", - "id": 1 - } - } - }, - "ReserveIdsRequest": { - "fields": { - "projectId": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "databaseId": { - "type": "string", - "id": 9 - }, - "keys": { - "rule": "repeated", - "type": "Key", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ReserveIdsResponse": { - "fields": {} - }, - "Mutation": { - "oneofs": { - "operation": { - "oneof": [ - "insert", - "update", - "upsert", - "delete" - ] - }, - "conflictDetectionStrategy": { - "oneof": [ - "baseVersion", - "updateTime" - ] - } - }, - "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 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 11 - }, - "conflictResolutionStrategy": { - "type": "ConflictResolutionStrategy", - "id": 10 - }, - "propertyMask": { - "type": "PropertyMask", - "id": 9 - }, - "propertyTransforms": { - "rule": "repeated", - "type": "PropertyTransform", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "ConflictResolutionStrategy": { - "values": { - "STRATEGY_UNSPECIFIED": 0, - "SERVER_VALUE": 1, - "FAIL": 3 - } - } - } - }, - "PropertyTransform": { - "oneofs": { - "transformType": { - "oneof": [ - "setToServerValue", - "increment", - "maximum", - "minimum", - "appendMissingElements", - "removeAllFromArray" - ] - } - }, - "fields": { - "property": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "setToServerValue": { - "type": "ServerValue", - "id": 2 - }, - "increment": { - "type": "Value", - "id": 3 - }, - "maximum": { - "type": "Value", - "id": 4 - }, - "minimum": { - "type": "Value", - "id": 5 - }, - "appendMissingElements": { - "type": "ArrayValue", - "id": 6 - }, - "removeAllFromArray": { - "type": "ArrayValue", - "id": 7 - } - }, - "nested": { - "ServerValue": { - "values": { - "SERVER_VALUE_UNSPECIFIED": 0, - "REQUEST_TIME": 1 - } - } - } - }, - "MutationResult": { - "fields": { - "key": { - "type": "Key", - "id": 3 - }, - "version": { - "type": "int64", - "id": 4 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 7 - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6 - }, - "conflictDetected": { - "type": "bool", - "id": 5 - }, - "transformResults": { - "rule": "repeated", - "type": "Value", - "id": 8 - } - } - }, - "PropertyMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "ReadOptions": { - "oneofs": { - "consistencyType": { - "oneof": [ - "readConsistency", - "transaction", - "newTransaction", - "readTime" - ] - } - }, - "fields": { - "readConsistency": { - "type": "ReadConsistency", - "id": 1 - }, - "transaction": { - "type": "bytes", - "id": 2 - }, - "newTransaction": { - "type": "TransactionOptions", - "id": 3 - }, - "readTime": { - "type": "google.protobuf.Timestamp", - "id": 4 - } - }, - "nested": { - "ReadConsistency": { - "values": { - "READ_CONSISTENCY_UNSPECIFIED": 0, - "STRONG": 1, - "EVENTUAL": 2 - } - } - } - }, - "TransactionOptions": { - "oneofs": { - "mode": { - "oneof": [ - "readWrite", - "readOnly" - ] - } - }, - "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 - } - } - } - } - }, - "ExplainOptions": { - "fields": { - "analyze": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ExplainMetrics": { - "fields": { - "planSummary": { - "type": "PlanSummary", - "id": 1 - }, - "executionStats": { - "type": "ExecutionStats", - "id": 2 - } - } - }, - "PlanSummary": { - "fields": { - "indexesUsed": { - "rule": "repeated", - "type": "google.protobuf.Struct", - "id": 1 - } - } - }, - "ExecutionStats": { - "fields": { - "resultsReturned": { - "type": "int64", - "id": 1 - }, - "executionDuration": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "readOperations": { - "type": "int64", - "id": 4 - }, - "debugStats": { - "type": "google.protobuf.Struct", - "id": 5 - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "RoutingProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI" - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - }, - "selectiveGapicGeneration": { - "type": "SelectiveGapicGeneration", - "id": 3 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "experimentalFeatures": { - "type": "ExperimentalFeatures", - "id": 2 - } - }, - "nested": { - "ExperimentalFeatures": { - "fields": { - "restAsyncIoEnabled": { - "type": "bool", - "id": 1 - }, - "protobufPythonicTypesEnabled": { - "type": "bool", - "id": 2 - }, - "unversionedPackageDisabled": { - "type": "bool", - "id": 3 - } - } - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "SelectiveGapicGeneration": { - "fields": { - "methods": { - "rule": "repeated", - "type": "string", - "id": 1 - }, - "generateOmittedAsInternal": { - "type": "bool", - "id": 2 - } - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "routing": { - "type": "google.api.RoutingRule", - "id": 72295729, - "extend": "google.protobuf.MethodOptions" - }, - "RoutingRule": { - "fields": { - "routingParameters": { - "rule": "repeated", - "type": "RoutingParameter", - "id": 2 - } - } - }, - "RoutingParameter": { - "fields": { - "field": { - "type": "string", - "id": 1 - }, - "pathTemplate": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "edition": "proto2", - "fields": { - "file": { - "rule": "repeated", - "type": "FileDescriptorProto", - "id": 1 - } - }, - "extensions": [ - [ - 536000000, - 536000000 - ] - ] - }, - "Edition": { - "edition": "proto2", - "values": { - "EDITION_UNKNOWN": 0, - "EDITION_LEGACY": 900, - "EDITION_PROTO2": 998, - "EDITION_PROTO3": 999, - "EDITION_2023": 1000, - "EDITION_2024": 1001, - "EDITION_1_TEST_ONLY": 1, - "EDITION_2_TEST_ONLY": 2, - "EDITION_99997_TEST_ONLY": 99997, - "EDITION_99998_TEST_ONLY": 99998, - "EDITION_99999_TEST_ONLY": 99999, - "EDITION_MAX": 2147483647 - } - }, - "FileDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "package": { - "type": "string", - "id": 2 - }, - "dependency": { - "rule": "repeated", - "type": "string", - "id": 3 - }, - "publicDependency": { - "rule": "repeated", - "type": "int32", - "id": 10 - }, - "weakDependency": { - "rule": "repeated", - "type": "int32", - "id": 11 - }, - "optionDependency": { - "rule": "repeated", - "type": "string", - "id": 15 - }, - "messageType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 4 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 5 - }, - "service": { - "rule": "repeated", - "type": "ServiceDescriptorProto", - "id": 6 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 7 - }, - "options": { - "type": "FileOptions", - "id": 8 - }, - "sourceCodeInfo": { - "type": "SourceCodeInfo", - "id": 9 - }, - "syntax": { - "type": "string", - "id": 12 - }, - "edition": { - "type": "Edition", - "id": 14 - } - } - }, - "DescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "field": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 2 - }, - "extension": { - "rule": "repeated", - "type": "FieldDescriptorProto", - "id": 6 - }, - "nestedType": { - "rule": "repeated", - "type": "DescriptorProto", - "id": 3 - }, - "enumType": { - "rule": "repeated", - "type": "EnumDescriptorProto", - "id": 4 - }, - "extensionRange": { - "rule": "repeated", - "type": "ExtensionRange", - "id": 5 - }, - "oneofDecl": { - "rule": "repeated", - "type": "OneofDescriptorProto", - "id": 8 - }, - "options": { - "type": "MessageOptions", - "id": 7 - }, - "reservedRange": { - "rule": "repeated", - "type": "ReservedRange", - "id": 9 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 10 - }, - "visibility": { - "type": "SymbolVisibility", - "id": 11 - } - }, - "nested": { - "ExtensionRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "ExtensionRangeOptions", - "id": 3 - } - } - }, - "ReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "ExtensionRangeOptions": { - "edition": "proto2", - "fields": { - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - }, - "declaration": { - "rule": "repeated", - "type": "Declaration", - "id": 2, - "options": { - "retention": "RETENTION_SOURCE" - } - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "verification": { - "type": "VerificationState", - "id": 3, - "options": { - "default": "UNVERIFIED", - "retention": "RETENTION_SOURCE" - } - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "Declaration": { - "fields": { - "number": { - "type": "int32", - "id": 1 - }, - "fullName": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "reserved": { - "type": "bool", - "id": 5 - }, - "repeated": { - "type": "bool", - "id": 6 - } - }, - "reserved": [ - [ - 4, - 4 - ] - ] - }, - "VerificationState": { - "values": { - "DECLARATION": 0, - "UNVERIFIED": 1 - } - } - } - }, - "FieldDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 3 - }, - "label": { - "type": "Label", - "id": 4 - }, - "type": { - "type": "Type", - "id": 5 - }, - "typeName": { - "type": "string", - "id": 6 - }, - "extendee": { - "type": "string", - "id": 2 - }, - "defaultValue": { - "type": "string", - "id": 7 - }, - "oneofIndex": { - "type": "int32", - "id": 9 - }, - "jsonName": { - "type": "string", - "id": 10 - }, - "options": { - "type": "FieldOptions", - "id": 8 - }, - "proto3Optional": { - "type": "bool", - "id": 17 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_DOUBLE": 1, - "TYPE_FLOAT": 2, - "TYPE_INT64": 3, - "TYPE_UINT64": 4, - "TYPE_INT32": 5, - "TYPE_FIXED64": 6, - "TYPE_FIXED32": 7, - "TYPE_BOOL": 8, - "TYPE_STRING": 9, - "TYPE_GROUP": 10, - "TYPE_MESSAGE": 11, - "TYPE_BYTES": 12, - "TYPE_UINT32": 13, - "TYPE_ENUM": 14, - "TYPE_SFIXED32": 15, - "TYPE_SFIXED64": 16, - "TYPE_SINT32": 17, - "TYPE_SINT64": 18 - } - }, - "Label": { - "values": { - "LABEL_OPTIONAL": 1, - "LABEL_REPEATED": 3, - "LABEL_REQUIRED": 2 - } - } - } - }, - "OneofDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "options": { - "type": "OneofOptions", - "id": 2 - } - } - }, - "EnumDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "value": { - "rule": "repeated", - "type": "EnumValueDescriptorProto", - "id": 2 - }, - "options": { - "type": "EnumOptions", - "id": 3 - }, - "reservedRange": { - "rule": "repeated", - "type": "EnumReservedRange", - "id": 4 - }, - "reservedName": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "visibility": { - "type": "SymbolVisibility", - "id": 6 - } - }, - "nested": { - "EnumReservedRange": { - "fields": { - "start": { - "type": "int32", - "id": 1 - }, - "end": { - "type": "int32", - "id": 2 - } - } - } - } - }, - "EnumValueDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "number": { - "type": "int32", - "id": 2 - }, - "options": { - "type": "EnumValueOptions", - "id": 3 - } - } - }, - "ServiceDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "method": { - "rule": "repeated", - "type": "MethodDescriptorProto", - "id": 2 - }, - "options": { - "type": "ServiceOptions", - "id": 3 - } - }, - "reserved": [ - [ - 4, - 4 - ], - "stream" - ] - }, - "MethodDescriptorProto": { - "edition": "proto2", - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "inputType": { - "type": "string", - "id": 2 - }, - "outputType": { - "type": "string", - "id": 3 - }, - "options": { - "type": "MethodOptions", - "id": 4 - }, - "clientStreaming": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "serverStreaming": { - "type": "bool", - "id": 6, - "options": { - "default": false - } - } - } - }, - "FileOptions": { - "edition": "proto2", - "fields": { - "javaPackage": { - "type": "string", - "id": 1 - }, - "javaOuterClassname": { - "type": "string", - "id": 8 - }, - "javaMultipleFiles": { - "type": "bool", - "id": 10, - "options": { - "default": false - } - }, - "javaGenerateEqualsAndHash": { - "type": "bool", - "id": 20, - "options": { - "deprecated": true - } - }, - "javaStringCheckUtf8": { - "type": "bool", - "id": 27, - "options": { - "default": false - } - }, - "optimizeFor": { - "type": "OptimizeMode", - "id": 9, - "options": { - "default": "SPEED" - } - }, - "goPackage": { - "type": "string", - "id": 11 - }, - "ccGenericServices": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "javaGenericServices": { - "type": "bool", - "id": 17, - "options": { - "default": false - } - }, - "pyGenericServices": { - "type": "bool", - "id": 18, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 23, - "options": { - "default": false - } - }, - "ccEnableArenas": { - "type": "bool", - "id": 31, - "options": { - "default": true - } - }, - "objcClassPrefix": { - "type": "string", - "id": 36 - }, - "csharpNamespace": { - "type": "string", - "id": 37 - }, - "swiftPrefix": { - "type": "string", - "id": 39 - }, - "phpClassPrefix": { - "type": "string", - "id": 40 - }, - "phpNamespace": { - "type": "string", - "id": 41 - }, - "phpMetadataNamespace": { - "type": "string", - "id": 44 - }, - "rubyPackage": { - "type": "string", - "id": 45 - }, - "features": { - "type": "FeatureSet", - "id": 50 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 42, - 42 - ], - "php_generic_services", - [ - 38, - 38 - ] - ], - "nested": { - "OptimizeMode": { - "values": { - "SPEED": 1, - "CODE_SIZE": 2, - "LITE_RUNTIME": 3 - } - } - } - }, - "MessageOptions": { - "edition": "proto2", - "fields": { - "messageSetWireFormat": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "noStandardDescriptorAccessor": { - "type": "bool", - "id": 2, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "mapEntry": { - "type": "bool", - "id": 7 - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 11, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 12 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 5, - 5 - ], - [ - 6, - 6 - ], - [ - 8, - 8 - ], - [ - 9, - 9 - ] - ] - }, - "FieldOptions": { - "edition": "proto2", - "fields": { - "ctype": { - "type": "CType", - "id": 1, - "options": { - "default": "STRING" - } - }, - "packed": { - "type": "bool", - "id": 2 - }, - "jstype": { - "type": "JSType", - "id": 6, - "options": { - "default": "JS_NORMAL" - } - }, - "lazy": { - "type": "bool", - "id": 5, - "options": { - "default": false - } - }, - "unverifiedLazy": { - "type": "bool", - "id": 15, - "options": { - "default": false - } - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "weak": { - "type": "bool", - "id": 10, - "options": { - "default": false, - "deprecated": true - } - }, - "debugRedact": { - "type": "bool", - "id": 16, - "options": { - "default": false - } - }, - "retention": { - "type": "OptionRetention", - "id": 17 - }, - "targets": { - "rule": "repeated", - "type": "OptionTargetType", - "id": 19 - }, - "editionDefaults": { - "rule": "repeated", - "type": "EditionDefault", - "id": 20 - }, - "features": { - "type": "FeatureSet", - "id": 21 - }, - "featureSupport": { - "type": "FeatureSupport", - "id": 22 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 4, - 4 - ], - [ - 18, - 18 - ] - ], - "nested": { - "CType": { - "values": { - "STRING": 0, - "CORD": 1, - "STRING_PIECE": 2 - } - }, - "JSType": { - "values": { - "JS_NORMAL": 0, - "JS_STRING": 1, - "JS_NUMBER": 2 - } - }, - "OptionRetention": { - "values": { - "RETENTION_UNKNOWN": 0, - "RETENTION_RUNTIME": 1, - "RETENTION_SOURCE": 2 - } - }, - "OptionTargetType": { - "values": { - "TARGET_TYPE_UNKNOWN": 0, - "TARGET_TYPE_FILE": 1, - "TARGET_TYPE_EXTENSION_RANGE": 2, - "TARGET_TYPE_MESSAGE": 3, - "TARGET_TYPE_FIELD": 4, - "TARGET_TYPE_ONEOF": 5, - "TARGET_TYPE_ENUM": 6, - "TARGET_TYPE_ENUM_ENTRY": 7, - "TARGET_TYPE_SERVICE": 8, - "TARGET_TYPE_METHOD": 9 - } - }, - "EditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "value": { - "type": "string", - "id": 2 - } - } - }, - "FeatureSupport": { - "fields": { - "editionIntroduced": { - "type": "Edition", - "id": 1 - }, - "editionDeprecated": { - "type": "Edition", - "id": 2 - }, - "deprecationWarning": { - "type": "string", - "id": 3 - }, - "editionRemoved": { - "type": "Edition", - "id": 4 - } - } - } - } - }, - "OneofOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 1 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "EnumOptions": { - "edition": "proto2", - "fields": { - "allowAlias": { - "type": "bool", - "id": 2 - }, - "deprecated": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "deprecatedLegacyJsonFieldConflicts": { - "type": "bool", - "id": 6, - "options": { - "deprecated": true - } - }, - "features": { - "type": "FeatureSet", - "id": 7 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "reserved": [ - [ - 5, - 5 - ] - ] - }, - "EnumValueOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 1, - "options": { - "default": false - } - }, - "features": { - "type": "FeatureSet", - "id": 2 - }, - "debugRedact": { - "type": "bool", - "id": 3, - "options": { - "default": false - } - }, - "featureSupport": { - "type": "FieldOptions.FeatureSupport", - "id": 4 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "ServiceOptions": { - "edition": "proto2", - "fields": { - "features": { - "type": "FeatureSet", - "id": 34 - }, - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ] - }, - "MethodOptions": { - "edition": "proto2", - "fields": { - "deprecated": { - "type": "bool", - "id": 33, - "options": { - "default": false - } - }, - "idempotencyLevel": { - "type": "IdempotencyLevel", - "id": 34, - "options": { - "default": "IDEMPOTENCY_UNKNOWN" - } - }, - "features": { - "type": "FeatureSet", - "id": 35 - }, - "uninterpretedOption": { - "rule": "repeated", - "type": "UninterpretedOption", - "id": 999 - } - }, - "extensions": [ - [ - 1000, - 536870911 - ] - ], - "nested": { - "IdempotencyLevel": { - "values": { - "IDEMPOTENCY_UNKNOWN": 0, - "NO_SIDE_EFFECTS": 1, - "IDEMPOTENT": 2 - } - } - } - }, - "UninterpretedOption": { - "edition": "proto2", - "fields": { - "name": { - "rule": "repeated", - "type": "NamePart", - "id": 2 - }, - "identifierValue": { - "type": "string", - "id": 3 - }, - "positiveIntValue": { - "type": "uint64", - "id": 4 - }, - "negativeIntValue": { - "type": "int64", - "id": 5 - }, - "doubleValue": { - "type": "double", - "id": 6 - }, - "stringValue": { - "type": "bytes", - "id": 7 - }, - "aggregateValue": { - "type": "string", - "id": 8 - } - }, - "nested": { - "NamePart": { - "fields": { - "namePart": { - "rule": "required", - "type": "string", - "id": 1 - }, - "isExtension": { - "rule": "required", - "type": "bool", - "id": 2 - } - } - } - } - }, - "FeatureSet": { - "edition": "proto2", - "fields": { - "fieldPresence": { - "type": "FieldPresence", - "id": 1, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_2023", - "edition_defaults.value": "EXPLICIT" - } - }, - "enumType": { - "type": "EnumType", - "id": 2, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "OPEN" - } - }, - "repeatedFieldEncoding": { - "type": "RepeatedFieldEncoding", - "id": 3, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "PACKED" - } - }, - "utf8Validation": { - "type": "Utf8Validation", - "id": 4, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "VERIFY" - } - }, - "messageEncoding": { - "type": "MessageEncoding", - "id": 5, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_LEGACY", - "edition_defaults.value": "LENGTH_PREFIXED" - } - }, - "jsonFormat": { - "type": "JsonFormat", - "id": 6, - "options": { - "retention": "RETENTION_RUNTIME", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2023", - "edition_defaults.edition": "EDITION_PROTO3", - "edition_defaults.value": "ALLOW" - } - }, - "enforceNamingStyle": { - "type": "EnforceNamingStyle", - "id": 7, - "options": { - "retention": "RETENTION_SOURCE", - "targets": "TARGET_TYPE_METHOD", - "feature_support.edition_introduced": "EDITION_2024", - "edition_defaults.edition": "EDITION_2024", - "edition_defaults.value": "STYLE2024" - } - }, - "defaultSymbolVisibility": { - "type": "VisibilityFeature.DefaultSymbolVisibility", - "id": 8, - "options": { - "retention": "RETENTION_SOURCE", - "targets": "TARGET_TYPE_FILE", - "feature_support.edition_introduced": "EDITION_2024", - "edition_defaults.edition": "EDITION_2024", - "edition_defaults.value": "EXPORT_TOP_LEVEL" - } - } - }, - "extensions": [ - [ - 1000, - 9994 - ], - [ - 9995, - 9999 - ], - [ - 10000, - 10000 - ] - ], - "reserved": [ - [ - 999, - 999 - ] - ], - "nested": { - "FieldPresence": { - "values": { - "FIELD_PRESENCE_UNKNOWN": 0, - "EXPLICIT": 1, - "IMPLICIT": 2, - "LEGACY_REQUIRED": 3 - } - }, - "EnumType": { - "values": { - "ENUM_TYPE_UNKNOWN": 0, - "OPEN": 1, - "CLOSED": 2 - } - }, - "RepeatedFieldEncoding": { - "values": { - "REPEATED_FIELD_ENCODING_UNKNOWN": 0, - "PACKED": 1, - "EXPANDED": 2 - } - }, - "Utf8Validation": { - "values": { - "UTF8_VALIDATION_UNKNOWN": 0, - "VERIFY": 2, - "NONE": 3 - }, - "reserved": [ - [ - 1, - 1 - ] - ] - }, - "MessageEncoding": { - "values": { - "MESSAGE_ENCODING_UNKNOWN": 0, - "LENGTH_PREFIXED": 1, - "DELIMITED": 2 - } - }, - "JsonFormat": { - "values": { - "JSON_FORMAT_UNKNOWN": 0, - "ALLOW": 1, - "LEGACY_BEST_EFFORT": 2 - } - }, - "EnforceNamingStyle": { - "values": { - "ENFORCE_NAMING_STYLE_UNKNOWN": 0, - "STYLE2024": 1, - "STYLE_LEGACY": 2 - } - }, - "VisibilityFeature": { - "fields": {}, - "reserved": [ - [ - 1, - 536870911 - ] - ], - "nested": { - "DefaultSymbolVisibility": { - "values": { - "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": 0, - "EXPORT_ALL": 1, - "EXPORT_TOP_LEVEL": 2, - "LOCAL_ALL": 3, - "STRICT": 4 - } - } - } - } - } - }, - "FeatureSetDefaults": { - "edition": "proto2", - "fields": { - "defaults": { - "rule": "repeated", - "type": "FeatureSetEditionDefault", - "id": 1 - }, - "minimumEdition": { - "type": "Edition", - "id": 4 - }, - "maximumEdition": { - "type": "Edition", - "id": 5 - } - }, - "nested": { - "FeatureSetEditionDefault": { - "fields": { - "edition": { - "type": "Edition", - "id": 3 - }, - "overridableFeatures": { - "type": "FeatureSet", - "id": 4 - }, - "fixedFeatures": { - "type": "FeatureSet", - "id": 5 - } - }, - "reserved": [ - [ - 1, - 1 - ], - [ - 2, - 2 - ], - "features" - ] - } - } - }, - "SourceCodeInfo": { - "edition": "proto2", - "fields": { - "location": { - "rule": "repeated", - "type": "Location", - "id": 1 - } - }, - "extensions": [ - [ - 536000000, - 536000000 - ] - ], - "nested": { - "Location": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "span": { - "rule": "repeated", - "type": "int32", - "id": 2, - "options": { - "packed": true - } - }, - "leadingComments": { - "type": "string", - "id": 3 - }, - "trailingComments": { - "type": "string", - "id": 4 - }, - "leadingDetachedComments": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - } - } - }, - "GeneratedCodeInfo": { - "edition": "proto2", - "fields": { - "annotation": { - "rule": "repeated", - "type": "Annotation", - "id": 1 - } - }, - "nested": { - "Annotation": { - "fields": { - "path": { - "rule": "repeated", - "type": "int32", - "id": 1, - "options": { - "packed": true - } - }, - "sourceFile": { - "type": "string", - "id": 2 - }, - "begin": { - "type": "int32", - "id": 3 - }, - "end": { - "type": "int32", - "id": 4 - }, - "semantic": { - "type": "Semantic", - "id": 5 - } - }, - "nested": { - "Semantic": { - "values": { - "NONE": 0, - "SET": 1, - "ALIAS": 2 - } - } - } - } - } - }, - "SymbolVisibility": { - "edition": "proto2", - "values": { - "VISIBILITY_UNSET": 0, - "VISIBILITY_LOCAL": 1, - "VISIBILITY_EXPORT": 2 - } - }, - "Duration": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Struct": { - "fields": { - "fields": { - "keyType": "string", - "type": "Value", - "id": 1 - } - } - }, - "Value": { - "oneofs": { - "kind": { - "oneof": [ - "nullValue", - "numberValue", - "stringValue", - "boolValue", - "structValue", - "listValue" - ] - } - }, - "fields": { - "nullValue": { - "type": "NullValue", - "id": 1 - }, - "numberValue": { - "type": "double", - "id": 2 - }, - "stringValue": { - "type": "string", - "id": 3 - }, - "boolValue": { - "type": "bool", - "id": 4 - }, - "structValue": { - "type": "Struct", - "id": 5 - }, - "listValue": { - "type": "ListValue", - "id": 6 - } - } - }, - "NullValue": { - "values": { - "NULL_VALUE": 0 - } - }, - "ListValue": { - "fields": { - "values": { - "rule": "repeated", - "type": "Value", - "id": 1 - } - } - }, - "DoubleValue": { - "fields": { - "value": { - "type": "double", - "id": 1 - } - } - }, - "FloatValue": { - "fields": { - "value": { - "type": "float", - "id": 1 - } - } - }, - "Int64Value": { - "fields": { - "value": { - "type": "int64", - "id": 1 - } - } - }, - "UInt64Value": { - "fields": { - "value": { - "type": "uint64", - "id": 1 - } - } - }, - "Int32Value": { - "fields": { - "value": { - "type": "int32", - "id": 1 - } - } - }, - "UInt32Value": { - "fields": { - "value": { - "type": "uint32", - "id": 1 - } - } - }, - "BoolValue": { - "fields": { - "value": { - "type": "bool", - "id": 1 - } - } - }, - "StringValue": { - "fields": { - "value": { - "type": "string", - "id": 1 - } - } - }, - "BytesValue": { - "fields": { - "value": { - "type": "bytes", - "id": 1 - } - } - } - } - }, - "longrunning": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.LongRunning", - "go_package": "cloud.google.com/go/longrunning/autogen/longrunningpb;longrunningpb", - "java_multiple_files": true, - "java_outer_classname": "OperationsProto", - "java_package": "com.google.longrunning", - "objc_class_prefix": "GLRUN", - "php_namespace": "Google\\LongRunning" - }, - "nested": { - "operationInfo": { - "type": "google.longrunning.OperationInfo", - "id": 1049, - "extend": "google.protobuf.MethodOptions" - }, - "Operations": { - "options": { - "(google.api.default_host)": "longrunning.googleapis.com" - }, - "methods": { - "ListOperations": { - "requestType": "ListOperationsRequest", - "responseType": "ListOperationsResponse", - "options": { - "(google.api.http).get": "/v1/{name=operations}", - "(google.api.method_signature)": "name,filter" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations}" - } - }, - { - "(google.api.method_signature)": "name,filter" - } - ] - }, - "GetOperation": { - "requestType": "GetOperationRequest", - "responseType": "Operation", - "options": { - "(google.api.http).get": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteOperation": { - "requestType": "DeleteOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v1/{name=operations/**}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=operations/**}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CancelOperation": { - "requestType": "CancelOperationRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=operations/**}:cancel", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "WaitOperation": { - "requestType": "WaitOperationRequest", - "responseType": "Operation" - } - } - }, - "Operation": { - "oneofs": { - "result": { - "oneof": [ - "error", - "response" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "metadata": { - "type": "google.protobuf.Any", - "id": 2 - }, - "done": { - "type": "bool", - "id": 3 - }, - "error": { - "type": "google.rpc.Status", - "id": 4 - }, - "response": { - "type": "google.protobuf.Any", - "id": 5 - } - } - }, - "GetOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "ListOperationsRequest": { - "fields": { - "name": { - "type": "string", - "id": 4 - }, - "filter": { - "type": "string", - "id": 1 - }, - "pageSize": { - "type": "int32", - "id": 2 - }, - "pageToken": { - "type": "string", - "id": 3 - } - } - }, - "ListOperationsResponse": { - "fields": { - "operations": { - "rule": "repeated", - "type": "Operation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "CancelOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "DeleteOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - } - } - }, - "WaitOperationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "timeout": { - "type": "google.protobuf.Duration", - "id": 2 - } - } - }, - "OperationInfo": { - "fields": { - "responseType": { - "type": "string", - "id": 1 - }, - "metadataType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } - }, - "type": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/type/latlng;latlng", - "java_multiple_files": true, - "java_outer_classname": "LatLngProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "LatLng": { - "fields": { - "latitude": { - "type": "double", - "id": 1 - }, - "longitude": { - "type": "double", - "id": 2 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/handwritten/datastore/src/entity.ts b/handwritten/datastore/src/entity.ts index 7216efb8f6a9..f6e443de65e3 100644 --- a/handwritten/datastore/src/entity.ts +++ b/handwritten/datastore/src/entity.ts @@ -20,7 +20,7 @@ import {Query, QueryProto, IntegerTypeCastOptions} from './query'; import {PathType} from '.'; import * as Protobuf from 'protobufjs'; import * as path from 'path'; -import {google} from '../protos/protos'; +import {google} from './protos'; import {and, PropertyFilter} from './filter'; // eslint-disable-next-line @typescript-eslint/no-namespace diff --git a/handwritten/datastore/src/index-class.ts b/handwritten/datastore/src/index-class.ts index 49027c9907dc..e47ba360f468 100644 --- a/handwritten/datastore/src/index-class.ts +++ b/handwritten/datastore/src/index-class.ts @@ -16,7 +16,7 @@ import {CallOptions, ServiceError} from 'google-gax'; import {promisifyAll} from '@google-cloud/promisify'; import {Datastore} from './'; -import {google} from '../protos/protos'; +import {google} from './protos'; export interface GenericIndexCallback { ( diff --git a/handwritten/datastore/src/index.ts b/handwritten/datastore/src/index.ts index 029fecea6685..8cdf0bfce658 100644 --- a/handwritten/datastore/src/index.ts +++ b/handwritten/datastore/src/index.ts @@ -72,7 +72,7 @@ import { } from './request'; import {Transaction} from './transaction'; import {promisifyAll} from '@google-cloud/promisify'; -import {google} from '../protos/protos'; +import {google} from './protos'; import {AggregateQuery} from './aggregate'; import {SaveEntity} from './interfaces/save'; import {extendExcludeFromIndexes} from './utils/entity/extendExcludeFromIndexes'; diff --git a/handwritten/datastore/src/protos.ts b/handwritten/datastore/src/protos.ts new file mode 100644 index 000000000000..cfbf900d1b3b --- /dev/null +++ b/handwritten/datastore/src/protos.ts @@ -0,0 +1,18 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import {protos} from '@google-cloud/datastore-api'; + +import google = protos.google; +export {protos, google}; diff --git a/handwritten/datastore/src/query.ts b/handwritten/datastore/src/query.ts index 86ff6ff45fc2..a147c6b9788c 100644 --- a/handwritten/datastore/src/query.ts +++ b/handwritten/datastore/src/query.ts @@ -23,7 +23,7 @@ import {Transaction} from './transaction'; import {CallOptions} from 'google-gax'; import {RunQueryStreamOptions} from '../src/request'; import * as gaxInstance from 'google-gax'; -import {google} from '../protos/protos'; +import {google} from './protos'; export type Operator = | '=' diff --git a/handwritten/datastore/src/request.ts b/handwritten/datastore/src/request.ts index dee2a09b2ce2..e78ec19f62df 100644 --- a/handwritten/datastore/src/request.ts +++ b/handwritten/datastore/src/request.ts @@ -21,7 +21,7 @@ import arrify = require('arrify'); const concat = require('concat-stream'); import * as extend from 'extend'; import {split} from 'split-array-stream'; -import {google} from '../protos/protos'; +import {google} from './protos'; import {CallOptions, CancellableStream} from 'google-gax'; import {Duplex, PassThrough, Transform} from 'stream'; @@ -65,7 +65,7 @@ import {Datastore, Transaction} from '.'; import ITimestamp = google.protobuf.ITimestamp; import {AggregateQuery} from './aggregate'; import {RunOptions} from './transaction'; -import * as protos from '../protos/protos'; +import * as protos from './protos'; import {serializer} from 'google-gax'; import * as gax from 'google-gax'; import {SaveDataValue} from './interfaces/save'; diff --git a/handwritten/datastore/src/transaction.ts b/handwritten/datastore/src/transaction.ts index 2525b0090bae..815139f39ec7 100644 --- a/handwritten/datastore/src/transaction.ts +++ b/handwritten/datastore/src/transaction.ts @@ -17,7 +17,7 @@ import {promisifyAll} from '@google-cloud/promisify'; import {CallOptions} from 'google-gax'; -import {google} from '../protos/protos'; +import {google} from './protos'; import {Datastore, TransactionOptions} from '.'; import {Entities, Entity, entity} from './entity'; diff --git a/handwritten/datastore/src/utils/entity/buildPropertyTransforms.ts b/handwritten/datastore/src/utils/entity/buildPropertyTransforms.ts index 333d4bd53635..840f0015d9b5 100644 --- a/handwritten/datastore/src/utils/entity/buildPropertyTransforms.ts +++ b/handwritten/datastore/src/utils/entity/buildPropertyTransforms.ts @@ -13,7 +13,7 @@ // limitations under the License. import {entity, PropertyTransform} from '../../entity'; -import {google} from '../../../protos/protos'; +import {google} from '../../protos'; import IValue = google.datastore.v1.IValue; import ServerValue = google.datastore.v1.PropertyTransform.ServerValue; diff --git a/handwritten/datastore/src/v1/datastore_admin_client.ts b/handwritten/datastore/src/v1/datastore_admin_client.ts deleted file mode 100644 index 4e22175c3309..000000000000 --- a/handwritten/datastore/src/v1/datastore_admin_client.ts +++ /dev/null @@ -1,1867 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type { - Callback, - CallOptions, - Descriptors, - ClientOptions, - GrpcClientOptions, - LROperation, - PaginationCallback, - GaxCall, -} from 'google-gax'; -import { Transform } from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/datastore_admin_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './datastore_admin_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Google Cloud Datastore Admin API - * - * The Datastore Admin API provides several admin services for Cloud Datastore. - * - * Concepts: Project, namespace, kind, and entity as defined in the Google Cloud - * Datastore API. - * - * Operation: An Operation represents work being performed in the background. - * - * EntityFilter: Allows specifying a subset of entities in a project. This is - * specified as a combination of kinds and namespaces (either or both of which - * may be all). - * - * Export/Import Service: - * - * - The Export/Import service provides the ability to copy all or a subset of - * entities to/from Google Cloud Storage. - * - Exported data may be imported into Cloud Datastore for any Google Cloud - * Platform project. It is not restricted to the export source project. It is - * possible to export from one project and then import into another. - * - Exported data can also be loaded into Google BigQuery for analysis. - * - Exports and imports are performed asynchronously. An Operation resource is - * created for each export/import. The state (including any errors encountered) - * of the export/import may be queried via the Operation resource. - * - * Index Service: - * - * - The index service manages Cloud Datastore composite indexes. - * - Index creation and deletion are performed asynchronously. - * An Operation resource is created for each such asynchronous operation. - * The state of the operation (including any errors encountered) - * may be queried via the Operation resource. - * - * Operation Service: - * - * - The Operations collection provides a record of actions performed for the - * specified project (including any operations in progress). Operations are not - * created directly but through calls on other collections or resources. - * - An operation that is not yet done may be cancelled. The request to cancel - * is asynchronous and the operation may continue to run for some time after the - * request to cancel is made. - * - An operation that is done may be deleted so that it is no longer listed as - * part of the Operation collection. - * - ListOperations returns all pending operations, but not completed - * operations. - * - Operations are created by service DatastoreAdmin, but are accessed via - * service google.longrunning.Operations. - * @class - * @memberof v1 - */ -export class DatastoreAdminClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: { [method: string]: gax.CallSettings }; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('datastore-admin'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: { [name: string]: Function }; - operationsClient: gax.OperationsClient; - datastoreAdminStub?: Promise<{ [name: string]: Function }>; - - /** - * Construct an instance of DatastoreAdminClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DatastoreAdminClient({fallback: true}, gax); - * ``` - */ - constructor( - opts?: ClientOptions, - gaxInstance?: typeof gax | typeof gax.fallback, - ) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DatastoreAdminClient; - if ( - opts?.universe_domain && - opts?.universeDomain && - opts?.universe_domain !== opts?.universeDomain - ) { - throw new Error( - 'Please set either universe_domain or universeDomain, but not both.', - ); - } - const universeDomainEnvVar = - typeof process === 'object' && typeof process.env === 'object' - ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] - : undefined; - this._universeDomain = - opts?.universeDomain ?? - opts?.universe_domain ?? - universeDomainEnvVar ?? - 'googleapis.com'; - this._servicePath = 'datastore.' + this._universeDomain; - const servicePath = - opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!( - opts?.servicePath || opts?.apiEndpoint - ); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = - opts?.fallback ?? - (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = this._gaxGrpc.auth as gax.GoogleAuth; - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // Some of the methods on this service return "paged" results, - // (e.g. 50 results at a time, with tokens to get subsequent - // pages). Denote the keys used for pagination and results. - this.descriptors.page = { - listIndexes: new this._gaxModule.PageDescriptor( - 'pageToken', - 'nextPageToken', - 'indexes', - ), - }; - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [ - { - selector: 'google.longrunning.Operations.CancelOperation', - post: '/v1/{name=projects/*/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); - const exportEntitiesResponse = protoFilesRoot.lookup( - '.google.datastore.admin.v1.ExportEntitiesResponse', - ) as gax.protobuf.Type; - const exportEntitiesMetadata = protoFilesRoot.lookup( - '.google.datastore.admin.v1.ExportEntitiesMetadata', - ) as gax.protobuf.Type; - const importEntitiesResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty', - ) as gax.protobuf.Type; - const importEntitiesMetadata = protoFilesRoot.lookup( - '.google.datastore.admin.v1.ImportEntitiesMetadata', - ) as gax.protobuf.Type; - const createIndexResponse = protoFilesRoot.lookup( - '.google.datastore.admin.v1.Index', - ) as gax.protobuf.Type; - const createIndexMetadata = protoFilesRoot.lookup( - '.google.datastore.admin.v1.IndexOperationMetadata', - ) as gax.protobuf.Type; - const deleteIndexResponse = protoFilesRoot.lookup( - '.google.datastore.admin.v1.Index', - ) as gax.protobuf.Type; - const deleteIndexMetadata = protoFilesRoot.lookup( - '.google.datastore.admin.v1.IndexOperationMetadata', - ) as gax.protobuf.Type; - - this.descriptors.longrunning = { - exportEntities: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - exportEntitiesResponse.decode.bind(exportEntitiesResponse), - exportEntitiesMetadata.decode.bind(exportEntitiesMetadata), - ), - importEntities: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - importEntitiesResponse.decode.bind(importEntitiesResponse), - importEntitiesMetadata.decode.bind(importEntitiesMetadata), - ), - createIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createIndexResponse.decode.bind(createIndexResponse), - createIndexMetadata.decode.bind(createIndexMetadata), - ), - deleteIndex: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteIndexResponse.decode.bind(deleteIndexResponse), - deleteIndexMetadata.decode.bind(deleteIndexMetadata), - ), - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.datastore.admin.v1.DatastoreAdmin', - gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, - { 'x-goog-api-client': clientHeader.join(' ') }, - ); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.datastoreAdminStub) { - return this.datastoreAdminStub; - } - - // Put together the "service stub" for - // google.datastore.admin.v1.DatastoreAdmin. - this.datastoreAdminStub = this._gaxGrpc.createStub( - this._opts.fallback - ? (this._protos as protobuf.Root).lookupService( - 'google.datastore.admin.v1.DatastoreAdmin', - ) - : // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.datastore.admin.v1.DatastoreAdmin, - 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 datastoreAdminStubMethods = [ - 'exportEntities', - 'importEntities', - 'createIndex', - 'deleteIndex', - 'getIndex', - 'listIndexes', - ]; - for (const methodName of datastoreAdminStubMethods) { - const callPromise = this.datastoreAdminStub.then( - (stub) => - (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error | null | undefined) => () => { - throw err; - }, - ); - - const descriptor = - this.descriptors.page[methodName] || - this.descriptors.longrunning[methodName] || - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback, - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.datastoreAdminStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - process.emitWarning( - 'Static servicePath is deprecated, please use the instance method instead.', - 'DeprecationWarning', - ); - } - return 'datastore.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - process.emitWarning( - 'Static apiEndpoint is deprecated, please use the instance method instead.', - 'DeprecationWarning', - ); - } - return 'datastore.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/datastore', - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId( - callback?: Callback, - ): Promise | void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - /** - * Gets an index. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Project ID against which to make the request. - * @param {string} request.indexId - * The resource ID of the index to get. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.datastore.admin.v1.Index|Index}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.get_index.js - * region_tag:datastore_v1_generated_DatastoreAdmin_GetIndex_async - */ - getIndex( - request?: protos.google.datastore.admin.v1.IGetIndexRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IGetIndexRequest | undefined, - {} | undefined, - ] - >; - getIndex( - request: protos.google.datastore.admin.v1.IGetIndexRequest, - options: CallOptions, - callback: Callback< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IGetIndexRequest | null | undefined, - {} | null | undefined - >, - ): void; - getIndex( - request: protos.google.datastore.admin.v1.IGetIndexRequest, - callback: Callback< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IGetIndexRequest | null | undefined, - {} | null | undefined - >, - ): void; - getIndex( - request?: protos.google.datastore.admin.v1.IGetIndexRequest, - optionsOrCallback?: - | CallOptions - | Callback< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IGetIndexRequest | null | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IGetIndexRequest | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IGetIndexRequest | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - project_id: request.projectId?.toString() ?? '', - index_id: request.indexId?.toString() ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('getIndex request %j', request); - const wrappedCallback: - | Callback< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IGetIndexRequest | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getIndex response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .getIndex(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IGetIndexRequest | undefined, - {} | undefined, - ]) => { - this._log.info('getIndex response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - - /** - * Exports a copy of all or a subset of entities from Google Cloud Datastore - * to another storage system, such as Google Cloud Storage. Recent updates to - * entities may not be reflected in the export. The export occurs in the - * background and its progress can be monitored and managed via the - * Operation resource that is created. The output of an export may only be - * used once the associated operation is done. If an export operation is - * cancelled before completion it may leave partial data behind in Google - * Cloud Storage. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Project ID against which to make the request. - * @param {number[]} request.labels - * Client-assigned labels. - * @param {google.datastore.admin.v1.EntityFilter} request.entityFilter - * Description of what data from the project is included in the export. - * @param {string} request.outputUrlPrefix - * Required. Location for the export metadata and data files. - * - * The full resource URL of the external storage location. Currently, only - * Google Cloud Storage is supported. So output_url_prefix should be of the - * form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is the - * name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional Cloud - * Storage namespace path (this is not a Cloud Datastore namespace). For more - * information about Cloud Storage namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * - * The resulting files will be nested deeper than the specified URL prefix. - * The final output URL will be provided in the - * {@link protos.google.datastore.admin.v1.ExportEntitiesResponse.output_url|google.datastore.admin.v1.ExportEntitiesResponse.output_url} - * field. That value should be used for subsequent ImportEntities operations. - * - * By nesting the data files deeper, the same Cloud Storage bucket can be used - * in multiple ExportEntities operations without conflict. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.export_entities.js - * region_tag:datastore_v1_generated_DatastoreAdmin_ExportEntities_async - */ - exportEntities( - request?: protos.google.datastore.admin.v1.IExportEntitiesRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - exportEntities( - request: protos.google.datastore.admin.v1.IExportEntitiesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - exportEntities( - request: protos.google.datastore.admin.v1.IExportEntitiesRequest, - callback: Callback< - LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - exportEntities( - request?: protos.google.datastore.admin.v1.IExportEntitiesRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - project_id: request.projectId?.toString() ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('exportEntities response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('exportEntities request %j', request); - return this.innerApiCalls - .exportEntities(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('exportEntities response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `exportEntities()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.export_entities.js - * region_tag:datastore_v1_generated_DatastoreAdmin_ExportEntities_async - */ - async checkExportEntitiesProgress( - name: string, - ): Promise< - LROperation< - protos.google.datastore.admin.v1.ExportEntitiesResponse, - protos.google.datastore.admin.v1.ExportEntitiesMetadata - > - > { - this._log.info('exportEntities long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.exportEntities, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.datastore.admin.v1.ExportEntitiesResponse, - protos.google.datastore.admin.v1.ExportEntitiesMetadata - >; - } - /** - * Imports entities into Google Cloud Datastore. Existing entities with the - * same key are overwritten. The import occurs in the background and its - * progress can be monitored and managed via the Operation resource that is - * created. If an ImportEntities operation is cancelled, it is possible - * that a subset of the data has already been imported to Cloud Datastore. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Required. Project ID against which to make the request. - * @param {number[]} request.labels - * Client-assigned labels. - * @param {string} request.inputUrl - * Required. The full resource URL of the external storage location. - * Currently, only Google Cloud Storage is supported. So input_url should be - * of the form: - * `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`, where - * `BUCKET_NAME` is the name of the Cloud Storage bucket, `NAMESPACE_PATH` is - * an optional Cloud Storage namespace path (this is not a Cloud Datastore - * namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file written - * by the ExportEntities operation. For more information about Cloud Storage - * namespace paths, see - * [Object name - * considerations](https://cloud.google.com/storage/docs/naming#object-considerations). - * - * For more information, see - * {@link protos.google.datastore.admin.v1.ExportEntitiesResponse.output_url|google.datastore.admin.v1.ExportEntitiesResponse.output_url}. - * @param {google.datastore.admin.v1.EntityFilter} request.entityFilter - * Optionally specify which kinds/namespaces are to be imported. If provided, - * the list must be a subset of the EntityFilter used in creating the export, - * otherwise a FAILED_PRECONDITION error will be returned. If no filter is - * specified then all entities from the export are imported. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.import_entities.js - * region_tag:datastore_v1_generated_DatastoreAdmin_ImportEntities_async - */ - importEntities( - request?: protos.google.datastore.admin.v1.IImportEntitiesRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - importEntities( - request: protos.google.datastore.admin.v1.IImportEntitiesRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - importEntities( - request: protos.google.datastore.admin.v1.IImportEntitiesRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - importEntities( - request?: protos.google.datastore.admin.v1.IImportEntitiesRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - project_id: request.projectId?.toString() ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('importEntities response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('importEntities request %j', request); - return this.innerApiCalls - .importEntities(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('importEntities response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `importEntities()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.import_entities.js - * region_tag:datastore_v1_generated_DatastoreAdmin_ImportEntities_async - */ - async checkImportEntitiesProgress( - name: string, - ): Promise< - LROperation< - protos.google.protobuf.Empty, - protos.google.datastore.admin.v1.ImportEntitiesMetadata - > - > { - this._log.info('importEntities long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.importEntities, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.protobuf.Empty, - protos.google.datastore.admin.v1.ImportEntitiesMetadata - >; - } - /** - * Creates the specified index. - * A newly created index's initial state is `CREATING`. On completion of the - * returned {@link protos.google.longrunning.Operation|google.longrunning.Operation}, the - * state will be `READY`. If the index already exists, the call will return an - * `ALREADY_EXISTS` status. - * - * During index creation, the process could result in an error, in which - * case the index will move to the `ERROR` state. The process can be recovered - * by fixing the data that caused the error, removing the index with - * {@link protos.google.datastore.admin.v1.DatastoreAdmin.DeleteIndex|delete}, then - * re-creating the index with [create] - * [google.datastore.admin.v1.DatastoreAdmin.CreateIndex]. - * - * Indexes with a single property cannot be created. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Project ID against which to make the request. - * @param {google.datastore.admin.v1.Index} request.index - * The index to create. The name and state fields are output only and will be - * ignored. Single property indexes cannot be created or deleted. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.create_index.js - * region_tag:datastore_v1_generated_DatastoreAdmin_CreateIndex_async - */ - createIndex( - request?: protos.google.datastore.admin.v1.ICreateIndexRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - createIndex( - request: protos.google.datastore.admin.v1.ICreateIndexRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createIndex( - request: protos.google.datastore.admin.v1.ICreateIndexRequest, - callback: Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - createIndex( - request?: protos.google.datastore.admin.v1.ICreateIndexRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - project_id: request.projectId?.toString() ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('createIndex response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createIndex request %j', request); - return this.innerApiCalls - .createIndex(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('createIndex response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `createIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.create_index.js - * region_tag:datastore_v1_generated_DatastoreAdmin_CreateIndex_async - */ - async checkCreateIndexProgress( - name: string, - ): Promise< - LROperation< - protos.google.datastore.admin.v1.Index, - protos.google.datastore.admin.v1.IndexOperationMetadata - > - > { - this._log.info('createIndex long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.createIndex, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.datastore.admin.v1.Index, - protos.google.datastore.admin.v1.IndexOperationMetadata - >; - } - /** - * Deletes an existing index. - * An index can only be deleted if it is in a `READY` or `ERROR` state. On - * successful execution of the request, the index will be in a `DELETING` - * {@link protos.google.datastore.admin.v1.Index.State|state}. And on completion of the - * returned {@link protos.google.longrunning.Operation|google.longrunning.Operation}, the - * index will be removed. - * - * During index deletion, the process could result in an error, in which - * case the index will move to the `ERROR` state. The process can be recovered - * by fixing the data that caused the error, followed by calling - * {@link protos.google.datastore.admin.v1.DatastoreAdmin.DeleteIndex|delete} again. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Project ID against which to make the request. - * @param {string} request.indexId - * The resource ID of the index to delete. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.delete_index.js - * region_tag:datastore_v1_generated_DatastoreAdmin_DeleteIndex_async - */ - deleteIndex( - request?: protos.google.datastore.admin.v1.IDeleteIndexRequest, - options?: CallOptions, - ): Promise< - [ - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - >; - deleteIndex( - request: protos.google.datastore.admin.v1.IDeleteIndexRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - deleteIndex( - request: protos.google.datastore.admin.v1.IDeleteIndexRequest, - callback: Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): void; - deleteIndex( - request?: protos.google.datastore.admin.v1.IDeleteIndexRequest, - optionsOrCallback?: - | CallOptions - | Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - callback?: Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - >, - ): Promise< - [ - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - project_id: request.projectId?.toString() ?? '', - index_id: request.indexId?.toString() ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | Callback< - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, rawResponse, _) => { - this._log.info('deleteIndex response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteIndex request %j', request); - return this.innerApiCalls - .deleteIndex(request, options, wrappedCallback) - ?.then( - ([response, rawResponse, _]: [ - LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, - ]) => { - this._log.info('deleteIndex response %j', rawResponse); - return [response, rawResponse, _]; - }, - ); - } - /** - * Check the status of the long running operation returned by `deleteIndex()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.delete_index.js - * region_tag:datastore_v1_generated_DatastoreAdmin_DeleteIndex_async - */ - async checkDeleteIndexProgress( - name: string, - ): Promise< - LROperation< - protos.google.datastore.admin.v1.Index, - protos.google.datastore.admin.v1.IndexOperationMetadata - > - > { - this._log.info('deleteIndex long-running'); - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - { name }, - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.deleteIndex, - this._gaxModule.createDefaultBackoffSettings(), - ); - return decodeOperation as LROperation< - protos.google.datastore.admin.v1.Index, - protos.google.datastore.admin.v1.IndexOperationMetadata - >; - } - /** - * Lists the indexes that match the specified filters. Datastore uses an - * eventually consistent query to fetch the list of indexes and may - * occasionally return stale results. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Project ID against which to make the request. - * @param {string} request.filter - * @param {number} request.pageSize - * The maximum number of items to return. If zero, then all results will be - * returned. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.datastore.admin.v1.Index|Index}. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed and will merge results from all the pages into this array. - * Note that it can affect your quota. - * We recommend using `listIndexesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listIndexes( - request?: protos.google.datastore.admin.v1.IListIndexesRequest, - options?: CallOptions, - ): Promise< - [ - protos.google.datastore.admin.v1.IIndex[], - protos.google.datastore.admin.v1.IListIndexesRequest | null, - protos.google.datastore.admin.v1.IListIndexesResponse, - ] - >; - listIndexes( - request: protos.google.datastore.admin.v1.IListIndexesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.datastore.admin.v1.IListIndexesRequest, - protos.google.datastore.admin.v1.IListIndexesResponse | null | undefined, - protos.google.datastore.admin.v1.IIndex - >, - ): void; - listIndexes( - request: protos.google.datastore.admin.v1.IListIndexesRequest, - callback: PaginationCallback< - protos.google.datastore.admin.v1.IListIndexesRequest, - protos.google.datastore.admin.v1.IListIndexesResponse | null | undefined, - protos.google.datastore.admin.v1.IIndex - >, - ): void; - listIndexes( - request?: protos.google.datastore.admin.v1.IListIndexesRequest, - optionsOrCallback?: - | CallOptions - | PaginationCallback< - protos.google.datastore.admin.v1.IListIndexesRequest, - | protos.google.datastore.admin.v1.IListIndexesResponse - | null - | undefined, - protos.google.datastore.admin.v1.IIndex - >, - callback?: PaginationCallback< - protos.google.datastore.admin.v1.IListIndexesRequest, - protos.google.datastore.admin.v1.IListIndexesResponse | null | undefined, - protos.google.datastore.admin.v1.IIndex - >, - ): Promise< - [ - protos.google.datastore.admin.v1.IIndex[], - protos.google.datastore.admin.v1.IListIndexesRequest | null, - protos.google.datastore.admin.v1.IListIndexesResponse, - ] - > | void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - project_id: request.projectId?.toString() ?? '', - }); - this.initialize().catch((err) => { - throw err; - }); - const wrappedCallback: - | PaginationCallback< - protos.google.datastore.admin.v1.IListIndexesRequest, - | protos.google.datastore.admin.v1.IListIndexesResponse - | null - | undefined, - protos.google.datastore.admin.v1.IIndex - > - | undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listIndexes values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listIndexes request %j', request); - return this.innerApiCalls - .listIndexes(request, options, wrappedCallback) - ?.then( - ([response, input, output]: [ - protos.google.datastore.admin.v1.IIndex[], - protos.google.datastore.admin.v1.IListIndexesRequest | null, - protos.google.datastore.admin.v1.IListIndexesResponse, - ]) => { - this._log.info('listIndexes values %j', response); - return [response, input, output]; - }, - ); - } - - /** - * Equivalent to `listIndexes`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Project ID against which to make the request. - * @param {string} request.filter - * @param {number} request.pageSize - * The maximum number of items to return. If zero, then all results will be - * returned. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.datastore.admin.v1.Index|Index} on 'data' event. - * The client library will perform auto-pagination by default: it will call the API as many - * times as needed. Note that it can affect your quota. - * We recommend using `listIndexesAsync()` - * method described below for async iteration which you can stop as needed. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - */ - listIndexesStream( - request?: protos.google.datastore.admin.v1.IListIndexesRequest, - options?: CallOptions, - ): Transform { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - project_id: request.projectId?.toString() ?? '', - }); - const defaultCallSettings = this._defaults['listIndexes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listIndexes stream %j', request); - return this.descriptors.page.listIndexes.createStream( - this.innerApiCalls.listIndexes as GaxCall, - request, - callSettings, - ); - } - - /** - * Equivalent to `listIndexes`, but returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.projectId - * Project ID against which to make the request. - * @param {string} request.filter - * @param {number} request.pageSize - * The maximum number of items to return. If zero, then all results will be - * returned. - * @param {string} request.pageToken - * The next_page_token value returned from a previous List request, if any. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.datastore.admin.v1.Index|Index}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example include:samples/generated/v1/datastore_admin.list_indexes.js - * region_tag:datastore_v1_generated_DatastoreAdmin_ListIndexes_async - */ - listIndexesAsync( - request?: protos.google.datastore.admin.v1.IListIndexesRequest, - options?: CallOptions, - ): AsyncIterable { - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - project_id: request.projectId?.toString() ?? '', - }); - const defaultCallSettings = this._defaults['listIndexes']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('listIndexes iterate %j', request); - return this.descriptors.page.listIndexes.asyncIterate( - this.innerApiCalls['listIndexes'] as GaxCall, - request as {}, - callSettings, - ) as AsyncIterable; - } - /** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions, - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.datastoreAdminStub && !this._terminated) { - return this.datastoreAdminStub.then((stub) => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/handwritten/datastore/src/v1/datastore_admin_client_config.json b/handwritten/datastore/src/v1/datastore_admin_client_config.json deleted file mode 100644 index 9dbc3f5fff30..000000000000 --- a/handwritten/datastore/src/v1/datastore_admin_client_config.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "interfaces": { - "google.datastore.admin.v1.DatastoreAdmin": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ExportEntities": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ImportEntities": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateIndex": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteIndex": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetIndex": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "ListIndexes": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/handwritten/datastore/src/v1/datastore_admin_proto_list.json b/handwritten/datastore/src/v1/datastore_admin_proto_list.json deleted file mode 100644 index 7a038c3a12f4..000000000000 --- a/handwritten/datastore/src/v1/datastore_admin_proto_list.json +++ /dev/null @@ -1,5 +0,0 @@ -[ - "../../protos/google/datastore/admin/v1/datastore_admin.proto", - "../../protos/google/datastore/admin/v1/index.proto", - "../../protos/google/datastore/admin/v1/migration.proto" -] diff --git a/handwritten/datastore/src/v1/datastore_client.ts b/handwritten/datastore/src/v1/datastore_client.ts deleted file mode 100644 index e830c956aea5..000000000000 --- a/handwritten/datastore/src/v1/datastore_client.ts +++ /dev/null @@ -1,1933 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import type * as gax from 'google-gax'; -import type { - Callback, - CallOptions, - Descriptors, - ClientOptions, - GrpcClientOptions, -} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import { loggingUtils as logging, decodeAnyProtosInArray } from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/datastore_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './datastore_client_config.json'; -const version = require('../../../package.json').version; - -/** - * Each RPC normalizes the partition IDs of the keys in its input entities, - * and always returns entities with keys with normalized partition IDs. - * This applies to all keys and entities, including those in values, except keys - * with both an empty path and an empty or unset partition ID. Normalization of - * input keys sets the project ID (if not already set) to the project ID from - * the request. - * - * @class - * @memberof v1 - */ -export class DatastoreClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: { [method: string]: gax.CallSettings }; - private _universeDomain: string; - private _servicePath: string; - private _log = logging.log('datastore'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: { [name: string]: Function }; - operationsClient: gax.OperationsClient; - datastoreStub?: Promise<{ [name: string]: Function }>; - - /** - * Construct an instance of DatastoreClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. - * For more information, please check the - * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. - * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you - * need to avoid loading the default gRPC version and want to use the fallback - * HTTP implementation. Load only fallback version and pass it to the constructor: - * ``` - * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC - * const client = new DatastoreClient({fallback: true}, gax); - * ``` - */ - constructor( - opts?: ClientOptions, - gaxInstance?: typeof gax | typeof gax.fallback, - ) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DatastoreClient; - if ( - opts?.universe_domain && - opts?.universeDomain && - opts?.universe_domain !== opts?.universeDomain - ) { - throw new Error( - 'Please set either universe_domain or universeDomain, but not both.', - ); - } - const universeDomainEnvVar = - typeof process === 'object' && typeof process.env === 'object' - ? process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] - : undefined; - this._universeDomain = - opts?.universeDomain ?? - opts?.universe_domain ?? - universeDomainEnvVar ?? - 'googleapis.com'; - this._servicePath = 'datastore.' + this._universeDomain; - const servicePath = - opts?.servicePath || opts?.apiEndpoint || this._servicePath; - this._providedCustomServicePath = !!( - opts?.servicePath || opts?.apiEndpoint - ); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = - opts?.fallback ?? - (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({ servicePath, port, clientConfig, fallback }, opts); - - // Request numeric enum values if REST transport is used. - opts.numericEnums = true; - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== this._servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Load google-gax module synchronously if needed - if (!gaxInstance) { - gaxInstance = require('google-gax') as typeof gax; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gaxInstance.fallback : gaxInstance; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = this._gaxGrpc.auth as gax.GoogleAuth; - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = this._servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === this._servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - const protoFilesRoot = this._gaxModule.protobufFromJSON(jsonProtos); - // This API contains "long-running operations", which return a - // an Operation object that allows for tracking of the operation, - // rather than holding a request open. - const lroOptions: GrpcClientOptions = { - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }; - if (opts.fallback) { - lroOptions.protoJson = protoFilesRoot; - lroOptions.httpRules = [ - { - selector: 'google.longrunning.Operations.CancelOperation', - post: '/v1/{name=projects/*/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(' ') }, - ); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - - // Add a warn function to the client constructor so it can be easily tested. - this.warn = this._gaxModule.warn; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.datastoreStub) { - return this.datastoreStub; - } - - // 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._protos as any).google.datastore.v1.Datastore, - 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', - ]; - 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) => () => { - throw err; - }, - ); - - const descriptor = undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor, - this._opts.fallback, - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.datastoreStub; - } - - /** - * The DNS address for this API service. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - process.emitWarning( - 'Static servicePath is deprecated, please use the instance method instead.', - 'DeprecationWarning', - ); - } - return 'datastore.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath. - * @deprecated Use the apiEndpoint method of the client instance. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - process.emitWarning( - 'Static apiEndpoint is deprecated, please use the instance method instead.', - 'DeprecationWarning', - ); - } - return 'datastore.googleapis.com'; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - get apiEndpoint() { - return this._servicePath; - } - - get universeDomain() { - return this._universeDomain; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/datastore', - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId( - callback?: Callback, - ): Promise | void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - /** - * 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 {google.datastore.v1.PropertyMask} request.propertyMask - * The properties to return. Defaults to returning all properties. - * - * If this field is set and an entity has a property not referenced in the - * mask, it will be absent from {@link protos.|LookupResponse.found.entity.properties}. - * - * The entity's key is always returned. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.datastore.v1.LookupResponse|LookupResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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, - ] - >; - 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; - lookup( - 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< - 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 { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.projectId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['project_id'] ?? fieldValue; - Object.assign(routingParameter, { project_id: parameterValue }); - } - } - } - { - const fieldValue = request.databaseId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['database_id'] ?? fieldValue; - Object.assign(routingParameter, { database_id: parameterValue }); - } - } - } - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams(routingParameter); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('lookup request %j', request); - const wrappedCallback: - | Callback< - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('lookup response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .lookup(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.datastore.v1.ILookupResponse, - protos.google.datastore.v1.ILookupRequest | undefined, - {} | undefined, - ]) => { - this._log.info('lookup response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * 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 {google.datastore.v1.PropertyMask} request.propertyMask - * The properties to return. - * This field must not be set for a projection query. - * - * See - * {@link protos.google.datastore.v1.LookupRequest.property_mask|LookupRequest.property_mask}. - * @param {google.datastore.v1.ExplainOptions} [request.explainOptions] - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.datastore.v1.RunQueryResponse|RunQueryResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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, - ] - >; - 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; - runQuery( - 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< - 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 { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.projectId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['project_id'] ?? fieldValue; - Object.assign(routingParameter, { project_id: parameterValue }); - } - } - } - { - const fieldValue = request.databaseId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['database_id'] ?? fieldValue; - Object.assign(routingParameter, { database_id: parameterValue }); - } - } - } - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams(routingParameter); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('runQuery request %j', request); - const wrappedCallback: - | Callback< - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('runQuery response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .runQuery(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.datastore.v1.IRunQueryResponse, - protos.google.datastore.v1.IRunQueryRequest | undefined, - {} | undefined, - ]) => { - this._log.info('runQuery response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * 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 {google.datastore.v1.ExplainOptions} [request.explainOptions] - * Optional. Explain options for the query. If set, additional query - * statistics will be returned. If not, only query results will be returned. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.datastore.v1.RunAggregationQueryResponse|RunAggregationQueryResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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 || {}; - let routingParameter = {}; - { - const fieldValue = request.projectId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['project_id'] ?? fieldValue; - Object.assign(routingParameter, { project_id: parameterValue }); - } - } - } - { - const fieldValue = request.databaseId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['database_id'] ?? fieldValue; - Object.assign(routingParameter, { database_id: parameterValue }); - } - } - } - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams(routingParameter); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('runAggregationQuery request %j', request); - const wrappedCallback: - | Callback< - protos.google.datastore.v1.IRunAggregationQueryResponse, - | protos.google.datastore.v1.IRunAggregationQueryRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('runAggregationQuery response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .runAggregationQuery(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.datastore.v1.IRunAggregationQueryResponse, - protos.google.datastore.v1.IRunAggregationQueryRequest | undefined, - {} | undefined, - ]) => { - this._log.info('runAggregationQuery response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Begins a new transaction. - * - * @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 {@link protos.google.datastore.v1.BeginTransactionResponse|BeginTransactionResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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, - ] - >; - 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; - beginTransaction( - 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< - 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 { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.projectId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['project_id'] ?? fieldValue; - Object.assign(routingParameter, { project_id: parameterValue }); - } - } - } - { - const fieldValue = request.databaseId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['database_id'] ?? fieldValue; - Object.assign(routingParameter, { database_id: parameterValue }); - } - } - } - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams(routingParameter); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('beginTransaction request %j', request); - const wrappedCallback: - | Callback< - protos.google.datastore.v1.IBeginTransactionResponse, - | protos.google.datastore.v1.IBeginTransactionRequest - | null - | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('beginTransaction response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .beginTransaction(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.datastore.v1.IBeginTransactionResponse, - protos.google.datastore.v1.IBeginTransactionRequest | undefined, - {} | undefined, - ]) => { - this._log.info('beginTransaction response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Commits a transaction, 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 protos.google.datastore.v1.Datastore.BeginTransaction|Datastore.BeginTransaction}. - * @param {google.datastore.v1.TransactionOptions} request.singleUseTransaction - * Options for beginning a new transaction for this request. - * The transaction is committed when the request completes. If specified, - * {@link protos.google.datastore.v1.TransactionOptions|TransactionOptions.mode} must be - * {@link protos.google.datastore.v1.TransactionOptions.ReadWrite|TransactionOptions.ReadWrite}. - * @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 {@link protos.google.datastore.v1.CommitResponse|CommitResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @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, - ] - >; - 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; - commit( - 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< - 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 { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.projectId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['project_id'] ?? fieldValue; - Object.assign(routingParameter, { project_id: parameterValue }); - } - } - } - { - const fieldValue = request.databaseId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['database_id'] ?? fieldValue; - Object.assign(routingParameter, { database_id: parameterValue }); - } - } - } - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams(routingParameter); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('commit request %j', request); - const wrappedCallback: - | Callback< - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('commit response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .commit(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.datastore.v1.ICommitResponse, - protos.google.datastore.v1.ICommitRequest | undefined, - {} | undefined, - ]) => { - this._log.info('commit response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * Rolls back a transaction. - * - * @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 protos.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 {@link protos.google.datastore.v1.RollbackResponse|RollbackResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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, - ] - >; - 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; - rollback( - 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< - 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 { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.projectId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['project_id'] ?? fieldValue; - Object.assign(routingParameter, { project_id: parameterValue }); - } - } - } - { - const fieldValue = request.databaseId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['database_id'] ?? fieldValue; - Object.assign(routingParameter, { database_id: parameterValue }); - } - } - } - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams(routingParameter); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('rollback request %j', request); - const wrappedCallback: - | Callback< - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('rollback response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .rollback(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.datastore.v1.IRollbackResponse, - protos.google.datastore.v1.IRollbackRequest | undefined, - {} | undefined, - ]) => { - this._log.info('rollback response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * 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 {@link protos.google.datastore.v1.AllocateIdsResponse|AllocateIdsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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, - ] - >; - 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; - allocateIds( - 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< - 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 { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.projectId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['project_id'] ?? fieldValue; - Object.assign(routingParameter, { project_id: parameterValue }); - } - } - } - { - const fieldValue = request.databaseId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['database_id'] ?? fieldValue; - Object.assign(routingParameter, { database_id: parameterValue }); - } - } - } - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams(routingParameter); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('allocateIds request %j', request); - const wrappedCallback: - | Callback< - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('allocateIds response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .allocateIds(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.datastore.v1.IAllocateIdsResponse, - protos.google.datastore.v1.IAllocateIdsRequest | undefined, - {} | undefined, - ]) => { - this._log.info('allocateIds response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - /** - * 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 {@link protos.google.datastore.v1.ReserveIdsResponse|ReserveIdsResponse}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * 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, - ] - >; - 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; - reserveIds( - 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< - 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 { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - let routingParameter = {}; - { - const fieldValue = request.projectId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['project_id'] ?? fieldValue; - Object.assign(routingParameter, { project_id: parameterValue }); - } - } - } - { - const fieldValue = request.databaseId; - if (fieldValue !== undefined && fieldValue !== null) { - const match = fieldValue.toString().match(RegExp('(?.*)')); - if (match) { - const parameterValue = match.groups?.['database_id'] ?? fieldValue; - Object.assign(routingParameter, { database_id: parameterValue }); - } - } - } - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams(routingParameter); - this.initialize().catch((err) => { - throw err; - }); - this._log.info('reserveIds request %j', request); - const wrappedCallback: - | Callback< - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest | null | undefined, - {} | null | undefined - > - | undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('reserveIds response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls - .reserveIds(request, options, wrappedCallback) - ?.then( - ([response, options, rawResponse]: [ - protos.google.datastore.v1.IReserveIdsResponse, - protos.google.datastore.v1.IReserveIdsRequest | undefined, - {} | undefined, - ]) => { - this._log.info('reserveIds response %j', response); - return [response, options, rawResponse]; - }, - ) - .catch((error: any) => { - if ( - error && - 'statusDetails' in error && - error.statusDetails instanceof Array - ) { - const protos = this._gaxModule.protobuf.Root.fromJSON( - jsonProtos, - ) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray( - error.statusDetails, - protos, - ); - } - throw error; - }); - } - - /** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions, - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - if (this.datastoreStub && !this._terminated) { - return this.datastoreStub.then((stub) => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/handwritten/datastore/src/v1/datastore_client_config.json b/handwritten/datastore/src/v1/datastore_client_config.json deleted file mode 100644 index 00d94ed6e47c..000000000000 --- a/handwritten/datastore/src/v1/datastore_client_config.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "interfaces": { - "google.datastore.v1.Datastore": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "Lookup": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "RunQuery": { - "timeout_millis": 60000, - "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", - "retry_params_name": "default" - }, - "Commit": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "Rollback": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AllocateIds": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ReserveIds": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/handwritten/datastore/src/v1/datastore_proto_list.json b/handwritten/datastore/src/v1/datastore_proto_list.json deleted file mode 100644 index 9bbbda2f9425..000000000000 --- a/handwritten/datastore/src/v1/datastore_proto_list.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - "../../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", - "../../protos/google/datastore/v1/query_profile.proto" -] diff --git a/handwritten/datastore/src/v1/gapic_metadata.json b/handwritten/datastore/src/v1/gapic_metadata.json deleted file mode 100644 index 2b53e796b476..000000000000 --- a/handwritten/datastore/src/v1/gapic_metadata.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "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", - "services": { - "DatastoreAdmin": { - "clients": { - "grpc": { - "libraryClient": "DatastoreAdminClient", - "rpcs": { - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "ExportEntities": { - "methods": [ - "exportEntities" - ] - }, - "ImportEntities": { - "methods": [ - "importEntities" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DatastoreAdminClient", - "rpcs": { - "GetIndex": { - "methods": [ - "getIndex" - ] - }, - "ExportEntities": { - "methods": [ - "exportEntities" - ] - }, - "ImportEntities": { - "methods": [ - "importEntities" - ] - }, - "CreateIndex": { - "methods": [ - "createIndex" - ] - }, - "DeleteIndex": { - "methods": [ - "deleteIndex" - ] - }, - "ListIndexes": { - "methods": [ - "listIndexes", - "listIndexesStream", - "listIndexesAsync" - ] - } - } - } - } - } - } -} diff --git a/handwritten/datastore/src/v1/index.ts b/handwritten/datastore/src/v1/index.ts index 8f7c527c2b59..862cc47aa0db 100644 --- a/handwritten/datastore/src/v1/index.ts +++ b/handwritten/datastore/src/v1/index.ts @@ -16,5 +16,5 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -export {DatastoreClient} from './datastore_client'; -export {DatastoreAdminClient} from './datastore_admin_client'; +export {DatastoreClient} from '@google-cloud/datastore-api'; +export {DatastoreAdminClient} from '@google-cloud/datastore-api'; diff --git a/handwritten/datastore/system-test/datastore.ts b/handwritten/datastore/system-test/datastore.ts index db9ceb5a05e2..ad644fd1dee0 100644 --- a/handwritten/datastore/system-test/datastore.ts +++ b/handwritten/datastore/system-test/datastore.ts @@ -17,7 +17,7 @@ import * as path from 'path'; import {after, before, describe, it} from 'mocha'; import * as yaml from 'js-yaml'; import {Datastore, DatastoreOptions, Index, Transaction} from '../src'; -import {google} from '../protos/protos'; +import {google} from '../src/protos'; import {Storage} from '@google-cloud/storage'; import {AggregateField, AggregateQuery} from '../src/aggregate'; import {and, or, PropertyFilter} from '../src/filter'; diff --git a/handwritten/datastore/test/gapic-mocks/client-initialization-testing.ts b/handwritten/datastore/test/gapic-mocks/client-initialization-testing.ts index de5230ae3b12..a3a16ef7dc30 100644 --- a/handwritten/datastore/test/gapic-mocks/client-initialization-testing.ts +++ b/handwritten/datastore/test/gapic-mocks/client-initialization-testing.ts @@ -23,7 +23,7 @@ import { import * as assert from 'assert'; import * as proxyquire from 'proxyquire'; import {Callback, CallOptions} from 'google-gax'; -import * as protos from '../../protos/protos'; +import * as protos from '../../src/protos'; import * as ds from '../../src'; import * as mocha from 'mocha'; diff --git a/handwritten/datastore/test/gapic-mocks/commit.ts b/handwritten/datastore/test/gapic-mocks/commit.ts index 3ef17096be52..08b3d368a6c3 100644 --- a/handwritten/datastore/test/gapic-mocks/commit.ts +++ b/handwritten/datastore/test/gapic-mocks/commit.ts @@ -14,11 +14,10 @@ import * as assert from 'assert'; import {describe} from 'mocha'; -import * as protos from '../../protos/protos'; +import {protos, google} from '../../src/protos'; import {getInitializedDatastoreClient} from './get-initialized-datastore-client'; import type {CallOptions} from 'google-gax'; import {Entities} from '../../src/entity'; -import {google} from '../../protos/protos'; import IValue = google.datastore.v1.IValue; import {complexCaseEntities} from '../fixtures/complexCaseLargeStrings'; diff --git a/handwritten/datastore/test/gapic-mocks/runQuery.ts b/handwritten/datastore/test/gapic-mocks/runQuery.ts index 1710d2a6354c..687e8eebc481 100644 --- a/handwritten/datastore/test/gapic-mocks/runQuery.ts +++ b/handwritten/datastore/test/gapic-mocks/runQuery.ts @@ -14,8 +14,7 @@ import * as assert from 'assert'; import {describe} from 'mocha'; -import {DatastoreClient} from '../../src'; -import * as protos from '../../protos/protos'; +import * as protos from '../../src/protos'; import {getInitializedDatastoreClient} from './get-initialized-datastore-client'; describe('Run Query', () => { diff --git a/handwritten/datastore/test/gapic_datastore_admin_v1.ts b/handwritten/datastore/test/gapic_datastore_admin_v1.ts deleted file mode 100644 index 55cd3968baad..000000000000 --- a/handwritten/datastore/test/gapic_datastore_admin_v1.ts +++ /dev/null @@ -1,1908 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import { SinonStub } from 'sinon'; -import { describe, it } from 'mocha'; -import * as datastoreadminModule from '../src'; - -import { PassThrough } from 'stream'; - -import { protobuf, LROperation, operationsProtos } from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON( - require('../protos/protos.json'), -).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = ( - instance.constructor as typeof protobuf.Message - ).toObject(instance as protobuf.Message, { defaults: true }); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject, - ) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error - ? sinon.stub().rejects(error) - : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback( - response?: ResponseType, - error?: Error, -) { - return error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall( - response?: ResponseType, - callError?: Error, - lroError?: Error, -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().rejects(callError) - : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback( - response?: ResponseType, - callError?: Error, - lroError?: Error, -) { - const innerStub = lroError - ? sinon.stub().rejects(lroError) - : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError - ? sinon.stub().callsArgWith(2, callError) - : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall( - responses?: ResponseType[], - error?: Error, -) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error - ? sinon.stub().callsArgWith(2, error) - : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { - mockStream.write({}); - }); - } - setImmediate(() => { - mockStream.end(); - }); - } else { - setImmediate(() => { - mockStream.write({}); - }); - setImmediate(() => { - mockStream.end(); - }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall( - responses?: ResponseType[], - error?: Error, -) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({ done: true, value: undefined }); - } - return Promise.resolve({ done: false, value: responses![counter++] }); - }, - }; - }, - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.DatastoreAdminClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'datastore.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, 'googleapis.com'); - }); - - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = - datastoreadminModule.v1.DatastoreAdminClient.servicePath; - assert.strictEqual(servicePath, 'datastore.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = - datastoreadminModule.v1.DatastoreAdminClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'datastore.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - universeDomain: 'example.com', - }); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'datastore.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - universe_domain: 'example.com', - }); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'datastore.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new datastoreadminModule.v1.DatastoreAdminClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'datastore.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - universeDomain: 'configured.example.com', - }); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'datastore.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { - new datastoreadminModule.v1.DatastoreAdminClient({ - universe_domain: 'example.com', - universeDomain: 'example.net', - }); - }); - }); - - it('has port', () => { - const port = datastoreadminModule.v1.DatastoreAdminClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - assert.strictEqual(client.datastoreAdminStub, undefined); - await client.initialize(); - assert(client.datastoreAdminStub); - }); - - it('has close method for the initialized client', (done) => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.initialize().catch((err) => { - throw err; - }); - assert(client.datastoreAdminStub); - client - .close() - .then(() => { - done(); - }) - .catch((err) => { - throw err; - }); - }); - - it('has close method for the non-initialized client', (done) => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - assert.strictEqual(client.datastoreAdminStub, undefined); - client - .close() - .then(() => { - done(); - }) - .catch((err) => { - throw err; - }); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - 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 datastoreadminModule.v1.DatastoreAdminClient({ - 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('getIndex', () => { - it('invokes getIndex without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.GetIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.GetIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue( - '.google.datastore.admin.v1.GetIndexRequest', - ['indexId'], - ); - request.indexId = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&index_id=${defaultValue2 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.admin.v1.Index(), - ); - client.innerApiCalls.getIndex = stubSimpleCall(expectedResponse); - const [response] = await client.getIndex(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIndex without error using callback', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.GetIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.GetIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue( - '.google.datastore.admin.v1.GetIndexRequest', - ['indexId'], - ); - request.indexId = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&index_id=${defaultValue2 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.admin.v1.Index(), - ); - client.innerApiCalls.getIndex = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getIndex( - request, - ( - err?: Error | null, - result?: protos.google.datastore.admin.v1.IIndex | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.getIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIndex with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.GetIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.GetIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue( - '.google.datastore.admin.v1.GetIndexRequest', - ['indexId'], - ); - request.indexId = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&index_id=${defaultValue2 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getIndex(request), expectedError); - const actualRequest = ( - client.innerApiCalls.getIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.getIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getIndex with closed client', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.GetIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.GetIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue( - '.google.datastore.admin.v1.GetIndexRequest', - ['indexId'], - ); - request.indexId = defaultValue2; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.getIndex(request), expectedError); - }); - }); - - describe('exportEntities', () => { - it('invokes exportEntities without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ExportEntitiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ExportEntitiesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.exportEntities = - stubLongRunningCall(expectedResponse); - const [operation] = await client.exportEntities(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.exportEntities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.exportEntities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportEntities without error using callback', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ExportEntitiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ExportEntitiesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.exportEntities = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.exportEntities( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.datastore.admin.v1.IExportEntitiesResponse, - protos.google.datastore.admin.v1.IExportEntitiesMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.exportEntities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.exportEntities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportEntities with call error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ExportEntitiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ExportEntitiesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportEntities = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects(client.exportEntities(request), expectedError); - const actualRequest = ( - client.innerApiCalls.exportEntities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.exportEntities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes exportEntities with LRO error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ExportEntitiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ExportEntitiesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.exportEntities = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.exportEntities(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.exportEntities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.exportEntities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkExportEntitiesProgress without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkExportEntitiesProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkExportEntitiesProgress with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkExportEntitiesProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('importEntities', () => { - it('invokes importEntities without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ImportEntitiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ImportEntitiesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.importEntities = - stubLongRunningCall(expectedResponse); - const [operation] = await client.importEntities(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.importEntities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.importEntities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importEntities without error using callback', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ImportEntitiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ImportEntitiesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.importEntities = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.importEntities( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, - protos.google.datastore.admin.v1.IImportEntitiesMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.importEntities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.importEntities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importEntities with call error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ImportEntitiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ImportEntitiesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importEntities = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects(client.importEntities(request), expectedError); - const actualRequest = ( - client.innerApiCalls.importEntities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.importEntities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes importEntities with LRO error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ImportEntitiesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ImportEntitiesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.importEntities = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.importEntities(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.importEntities as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.importEntities as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkImportEntitiesProgress without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkImportEntitiesProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkImportEntitiesProgress with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects( - client.checkImportEntitiesProgress(''), - expectedError, - ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('createIndex', () => { - it('invokes createIndex without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.CreateIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.CreateIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.createIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createIndex without error using callback', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.CreateIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.CreateIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.createIndex = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createIndex( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.createIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createIndex with call error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.CreateIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.CreateIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects(client.createIndex(request), expectedError); - const actualRequest = ( - client.innerApiCalls.createIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createIndex with LRO error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.CreateIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.CreateIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createIndex = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.createIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.createIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateIndexProgress without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateIndexProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateIndexProgress with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.checkCreateIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('deleteIndex', () => { - it('invokes deleteIndex without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.DeleteIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.DeleteIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue( - '.google.datastore.admin.v1.DeleteIndexRequest', - ['indexId'], - ); - request.indexId = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&index_id=${defaultValue2 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.deleteIndex = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteIndex(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteIndex without error using callback', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.DeleteIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.DeleteIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue( - '.google.datastore.admin.v1.DeleteIndexRequest', - ['indexId'], - ); - request.indexId = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&index_id=${defaultValue2 ?? ''}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation(), - ); - client.innerApiCalls.deleteIndex = - stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteIndex( - request, - ( - err?: Error | null, - result?: LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - > | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const operation = (await promise) as LROperation< - protos.google.datastore.admin.v1.IIndex, - protos.google.datastore.admin.v1.IIndexOperationMetadata - >; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.deleteIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteIndex with call error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.DeleteIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.DeleteIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue( - '.google.datastore.admin.v1.DeleteIndexRequest', - ['indexId'], - ); - request.indexId = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&index_id=${defaultValue2 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall( - undefined, - expectedError, - ); - await assert.rejects(client.deleteIndex(request), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteIndex with LRO error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.DeleteIndexRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.DeleteIndexRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const defaultValue2 = getTypeDefaultValue( - '.google.datastore.admin.v1.DeleteIndexRequest', - ['indexId'], - ); - request.indexId = defaultValue2; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}&index_id=${defaultValue2 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteIndex = stubLongRunningCall( - undefined, - undefined, - expectedError, - ); - const [operation] = await client.deleteIndex(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteIndex as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteIndex as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteIndexProgress without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - expectedResponse.name = 'test'; - expectedResponse.response = { type_url: 'url', value: Buffer.from('') }; - expectedResponse.metadata = { type_url: 'url', value: Buffer.from('') }; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteIndexProgress( - expectedResponse.name, - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteIndexProgress with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.checkDeleteIndexProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - }); - - describe('listIndexes', () => { - it('invokes listIndexes without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ListIndexesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ListIndexesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - ]; - client.innerApiCalls.listIndexes = stubSimpleCall(expectedResponse); - const [response] = await client.listIndexes(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listIndexes as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listIndexes as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listIndexes without error using callback', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ListIndexesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ListIndexesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - ]; - client.innerApiCalls.listIndexes = - stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listIndexes( - request, - ( - err?: Error | null, - result?: protos.google.datastore.admin.v1.IIndex[] | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listIndexes as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listIndexes as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listIndexes with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ListIndexesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ListIndexesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.innerApiCalls.listIndexes = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.listIndexes(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listIndexes as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listIndexes as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listIndexesStream without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ListIndexesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ListIndexesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - ]; - client.descriptors.page.listIndexes.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listIndexesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.datastore.admin.v1.Index[] = []; - stream.on( - 'data', - (response: protos.google.datastore.admin.v1.Index) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - const responses = await promise; - assert.deepStrictEqual(responses, expectedResponse); - assert( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listIndexes, request), - ); - assert( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('invokes listIndexesStream with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ListIndexesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ListIndexesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listIndexes.createStream = stubPageStreamingCall( - undefined, - expectedError, - ); - const stream = client.listIndexesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.datastore.admin.v1.Index[] = []; - stream.on( - 'data', - (response: protos.google.datastore.admin.v1.Index) => { - responses.push(response); - }, - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listIndexes, request), - ); - assert( - (client.descriptors.page.listIndexes.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listIndexes without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ListIndexesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ListIndexesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedResponse = [ - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - generateSampleMessage(new protos.google.datastore.admin.v1.Index()), - ]; - client.descriptors.page.listIndexes.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.datastore.admin.v1.IIndex[] = []; - const iterable = client.listIndexesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub).getCall( - 0, - ).args[1], - request, - ); - assert( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - - it('uses async iteration with listIndexes with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.admin.v1.ListIndexesRequest(), - ); - const defaultValue1 = getTypeDefaultValue( - '.google.datastore.admin.v1.ListIndexesRequest', - ['projectId'], - ); - request.projectId = defaultValue1; - const expectedHeaderRequestParams = `project_id=${defaultValue1 ?? ''}`; - const expectedError = new Error('expected'); - client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError, - ); - const iterable = client.listIndexesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.datastore.admin.v1.IIndex[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub).getCall( - 0, - ).args[1], - request, - ); - assert( - (client.descriptors.page.listIndexes.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams), - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.operationsClient.getOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - client.operationsClient.getOperation = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient - .getOperation( - request, - undefined, - ( - err?: Error | null, - result?: operationsProtos.google.longrunning.Operation | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest(), - ); - const expectedError = new Error('expected'); - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(async () => { - await client.getOperation(request); - }, expectedError); - assert( - (client.operationsClient.getOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - }); - describe('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.cancelOperation = - stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.operationsClient.cancelOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.cancelOperation = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient - .cancelOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest(), - ); - const expectedError = new Error('expected'); - client.operationsClient.cancelOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(async () => { - await client.cancelOperation(request); - }, expectedError); - assert( - (client.operationsClient.cancelOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.deleteOperation = - stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.operationsClient.deleteOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.deleteOperation = sinon - .stub() - .callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.operationsClient - .deleteOperation( - request, - undefined, - ( - err?: Error | null, - result?: protos.google.protobuf.Empty | null, - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest(), - ); - const expectedError = new Error('expected'); - client.operationsClient.deleteOperation = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(async () => { - await client.deleteOperation(request); - }, expectedError); - assert( - (client.operationsClient.deleteOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - }); - describe('listOperationsAsync', () => { - it('uses async iteration with listOperations without error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest(), - ); - const expectedResponse = [ - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse(), - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse(), - ), - generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsResponse(), - ), - ]; - client.operationsClient.descriptor.listOperations.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: operationsProtos.google.longrunning.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.operationsClient.descriptor.listOperations - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new datastoreadminModule.v1.DatastoreAdminClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest(), - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.operationsClient.descriptor.listOperations - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - }); - }); -}); diff --git a/handwritten/datastore/test/gapic_datastore_v1.ts b/handwritten/datastore/test/gapic_datastore_v1.ts deleted file mode 100644 index 5d08da074b51..000000000000 --- a/handwritten/datastore/test/gapic_datastore_v1.ts +++ /dev/null @@ -1,1541 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import { SinonStub } from 'sinon'; -import { describe, it } from 'mocha'; -import * as datastoreModule from '../src'; - -import { protobuf, operationsProtos } from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON( - require('../protos/protos.json'), -).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = ( - instance.constructor as typeof protobuf.Message - ).toObject(instance as protobuf.Message, { defaults: true }); - return (instance.constructor as typeof protobuf.Message).fromObject( - filledObject, - ) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error - ? sinon.stub().rejects(error) - : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback( - response?: ResponseType, - error?: Error, -) { - return error - ? sinon.stub().callsArgWith(2, error) - : sinon.stub().callsArgWith(2, null, response); -} - -function 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', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new datastoreModule.v1.DatastoreClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'datastore.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new datastoreModule.v1.DatastoreClient(); - const universeDomain = client.universeDomain; - assert.strictEqual(universeDomain, 'googleapis.com'); - }); - - if ( - typeof process === 'object' && - typeof process.emitWarning === 'function' - ) { - it('throws DeprecationWarning if static servicePath is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const servicePath = datastoreModule.v1.DatastoreClient.servicePath; - assert.strictEqual(servicePath, 'datastore.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = datastoreModule.v1.DatastoreClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'datastore.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new datastoreModule.v1.DatastoreClient({ - universeDomain: 'example.com', - }); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'datastore.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new datastoreModule.v1.DatastoreClient({ - universe_domain: 'example.com', - }); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'datastore.example.com'); - }); - - if (typeof process === 'object' && 'env' in process) { - describe('GOOGLE_CLOUD_UNIVERSE_DOMAIN environment variable', () => { - it('sets apiEndpoint from environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new datastoreModule.v1.DatastoreClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'datastore.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - - it('value configured in code has priority over environment variable', () => { - const saved = process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = 'example.com'; - const client = new datastoreModule.v1.DatastoreClient({ - universeDomain: 'configured.example.com', - }); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'datastore.configured.example.com'); - if (saved) { - process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN'] = saved; - } else { - delete process.env['GOOGLE_CLOUD_UNIVERSE_DOMAIN']; - } - }); - }); - } - it('does not allow setting both universeDomain and universe_domain', () => { - assert.throws(() => { - new datastoreModule.v1.DatastoreClient({ - universe_domain: 'example.com', - universeDomain: 'example.net', - }); - }); - }); - - 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 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', - }); - client.initialize().catch((err) => { - throw err; - }); - assert(client.datastoreStub); - client - .close() - .then(() => { - done(); - }) - .catch((err) => { - throw err; - }); - }); - - 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(); - }) - .catch((err) => { - throw err; - }); - }); - - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.LookupRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.LookupResponse(), - ); - client.innerApiCalls.lookup = stubSimpleCall(expectedResponse); - const [response] = await client.lookup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.lookup as SinonStub).getCall( - 0, - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.lookup as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookup without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.LookupRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - 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); - const actualRequest = (client.innerApiCalls.lookup as SinonStub).getCall( - 0, - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.lookup as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookup with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.LookupRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.lookup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.lookup(request), expectedError); - const actualRequest = (client.innerApiCalls.lookup as SinonStub).getCall( - 0, - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.lookup as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes lookup with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.LookupRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunQueryRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.RunQueryResponse(), - ); - client.innerApiCalls.runQuery = stubSimpleCall(expectedResponse); - const [response] = await client.runQuery(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.runQuery as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runQuery as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runQuery without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunQueryRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - 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); - const actualRequest = ( - client.innerApiCalls.runQuery as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runQuery as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runQuery with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunQueryRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.runQuery = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.runQuery(request), expectedError); - const actualRequest = ( - client.innerApiCalls.runQuery as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runQuery as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runQuery with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunQueryRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.runQuery(request), expectedError); - }); - }); - - describe('runAggregationQuery', () => { - it('invokes runAggregationQuery without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunAggregationQueryRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.RunAggregationQueryResponse(), - ); - client.innerApiCalls.runAggregationQuery = - stubSimpleCall(expectedResponse); - const [response] = await client.runAggregationQuery(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.runAggregationQuery as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runAggregationQuery as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runAggregationQuery without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunAggregationQueryRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - 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); - const actualRequest = ( - client.innerApiCalls.runAggregationQuery as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runAggregationQuery as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runAggregationQuery with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunAggregationQueryRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.runAggregationQuery = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.runAggregationQuery(request), expectedError); - const actualRequest = ( - client.innerApiCalls.runAggregationQuery as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.runAggregationQuery as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes runAggregationQuery with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RunAggregationQueryRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.runAggregationQuery(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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionResponse(), - ); - client.innerApiCalls.beginTransaction = stubSimpleCall(expectedResponse); - const [response] = await client.beginTransaction(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.beginTransaction as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.beginTransaction as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes beginTransaction without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - 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); - const actualRequest = ( - client.innerApiCalls.beginTransaction as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.beginTransaction as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes beginTransaction with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.beginTransaction = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.beginTransaction(request), expectedError); - const actualRequest = ( - client.innerApiCalls.beginTransaction as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.beginTransaction as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes beginTransaction with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.BeginTransactionRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.beginTransaction(request), expectedError); - }); - }); - - describe('commit', () => { - it('invokes commit without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.CommitRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.CommitResponse(), - ); - client.innerApiCalls.commit = stubSimpleCall(expectedResponse); - const [response] = await client.commit(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.commit as SinonStub).getCall( - 0, - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.commit as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commit without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.CommitRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - 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); - const actualRequest = (client.innerApiCalls.commit as SinonStub).getCall( - 0, - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.commit as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commit with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.CommitRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.commit = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.commit(request), expectedError); - const actualRequest = (client.innerApiCalls.commit as SinonStub).getCall( - 0, - ).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.commit as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes commit with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.CommitRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.commit(request), expectedError); - }); - }); - - describe('rollback', () => { - it('invokes rollback without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RollbackRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.RollbackResponse(), - ); - client.innerApiCalls.rollback = stubSimpleCall(expectedResponse); - const [response] = await client.rollback(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.rollback as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.rollback as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollback without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RollbackRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - 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); - const actualRequest = ( - client.innerApiCalls.rollback as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.rollback as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollback with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RollbackRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.rollback = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.rollback(request), expectedError); - const actualRequest = ( - client.innerApiCalls.rollback as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.rollback as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes rollback with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.RollbackRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsResponse(), - ); - client.innerApiCalls.allocateIds = stubSimpleCall(expectedResponse); - const [response] = await client.allocateIds(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.allocateIds as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.allocateIds as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes allocateIds without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - 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); - const actualRequest = ( - client.innerApiCalls.allocateIds as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.allocateIds as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes allocateIds with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.allocateIds = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.allocateIds(request), expectedError); - const actualRequest = ( - client.innerApiCalls.allocateIds as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.allocateIds as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes allocateIds with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.AllocateIdsRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - 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', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedResponse = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsResponse(), - ); - client.innerApiCalls.reserveIds = stubSimpleCall(expectedResponse); - const [response] = await client.reserveIds(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.reserveIds as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.reserveIds as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes reserveIds without error using callback', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - 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); - const actualRequest = ( - client.innerApiCalls.reserveIds as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.reserveIds as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes reserveIds with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedHeaderRequestParams = 'database_id=value'; - const expectedError = new Error('expected'); - client.innerApiCalls.reserveIds = stubSimpleCall( - undefined, - expectedError, - ); - await assert.rejects(client.reserveIds(request), expectedError); - const actualRequest = ( - client.innerApiCalls.reserveIds as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.reserveIds as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes reserveIds with closed client', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.datastore.v1.ReserveIdsRequest(), - ); - // path template is empty - request.databaseId = 'value'; - const expectedError = new Error('The client has already been closed.'); - client.close().catch((err) => { - throw err; - }); - await assert.rejects(client.reserveIds(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', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.GetOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation(), - ); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const response = await client.getOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.operationsClient.getOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - it('invokes getOperation without error using callback', async () => { - const client = new 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); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - it('invokes getOperation with error', async () => { - const client = new 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('cancelOperation', () => { - it('invokes cancelOperation without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.CancelOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.cancelOperation = - stubSimpleCall(expectedResponse); - const response = await client.cancelOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.operationsClient.cancelOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - it('invokes cancelOperation without error using callback', async () => { - const client = new 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); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); - }); - it('invokes cancelOperation with error', async () => { - const client = new 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), - ); - }); - }); - describe('deleteOperation', () => { - it('invokes deleteOperation without error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.DeleteOperationRequest(), - ); - const expectedResponse = generateSampleMessage( - new protos.google.protobuf.Empty(), - ); - client.operationsClient.deleteOperation = - stubSimpleCall(expectedResponse); - const response = await client.deleteOperation(request); - assert.deepStrictEqual(response, [expectedResponse]); - assert( - (client.operationsClient.deleteOperation as SinonStub) - .getCall(0) - .calledWith(request), - ); - }); - it('invokes deleteOperation without error using callback', async () => { - const client = new 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); - } - }, - ) - .catch((err) => { - throw err; - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); - }); - it('invokes deleteOperation with error', async () => { - const client = new 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), - ); - }); - }); - 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.IOperation[] = []; - const iterable = client.operationsClient.listOperationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.operationsClient.descriptor.listOperations - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - }); - it('uses async iteration with listOperations with error', async () => { - const client = new datastoreModule.v1.DatastoreClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new operationsProtos.google.longrunning.ListOperationsRequest(), - ); - const expectedError = new Error('expected'); - client.operationsClient.descriptor.listOperations.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.operationsClient.listOperationsAsync(request); - await assert.rejects(async () => { - const responses: operationsProtos.google.longrunning.IOperation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.operationsClient.descriptor.listOperations - .asyncIterate as SinonStub - ).getCall(0).args[1], - request, - ); - }); - }); -}); diff --git a/handwritten/datastore/test/index.ts b/handwritten/datastore/test/index.ts index a0074bd7f409..e3a1dc623765 100644 --- a/handwritten/datastore/test/index.ts +++ b/handwritten/datastore/test/index.ts @@ -33,7 +33,7 @@ import {ExplainOptions, ExplainMetrics, RunQueryInfo} from '../src/query'; import * as is from 'is'; import * as sinon from 'sinon'; import * as extend from 'extend'; -import {google} from '../protos/protos'; +import {google} from '../src/protos'; import {ServiceError} from 'google-gax'; // eslint-disable-next-line @typescript-eslint/no-var-requires diff --git a/handwritten/datastore/test/request.ts b/handwritten/datastore/test/request.ts index 48f582381a11..97366be73bbe 100644 --- a/handwritten/datastore/test/request.ts +++ b/handwritten/datastore/test/request.ts @@ -22,7 +22,7 @@ import * as proxyquire from 'proxyquire'; import * as sinon from 'sinon'; import {PassThrough, Transform} from 'stream'; -import {google} from '../protos/protos'; +import {google} from '../src/protos'; import * as ds from '../src'; import {entity, Entity, KeyProto} from '../src/entity.js'; import {IntegerTypeCastOptions, Query, QueryProto} from '../src/query.js'; diff --git a/handwritten/datastore/test/transaction.ts b/handwritten/datastore/test/transaction.ts index 4da7bdb17105..e1d8657578f5 100644 --- a/handwritten/datastore/test/transaction.ts +++ b/handwritten/datastore/test/transaction.ts @@ -40,9 +40,8 @@ import { RequestConfig, } from '../src/request'; import {SECOND_DATABASE_ID} from './index'; -import {google} from '../protos/protos'; +import {protos, google} from '../src/protos'; import {RunCallback} from '../src/transaction'; -import * as protos from '../protos/protos'; import {AggregateQuery} from '../src/aggregate'; import {RunQueryCallback, RunQueryInfo, RunQueryOptions} from '../src/query'; import * as mocha from 'mocha';